On 10. des. 2013 20:43, Jeff Siddall wrote: > On 12/09/2013 11:20 PM, ToddAndMargo wrote: >>> then you absolutely want to be running >>> them against a snapshot rather than a live FS and LVM makes this easy. >> >> Never really cared for LVM. Always used the direct partition approach. > > Well, perhaps I can try to convince you some more. > > Take another example of upgrading to a bigger disk. Huge PITA if you > use direct partitions. Shut the system down and use a live OS or > something while you move over all the data -- which could take hours or > days depending on what you need to move. If you are really obsessive > you probably want to make sure nothing got lost in the move so there is > a whole compare exercise after it finishes. > > If you have LVM you simply install your new drive (assuming you can > hotswap you don't even have to shutdown for that) run pvcreate, vgextend > and then pvmove. Some hours (or days) later it finishes and your data > is magically on the new disk without even a moment of downtime. > > A lvextend and a resize2fs (or whatever utility resizes the FS you use) > and you can start using the extra space, still with no downtime. > > That is pure sysadmin gold! > > BTW: I also use LVM on my offsite backup disks. I just use the same > volume group/volume name on all the disks. Works with LUKS also.
I'll even recomend fsadm, which makes resizing live filesystems even easier and safer. I've even done resize of / on a running system without any issues. The fsadm utility will do much of the filesystem tasks for you, in a safe an controlled manner. # fsadm -v -l resize /dev/vg.../lv... $NEWSIZE If you're more cautious, you can add -n (--dry-run) and even do a 'fsadm check' first. This takes care of resizing all the needed pieces. But 'fsadm check' can only be done on an unmounted volume, iirc. I have not tried fsadm on a direct partition, though. It might also work there. These LVM features can also be very useful if you're using virtual machines with LVM, as adding and removing virtual drives on-the-fly is very easy in such environments. kind regards, David Sommerseth
