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

Re: LVM Talk Request

On Mon, Nov 22, 2004 at 10:22:31AM -0600, Herbie wrote:
> Steven,
>          If you have nothing planned for tomorrow night, I'd love to hear
> some about LVM under linux. We were talking some about disk partitoning
> schemes in general at the newbie night, and I realised I haven't ever
> dabbled in LVM under linux.

I just had some interesting results come up with lvm and thought I would 
share.  I have set up all my servers and workstation with LVM for the last
two years now (since steve explained the value to be had).  Well for the first
time ever I needed to extract some data off an older hard drive using an 
external enclosure.  I generally set up all of my systems the same way:

first partition = /boot  <- ext3 and bootable
second partition = LVM PV  (usually takes up the rest of the disk)

lvm setup 
1 VG named v00
the LV's are named after their mount points (root, var, swap . . .)

So I hook this external USB enclosure up to the laptop and do a vgscan but of
course I already have a volume group v00 mounted on / so the system doesn't
bother to see the other v00 on the eternal drive, finally I get the bright
idea to do a vgrename thinking "this should only affect inactive volumes . .
right", this is not the case, I did a vgrename v00 to oldv00 and everything
seemed ok, did a vgscan and it found oldv00, did a "vgchange -a y oldv00" and
boom i was able to mount the partitions, then i went to check what all 
lv's were on this drive, did an ls /dev/oldv00/ and got:

home lv00 lv01 lv02 lv03 lv04 root swap var

hmmmm wow thats odd, this drive must have been before i began descriptively
naming my lv's (thus the lv01 etc.), so this sinking feeling is setting in
that i've just done something really bad, to make sure I mount /dev/oldv00/home
to /mnt/home and do an ls, uh-oh i have exactly what is on my /home/ directory
on the local system, I can only imagine what kind of havok or problems that
could have been caused by having to lv's named root, at this point i tryed
to deactivate the other volume with no avail (due to the one with the 
same name being mounted), then I made another big mistake, I thought
the dynamic hotplugging in linux may be smart enought to send the right
signals and disable the correct volume if i just unplug the drive, so i 
unplug the drive and do a "vgrename oldv00 v00", it errors on trying to 
rename the external drive but appears to have renamed the internal volume,
thinking i've probably fubared things enough to be affecting anything else
I am trying to do I restart, then on reboot the system informs me it can't
mount root (how nice) and boots me to a "rescue console" with the root 
filesystem mounted as read only *read rant below if interested*, so after 
some help i remounted root as writable and went to see what was wrong, very
simply the utilities because they couldn't finish the rename process 
completely didn't bother to set up the symbolic links for /dev/v00 and 
everything was still symlinked in /dev/oldv00, so i ran a vgscan again
and it still didn't set up the symlinks, finally i manually set up the
directory and symlinks to /dev/mapper/v00-{home,root,var} and removed all
of the /dev/oldvol00 directory, after a reboot all was well again and 
everything worked, i then plugged in the external and activated the volumes
with ease (they activated as oldvol00)

what i believe the moral of this experience is that descriptive naming
of the volume groups and logical volumes is extremely useful, I hope this
has been useful info for some out there that have fallen into the lazy naming
in LVM


*rant* why are you given a "rescue console" with a read only mounted 
filesystem, lets see your given this console because something is 
obviously broke somewhere important, there is a real good chance that
something is on the root filesystem, last time i checked when something
is broke on linux you have to fix it before it works again (this being 
completely unlike winblows that if your reboot enough it might fix itself,
this behaviour has always really bothered me) this is a right tad difficult
if you can't write any fscking changes to the disk, the solution was 
actually rather simple but i had to call steve pritchard for some help
because with my system in this state i couldn't look up the man page or get
to the internet to remind myself how to remount a mounted ro 
filesystem to rw (actually i wasn't sure it was possible having never 
needed to do that before), so again i ask why not just give me a rw 
filesystem so i don't have to jump through hoops to fix the thing

To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.