Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #159454 > unrolled thread

Systemd bybasses fstab mounting root partition(?)

Started byIvan Boro <magwa.man@yandex.ru>
First post2015-10-19 17:30 +0200
Last post2015-10-19 22:10 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.debian.user


Contents

  Systemd bybasses fstab mounting root partition(?) Ivan Boro <magwa.man@yandex.ru> - 2015-10-19 17:30 +0200
    Re: Systemd bybasses fstab mounting root partition(?) Darac Marjal <mailinglist@darac.org.uk> - 2015-10-19 18:20 +0200
      Re: Systemd bybasses fstab mounting root partition(?) Ivan Boro <magwa.man@yandex.ru> - 2015-10-19 18:50 +0200
        Re: Systemd bybasses fstab mounting root partition(?) David Baron <d_baron@012.net.il> - 2015-10-19 21:40 +0200
          Re: Systemd bybasses fstab mounting root partition(?) Ivan Boro <magwa.man@yandex.ru> - 2015-10-19 22:10 +0200

#159454 — Systemd bybasses fstab mounting root partition(?)

FromIvan Boro <magwa.man@yandex.ru>
Date2015-10-19 17:30 +0200
SubjectSystemd bybasses fstab mounting root partition(?)
Message-ID<qlkxR-8qb-45@gated-at.bofh.it>
Looks like subj.
Have a KVM machine with jessie assembled via debootstrap. Fstab states

/dev/vda2       /       ext4    rw      0       0

The partition labeled vda2 is listed in grub.cfg as the root partition 
by its uuid.(via update-grub)

Added a disk to have swap on it. Booted normally, despite the fact, that 
the new swap-disk was automatically labeled as vda and the disk with 
root is as vdb:

# mount | grep ' / '
/dev/vdb2 on / type ext4 (rw,relatime,data=ordered)

So, systemd mounted root partition, whitout looking into fstab.

I don't have much experience in systemd, and now wonder how this "smart" 
mount works.

Ivan Boro

[toc] | [next] | [standalone]


#159456

FromDarac Marjal <mailinglist@darac.org.uk>
Date2015-10-19 18:20 +0200
Message-ID<qllkd-19s-3@gated-at.bofh.it>
In reply to#159454

[Multipart message — attachments visible in raw view] — view raw

On Mon, Oct 19, 2015 at 05:59:15PM +0300, Ivan Boro wrote:
> Looks like subj.
> Have a KVM machine with jessie assembled via debootstrap. Fstab states
> 
> /dev/vda2       /       ext4    rw      0       0
> 
> The partition labeled vda2 is listed in grub.cfg as the
> root partition by its uuid.(via update-grub)
> 
> Added a disk to have swap on it. Booted normally, despite
> the fact, that the new swap-disk was automatically labeled
> as vda and the disk with root is as vdb:
> 
> # mount | grep ' / '
> /dev/vdb2 on / type ext4 (rw,relatime,data=ordered)
> 
> So, systemd mounted root partition, whitout looking into fstab.
> 
> I don't have much experience in systemd, and now wonder how
> this "smart" mount works.

This isn't a systemd "trick", but rather the job of the 
initrd/initramfs. Back in the good old days, finding the root filesystem 
was easy (it was /dev/hdaX, or possibly /dev/sdaX if you were on a 
server with a SCSI card). Nowadays, with LVM, RAID, encrypted file 
systems, iSCSI etc etc, there are times when the kernel can't mount the 
root filesystem by itself. So distributions (such as Debian) use an 
"initial ram disk" to help find root. This consists of a single disk 
image which is provided to the kernel by the boot-loader. The disk image 
contains several tools to "discover" where the root file system is and 
mount it at a known point. When the tools on the initrd are done, the 
kernel switches to that new root file system and continues boot.

Now, you mention that you told grub that root is at UUID=xxxx. This will 
be passed to the kernel and the initrd scripts will pick up on that.  So 
your root filesystem is mounted by UUID.

When you think about it, it has to be. /etc/fstab is on your root 
filesystem. How do you read that file without knowing where the root 
filesystem is?

> 
> Ivan Boro
> 

-- 
For more information, please reread.

[toc] | [prev] | [next] | [standalone]


#159462

FromIvan Boro <magwa.man@yandex.ru>
Date2015-10-19 18:50 +0200
Message-ID<qllNg-1H5-9@gated-at.bofh.it>
In reply to#159456
Thats right.

> When you think about it, it has to be. /etc/fstab is on your root
> filesystem. How do you read that file without knowing where the root
> filesystem is?

Thank you for the detailed answer. Removed the / entry from fstab -
everything works fine.
Sorry for the mess.
----
Ivan Boro

[toc] | [prev] | [next] | [standalone]


#159472

FromDavid Baron <d_baron@012.net.il>
Date2015-10-19 21:40 +0200
Message-ID<qlorL-5Hu-5@gated-at.bofh.it>
In reply to#159462

[Multipart message — attachments visible in raw view] — view raw

On Monday 19 October 2015 19:21:18 Ivan Boro wrote:
> Thats right.
> 
> > When you think about it, it has to be. /etc/fstab is on your root
> > filesystem. How do you read that file without knowing where the root
> > filesystem is?
> 
> Thank you for the detailed answer. Removed the / entry from fstab -
> everything works fine.
> Sorry for the mess.
> ----
> Ivan Boro

Systemd balks at that / entry.
Does this mean that it no longer belongs in fstab?
Will init startups still work without it?

[toc] | [prev] | [next] | [standalone]


#159475

FromIvan Boro <magwa.man@yandex.ru>
Date2015-10-19 22:10 +0200
Message-ID<qloUO-6vr-11@gated-at.bofh.it>
In reply to#159472

On 10/19/2015 10:19 PM, David Baron wrote:
> On Monday 19 October 2015 19:21:18 Ivan Boro wrote:
> 
>> Thats right.
> 
>>
> 
>> > When you think about it, it has to be. /etc/fstab is on your root
> 
>> > filesystem. How do you read that file without knowing where the root
> 
>> > filesystem is?
> 
>>
> 
>> Thank you for the detailed answer. Removed the / entry from fstab -
> 
>> everything works fine.
> 
>> Sorry for the mess.
> 
>> ----
> 
>> Ivan Boro
> 
>  
> 
> Systemd balks at that / entry.
> 
> Does this mean that it no longer belongs in fstab?
> 
> Will init startups still work without it?
> 
Actually, was mistaken.
The options from / entry in fstab with incorrect partition for / are
processed correctly.
If I remove / entry in fstab or specify it by a wrong uuid, root
filesystem is mounted readonly.
Haven't tested the whole thing with init, but so far, incorrect value
fstab for dev in /dev/* form is processed the same way.

Sorry for the mess, again. Seems like it has nothing do do with the very
systemd.
----
Ivan Boro

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web