# root on LVM2: shutdown can't deactivate /

## nielchiano

HI,

sorry if this is a dup. I was searched a bit and didn't find anything related, but the search-terms "root lvm" match quite a lot of posts. (I did find this, but this is another, related question)

I'm considering on putting my complete system (appart from /boot) on LVM2. I know putting / on LVM is not recommended, but the only reasons I found so far were: "need initrd to boot" and "hard to upgrade/rescue". I can live with those.

There is however a more serious problem. On my test setup I get a problem during shutdown. The init-scripts want to bring down LVM, which obviously fails, because / is still mounted (duh). In the script (/lib/rcscripts/addons/lvm-stop.sh) there is a link to https://www.redhat.com/archives/linux-lvm/2001-May/msg00523.html which explains the problem.

Basicaly, the post answers my question, but I'm concerned for the future: If a future release of LVM DOES update the metadata, it will become impossible to have my / on LVM. Is this problem solvable? or is root on lvm just "unsupported" and should I go cry in a corner?

----------

## wrs4

I'm curious...is there a particularly compelling reason to have / on lvm?  The recommendations I saw on the gentoo lvm setup guide basically said to allocate a small amount of space for a non-lvm / partition (in my case I did 512 Mb) and then place other partitions you want on the lvs (for example, home, usr, var, etc).

----------

## nielchiano

 *wrs4 wrote:*   

> I'm curious...is there a particularly compelling reason to have / on lvm?

 consistency. Why NOT put it on LVM (short of the thing I mentioned here)?

The main reason to use LVM is to gain flexibility. I don't want to cut down on that because / can't be on it...

but the actual reason: Only because most guides tell me "don't do this, because it's complicated and hard": this makes it a chalenge for me   :Laughing:   :Laughing: 

----------

## wrs4

Nice response   :Very Happy: 

I guess the way I look at it is....technically, / exists for mounting everything; not necessarily for containing everythng.  So, a minimal / on a regular partition serves as a bare mount point for the stuff you need to have expandable (lvm) and for virtual filesystems (dev, shm, proc).

That's just me though   :Smile: 

OTOH, if you can figure out a way to do it, more power to you.

----------

## nielchiano

 *wrs4 wrote:*   

> technically, / exists for mounting everything; not necessarily for containing everythng.  So, a minimal / on a regular partition serves as a bare mount point for the stuff you need to have expandable (lvm) and for virtual filesystems (dev, shm, proc).

 Exactly my point... just change / to /boot and add / to the LVM list  :Wink: 

----------

## wrs4

WTH?    :Very Happy: 

You want /boot, a regular partition, to mount off /, an lvm partition?  *shakes head in mock confusion*

How do you expect to be able to shut down the vgs and still have dev, proc, and shm operational if / is an lv?    :Smile: 

----------

## nielchiano

 *wrs4 wrote:*   

> You want /boot, a regular partition, to mount off /, an lvm partition?  *shakes head in mock confusion*

 

/boot has to be regular, since GRUB needs it. I boot a kernel with an initrd (read from /boot). This initrd brings the LVM online and starts the regular init process from /.

 *wrs4 wrote:*   

> How do you expect to be able to shut down the vgs and still have dev, proc, and shm operational if / is an lv?   

 

It shouldn't be a problem, I think. currently / remains mounted until the end, without deactivating the vg's. But I'm not sure if this is clean (hence my first post)

----------

## wrs4

I guess I can't see anything wrong with your logic, and a friend of mine tells me it works out of the box (as it were) for him on Debian.  Hope you find a solution  :Smile: 

----------

