Resizing a logical volume

I backup my photos from an iMac to a Ubuntu linux box with a simple rsync command.

rsync --exclude=".*" -ave ssh /my/masters userId@x.x.x.y:/media/pictures

This will copy everything new from /my/masters to the backup machine at /media/pictures without copying any “dot” files. This also does not delete anything from the new machine.

Anyway, I was doing the rsync, but ran out of space on the backup box. A ctrl-z, and now I need to make more space. I am running ext3, so it should be just a few commands. First I unmounted (umount) the filesystems just to be sure. Then :

lvextend -L +40G /dev/vg/pictures

This will grow the logical volume by 40 gig. Next we need to resize the filesystem to fill up the space.

resize2fs /dev/vg/pictures

I have done this before, but this time I got a message to run e2fsck first.

e2fsck -f /dev/vg/pictures

This finished without issue, and I then ran the resize2fs command and it finished after a couple of minutes. Remount the filesystem, a “df” and it confirms that there is more space available.

I removed the last file copied to make sure it wasn’t wrecked somehow, and then kicked off the rsync again. It just picked up where it left off.