# usr not cleanly unmounted during shut down

## lepgalle

Hi,

since about a month ago the usr partition is not cleanly unmounted any more. I have usr in LVM and boot with Early Userspace Mounting. Today I also tried Dracut with the same problem. Since this happens at a state when file systems are remounted read only I have no messages in the logs (they stopped at that stage already).  Since var is also inside LVM it needs to be activated during boot and deactivated during shutdown just as usr and it works for var.

I am sorry that I can not be more descriptive. I did try googling but did not manage to find some thing which points me in the right direction.

Any help would be appreciated.

Cheers Petrik

----------

## Keruskerfuerst

Hardwareinfo?

Can you give some information about paritioning?

And fstab?

----------

## acmondor

How about recording any output there is on screen with a camera in video mode?

I've done this in the past (several times) and it was a big help.

----------

## coolparadox

I faced the same issue in a recent Gentoo install. As far as I could glimpse over shutdown messages, there was a hint about processes still using /usr at the moment of its unmount.

It looks /usr is getting more and more glued to the root filesystem as Gentoo evolves, and I'd guess handling a separate /usr filesystem in this OS won't be without eventual setbacks.

Anyway, the way I "solved" /usr not being unmounted in my system at shutdown: I made my root partition managed by LVM, and moved /usr to it. Now my initramfs early mounts just / (no more /usr partition to handle). I confirm this works well for correctly unmount (remount read only actually) on shutdown.

----------

## lepgalle

Hi,

You are right, some more information would be helpful. Sorry

The machine is a Dell M6500 with a 500GB hard disk and 16GB ram. The partition table is this:

    /dev/sda1 83 Linux                                  

    /dev/sda2 82 Linux swap / Solaris

    /dev/sda3 83 Linux

    /dev/sda4 8e Linux LVM

sda1 is boot and sda3 is root. The rest is in LVM (sda4) and further partitions are below in fstab:

LABEL=boot	/boot		    	    	        ext2	   noauto

LABEL=swap	none			   		swap	   sw		

LABEL=root	/			   		ext2       atime	

LABEL=var		/var			   		reiserfs   atime	

LABEL=opt		/opt			   		reiserfs   atime	

LABEL=home	/home		   		reiserfs   atime	

LABEL=usr		/usr			   		reiserfs   atime	

LABEL=dist	/usr/portage/distfiles	   	reiserfs   atime	

/dev/sr0		/mnt/cdrom		   	auto	   noauto,ro,user

proc			/proc					proc	   defaults

shm			/dev/shm	           	        tmpfs      nodev,nosuid,noexec,size=528m

tmpfs		/tmp	   		   		tmpfs      defaults,nosuid,size=1024m,mode=1777

tmpfs		/var/tmp/portage	   	tmpfs      defaults,nosuid,size=14G,mode=1777

As one can see /usr and /var are in the LVM partition and I boot with a initramfs (as in my original post I tried Early user space mounting and dracut). 

As coolparadox experienced there is a message that processes are still running just before the OS system attempts to remount /usr read only.  More precisely the following error messages appear on shut down:

1) On attempt to shut down the LVM an error message informs that this fails since a file systen is still used ("Failed (possibly some LVs still needed for /usr or root"). This is not a new message as I remember.

2) The second message is that /usr can not be remounted read only (root can).

The last message is: "Error: mount-ro failed to start" and then the screen goes off.            

I consider porting the whole system onto a second identical hard drive using btrfs such that /usr is not a separate partition and perhaps also abandoning LVM as it seems that btrfs supports subvolumes which can shrink and grow (I only came across btrfs and need a bit more reading). This isn't fixing the problem but simply giving in that /usr is not on a separate partition. Unless I have a clue what is going on I guess combining /usr and / on one partition is my best option.

Cheers

----------

## lepgalle

Hi,

as indicated I integrated /usr and /var with the root partition. However, I kept LVM and did not switch to btrfs. I moved / inside the volume group and now shut down is clean. 

Thank you very much

----------

