Quick Gentoo LVM howto
I hope to expand this eventually but for now just how to mount an LVM partition already created by Gentoo or another Linux distro.
# mount /dev/sda5 /mnt/gentoo mount: unknown filesystem type 'LVM2_member'
That does not work so...
# pvs livecd ~ # pvs PV VG Fmt Attr PSize PFree /dev/sda5 bcid lvm2 a-- 465.52g 0
This shows you the detected LVM partitions on your machine, now
we will have a look inide them. Dont worry if you don't have a
/dev/bcid
directory, this utility does not actually
look at that anyway.
# lvdisplay /dev/bcid --- Logical volume --- LV Path /dev/bcid/root LV Name root VG Name bcid LV UUID jTF0xU-vLIj-lTsh-9qdW-fMEh-AI1o-oL0UjF LV Write Access read/write LV Creation host, time , LV Status available # open 0 LV Size 461.68 GiB Current LE 118190 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 --- Logical volume --- LV Path /dev/bcid/swap_1 LV Name swap_1 VG Name bcid LV UUID i7dAhY-bZw2-hcKe-dXcL-Yzgk-O8Xn-Z8Tdx5 LV Write Access read/write LV Creation host, time , LV Status available # open 0 LV Size 3.84 GiB Current LE 983 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1
Now you can see the partitions embedded inside this LVM2 partition.
Next we need to see if it is active
, with the Gentoo
minimal CD it probably won't be.
# vgchange /dev/bcid -a y 2 logical volume(s) in volume group "bcid" now active
You will now find that your /dev
directory has some new
files! In this case we have created /dev/bcid
,
/dev/bcid/root
and /dev/bcid/swap_1
.
I am not sure how to "deactivate" them and this was a repair on a client machine so I did not have the time to go experimenting but this should be enough for you to be getting on with. One last thing:
# lvscan ACTIVE '/dev/bcid/root' [461.68 GiB] inherit ACTIVE '/dev/bcid/swap_1' [3.84 GiB] inherit
Good luck with your LVMin'