Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mounted /usr causing failed e2fsck on boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
platoxia
n00b
n00b


Joined: 18 Jul 2013
Posts: 4

PostPosted: Fri Jul 19, 2013 12:42 am    Post subject: Mounted /usr causing failed e2fsck on boot Reply with quote

My system boots and works fine to this point, however, I am left with a few questions related to the subject of this post.

My set-up is built with hardened sources/profile and LVM2.

The offending output from the boot section of rc.log is as follows:

Code:

* Checking local filesystems  ...
/dev/sda3: clean, 1834/327680 files, 111782/1310720 blocks
/dev/sda1: clean, 37/65536 files, 28155/262144 blocks
/dev/sdb2: clean, 11/30531584 files, 1966902/122095104 blocks
/dev/sda6: clean, 11/32768000 files, 2107224/131071414 blocks
/dev/mapper/OSFS-usr is mounted.
e2fsck: Cannot continue, aborting.


/dev/mapper/OSFS-home: clean, 12/655360 files, 79663/2621440 blocks
/dev/mapper/OSFS-opt: clean, 12/327680 files, 55902/1310720 blocks
/dev/mapper/OSFS-var: clean, 5012/655360 files, 93245/2621440 blocks
/dev/mapper/OSFS-tmp: clean, 13/131072 files, 25390/524288 blocks
/dev/mapper/VMS-virts: clean, 11/30523392 files, 1966388/122093568 blocks
 * Operational error
 [ !! ]


To clarify the above HDD layout, OFSF is both the LVM Volume Group as well as the Physical Volume for sda, while VMS fulfils those same roles on sdb.

Here is the fdisk listing of sda for clarity:

Code:

 Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      526335      262144   83  Linux
/dev/sda2          526336    38275071    18874368   82  Linux swap / Solaris
/dev/sda3        38275072    48760831     5242880   83  Linux
/dev/sda4        48760832  1953525167   952382168    5  Extended
/dev/sda5        48762880   904951807   428094464   8e  Linux LVM
/dev/sda6       904953856  1953525167   524285656   83  Linux


And here is the listing for lvscan...

Code:

  ACTIVE            '/dev/VMS/virts' [465.75 GiB] inherit
  ACTIVE            '/dev/OSFS/usr' [10.00 GiB] inherit
  ACTIVE            '/dev/OSFS/home' [10.00 GiB] inherit
  ACTIVE            '/dev/OSFS/opt' [5.00 GiB] inherit
  ACTIVE            '/dev/OSFS/var' [10.00 GiB] inherit
  ACTIVE            '/dev/OSFS/tmp' [2.00 GiB] inherit


I don't have much understanding of how everything is loaded/unloaded in initramfs...only that '/var' and '/usr' have to be loaded to it in order to boot (or rather, that is my understanding from the Gentoo Handbook and LVM2 guide).

To be sure, the problem could be easily fixed by changing colum 6 in fstab to 0. However, I'm very curious as to why '/usr' (a logical volume) is still mounted causing e2fsck to fail, while '/var' (also a logical volume) is unmounted and checked without any problems.

I have a great many questions that have arisen from looking into this that are related to the relationship between /proc/mounts, /etc/mtab, and the mount command; as well as /etc/fstab and /etc/inittab and how they relate to the boot process (sequence leading to mounting/un-mounting of the file systems)...but I'll save those until after I understand this better.

Any help is appreciated.

Edited to eliminate confusion
Back to top
View user's profile Send private message
platoxia
n00b
n00b


Joined: 18 Jul 2013
Posts: 4

PostPosted: Fri Jul 19, 2013 9:30 am    Post subject: Reply with quote

It turns out that after digging around some more I came across /etc/initramfs.mount and found that the /usr volume is being mounted but the /var volume is not...which would explain the results I posted above.

Now that I've set the /usr volume's 6th column to 0 in fstab I have to wonder if I should do the same with the /var volume and uncomment it in /etc/initramfs.mount. The Gentoo LVM2 Installation guide was clear that if /var and/or /usr were put into lvm volumes that you need to use initramfs on boot, as they were needed. Fortunately, I've not had any issues on normal boots.

