[Triumf-linux-managers] Re: Difference B/N LVM and Extended
partitioning.
Kel Raywood
kray at triumf.ca
Wed Oct 25 16:11:28 PDT 2006
Hi Mina,
There are several advantages to using LVM, even on a single-user
single-disk machine.
(1) You can resize LVs and add new ones on the fly.
For example, even on a single-user machine such as a laptop I prefer to
have separate paritions for /, /usr, /var, /tmp and /home. Using LVM, you
don't have to decide in advance how much space to allocate to each LV.
Just put some useful minimum and leave the rest free (unallocated). If
you decide to add extra software and need more space in /usr, then use
"lvextend" to extend the LV and grow the file system with "resize2fs" for
ext3 or "xfs_growfs" for xfs.
(2) You can take a live "snapshot" of a LV which is useful for obtaining
a consistent point-in-time backup.
(3) You can install a new version of the O/S without blowing away a
previous one.
Example: Say you want FC6 and SL4 on your laptop.
* Parition the disk as: /boot + <swap> + <PhysicalVolume>
* Assign <PhysicalVolume> to volume-group VG0.
* Create LVs fc6, usr0, var0, tmp0, home
* Install FC6 with / => /dev/VG0/fc6, /usr => /dev/VG0/usr0, ...
* Boot FC6
* While running FC6
* Make a copy of /boot in some other partition
* Create new LVs for SL4: sl4, usr1, var1, tmp1
* Now install SL4 but do not repartition. Instead just use new
pre-assigned LVs and keep the same home.
* Boot SL4
* Merge the contents of the FC6 /boot with SL4 /boot that was overwritten
during installation of SL4. This will require editing
/boot/grub/grub.conf by hand but it's not hard.
Now you have a dual-boot and could later reclaim the space by blowing
away the LVs of an entire OS.
I use this scheme on all the PET servers and workstations so that I can
install a new OS while keeping the previous one available.
Hope this helps,
Kel
More information about the Triumf-linux-managers
mailing list