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


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

Systemd bybasses fstab mounting root partition(?)

Started byIvan Boro <magwa.man@yandex.ru>
First post2015-10-19 17:50 +0200
Last post2015-10-19 23:00 +0200
Articles 4 — 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:50 +0200
    Re: Systemd bybasses fstab mounting root partition(?) "Karl E. Jorgensen" <karl@jorgensen.org.uk> - 2015-10-19 19:10 +0200
      Re: Systemd bybasses fstab mounting root partition(?) Ivan Boro <magwa.man@yandex.ru> - 2015-10-19 19:40 +0200
        Re: Systemd bybasses fstab mounting root partition(?) David Wright <deblis@lionunicorn.co.uk> - 2015-10-19 23:00 +0200

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

FromIvan Boro <magwa.man@yandex.ru>
Date2015-10-19 17:50 +0200
SubjectSystemd bybasses fstab mounting root partition(?)
Message-ID<qlkRc-ll-11@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)

No errors or warnings in dmesg.

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
cc, please.

[toc] | [next] | [standalone]


#159465

From"Karl E. Jorgensen" <karl@jorgensen.org.uk>
Date2015-10-19 19:10 +0200
Message-ID<qlm6C-2kd-21@gated-at.bofh.it>
In reply to#159455
Hi

On Mon, 2015-10-19 at 18:24 +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)
> 
> No errors or warnings in dmesg.
> 
> 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.

Well - I doubt this is systemd specific.

/etc/fstab is in the root file system.  Thus, the system can only
examine /etc/fstab _after_ the root file system has been mounted...

Instead you may want to examine the kernel command line (e.g. in grub
or /proc/cmdline) - it should have "root=xxxx" in it. Nowadays that is
often specified via a UUID - and the UUID stays the same if if you move
disks about.

Hope this helps
-- 
Karl E. Jorgensen

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


#159470

FromIvan Boro <magwa.man@yandex.ru>
Date2015-10-19 19:40 +0200
Message-ID<qlmzF-2TP-31@gated-at.bofh.it>
In reply to#159465

On 10/19/2015 07:07 PM, Karl E. Jorgensen wrote:
> Hi
> 
> On Mon, 2015-10-19 at 18:24 +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)
>>
>> No errors or warnings in dmesg.
>>
>> 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.
> 
> Well - I doubt this is systemd specific.
> 
> /etc/fstab is in the root file system.  Thus, the system can only
> examine /etc/fstab _after_ the root file system has been mounted...
> 
> Instead you may want to examine the kernel command line (e.g. in grub
> or /proc/cmdline) - it should have "root=xxxx" in it. Nowadays that is
> often specified via a UUID - and the UUID stays the same if if you move
> disks about.
> 
> Hope this helps
> 

Yes. Fun thing, I've accidentally put /dev/vda1 to my host's
filesystem's fstab, and the host system runs init as pid=0.
Everything boots normally. Now I doubt, is the root entry present in the
fstab file generated automatically during system setup.

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


#159481

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2015-10-19 23:00 +0200
Message-ID<qlpHc-7uj-5@gated-at.bofh.it>
In reply to#159470
Quoting Ivan Boro (magwa.man@yandex.ru):
> On 10/19/2015 07:07 PM, Karl E. Jorgensen wrote:

> > /etc/fstab is in the root file system.  Thus, the system can only
> > examine /etc/fstab _after_ the root file system has been mounted...
> > 
> > Instead you may want to examine the kernel command line (e.g. in grub
> > or /proc/cmdline) - it should have "root=xxxx" in it. Nowadays that is
> > often specified via a UUID - and the UUID stays the same if if you move
> > disks about.
> > 
> > Hope this helps
> > 
> 
> Yes. Fun thing, I've accidentally put /dev/vda1 to my host's
> filesystem's fstab, and the host system runs init as pid=0.
> Everything boots normally. Now I doubt, is the root entry present in the
> fstab file generated automatically during system setup.

As others have said, when the system boots, grub will know which
filesystem is wanted as root for each menu entry.

However, grub can only find out which filesystem that is in the first
place by being told correctly by you. So keep your /etc/fstab
up-to-date with correct entries.

/etc/fstab should never be modified by the system, but only by you/the
sysadmin. One difference with systemd is that incorrect information is
more likely to cause problems than with sysv-style booting. A way of
thinking about this is that sysv "interprets" fstab line by line
whereas systemd "compiles" it whole.

Cheers,
David.

[toc] | [prev] | [standalone]


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


csiph-web