Should I mount the /var volume in initramfs, or not?
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2717
Location: The Peanut Gallery

PostPosted: Fri Jul 19, 2013 1:36 pm    Post subject: Reply with quote

platoxia wrote:
It turns out that after digging around some more I came across /etc/initramfs.mount and found that the /usr volume is being mounted but the /var volume is not...which would explain the results I posted above.

This is because udev has officially required /usr mounted before it starts for a year or so. Technically it's the equivalent of localmount, since a required file might exist anywhere on the system, like /opt or /var, though the minimal is /usr, by default. There was an alsa driver I think that had some stuff in /var a while back, but that was fixed. However the project's base requirement remains that required files are allowed anywhere on the local machine. Not for udev itself, but the userland-drivers and their files.
Quote:
Now that I've set the /usr volume's 6th column to 0 in fstab I have to wonder if I should do the same with the /var volume and uncomment it in /etc/initramfs.mount. The Gentoo LVM2 Installation guide was clear that if /var and/or /usr were put into lvm volumes that you need to use initramfs on boot, as they were needed. Fortunately, I've not had any issues on normal boots.

The only time you really need an initramfs is if your rootfs is on LVM, encrypted or software-raid, or you require udev to initialise devices in order to boot. An example would be a bluetooth keyboard, or a shared-network /usr. USB keyboard support can be builtin to the kernel, and often is to get the install done.

Other than that, as you've found, LVM copes very well, and it's possible to use udev without an initramfs by delaying udev start til after localmount, if your rootfs is not on LVM etc, and you have the drivers and modules required to start your local partitions. Most of us do, since that's how we rebooted into the kernel to do the rest of the install.

That's not something I'd recommend to a beginner, though I can vouch for the effectiveness of the method. I have a slim rootfs and LVM for most things, apart from /home /tmp and /swap. In particular I've run out of /usr space before on several distros, including gentoo, so there is no way /usr is going on the same partition as root. And given that the only real requirement is that localmount is done before udev, it's worked great.
Quote:
Should I mount the /var volume in initramfs, or not?

Sorry I can't advise, since I don't use an initramfs.
Back to top
View user's profile Send private message
platoxia
n00b
n00b


Joined: 18 Jul 2013
Posts: 4

PostPosted: Fri Jul 19, 2013 9:25 pm    Post subject: Reply with quote

Thanks for the reply. I'll need to add udev to my required reading list.
Back to top
View user's profile Send private message
The Doctor
Veteran
Veteran


Joined: 27 Jul 2010
Posts: 1493

PostPosted: Fri Jul 19, 2013 10:34 pm    Post subject: Reply with quote

platoxia wrote:
Should I mount the /var volume in initramfs, or not?


If your computer boots without errors, I would not. If you get errors I would try it. Last time I checked it was not a requirement. In fact, you may be able to boot without an initramfs or mounting /usr at all. I haven't tried it for over 6 months now, but it did work. The fork (eudev) may still be able to do it if udev no longer does. At one point, it "just worked(tm)," even after it was supposed to be dropped.

Of course, there are alternatives which don't complain about a separate /usr like mdev, but switching to them isn't something you should do lightly. Some big applications and DEs depend directly on udev. Why they should care how /dev gets populated I have no idea.
_________________
First things first, but not necessarily in that order.
Back to top
View user's profile Send private message
slaterson
Apprentice
Apprentice


Joined: 26 Feb 2003
Posts: 241

PostPosted: Tue Oct 08, 2013 12:14 am    Post subject: Reply with quote

now that gentoo is requiring /usr to be mounted by an initramfs (coming nov 1), what to do about this e2fsck error? i have a complex file system setup on a server, where /usr, /var, /var/www & /tmp are all mounted on boot. any of these that i add to initramfs produce this error on boot.

i'd like to have these file systems checked successfully when i need to reboot. is there a good to accomplish this?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum