[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: LVM root?



Doug,

I'm certainly no expert on this, but I have been using LVM2 for a year or so, 
so ...

On Wednesday 11 October 2006 07:45, dtutty@porchlight.ca wrote:
> On Sun, Oct 08, 2006 at 10:15:22PM +0200, Jean-Luc Coulon (f5ibh) wrote:
> > Le 08.10.2006 18:05:23, dtutty@porchlight.ca a ?crit?:
> > >Obviously, I don't know how LV works internally.  If the root
> > >filesystem
> > >get corrupted, how do I fix it from a recovery shell (e.g. the install
> > >USB) if its on an LV?  If this is trivial, then is the thing to do to
> > >make all of the disk a PV then have LVs for everything?
> >
> > It is probably a confidence problem.
> > A corrupted root file system is not better than a corrupted root over
> > LVM.
>
> I'm confident that I don't know enough about LVM yet to rescue a mangled
> system.  In the past, if something got corrupted (lightening strike,
> powerfailure, disk failure, etc), I could pop in my grub disk, and
> either boot my regular kernel or the one on the copy of /boot on a
> diferent drive, tell it root=/dev/hda5 init=/bin/sh and start fixing it.

	First off, you're partially right, here. GRUB, so far as I know, does not yet 
support LVM, but that is not an insurmountable problem. As long as your boot 
partition and the included kernel boot files are on a regular partition you 
still will be able to boot an LVM root partition. All that's necessary is 
that LVM be included in the kernel (and the initrd).

> If that didn't work, I'd boot a rescue system (e.g. the install floppy
> or CD) and manually fsck the partitions.
>

	Ditto above, plus, my experience is that both the new Debian installer as 
well as late model Knoppix live CD's include support for LVM. So, just boot 
from one of those. Mount the appropriate LVM volumes and go to work.

> I suppose this is the key to my understanding and will make all clear:
> Where do I tell the grub disk (USB stick?) to find the kernel and what
> root= line do I give the kernel?  With / and /boot part of LVM, how does
> grub find the kernel to boot?  The grub-howto and docs don't mention LVM
> at all.

	Your boot partition must be on a regular file system. The root can be an LVM 
volume, so long as your kernel/initrd supports LVM.

> With regular partitions, if the partition table gets corrupted, its
> simple to fix if I have what it looked like before using sfdisk -d (I
> never ran into this problem after the table corruption that prompted me
> to keep this information on a floppy with other essential backups).
>
> What is the LVM equivalent of this?

	Either the entire hard disk (no partitions) or individual partitions can be 
LVM physical volumes, so there's really no difference here. If your partition 
table becomes corrupted you still would have to fix it with sfdisk or dd.

> The whole HOWTO package is getting woefully out of date.  LVM-HOWTO
> doesn't cover recovering from errors, MULTI-DISK-HOWTO doen't cover LVM,
> and the various recovery howtos focus on bare-metal recovery not fixing
> a broken system.
>
> Or, it it the case now that LVM is so reliable that any errors will be
> hardware and unrecoverable anyway, requiring a bare-metal recovery.

	As ever, the likelyhood of file corruption is directly proportional to the 
length of time since your last backup!

> Thanks,
>
> Doug.

HTH!

Cheers,

cmr
-- 
Debian 'Etch': Registered Linux User #241964
----
"More laws, less justice." -- Marcus Tullius Ciceroca, 42 BC
--------



Reply to: