A Beginner's Guide To LVM - Page 4
4 Resize Logical Volumes And Their FilesystemsIn this chapter we will learn how to resize our logical volume share which has an ext3 filesystem. (I will show how to resize logical volumes with xfs and reiserfs filesystems further down this tutorial.) First we must unmount it: umount /var/share share should not be listed anymore in the df -h output: server1:~# df -h Now let's enlarge share from 40GB to 50GB: lvextend -L50G /dev/fileserver/share server1:~# lvextend -L50G /dev/fileserver/share Until now we have enlarged only share, but not the ext3 filesystem on share. This is what we do now: e2fsck -f /dev/fileserver/share server1:~# e2fsck -f /dev/fileserver/share Make a note of the total amount of blocks (10485760) because we need it when we shrink share later on. resize2fs /dev/fileserver/share server1:~# resize2fs /dev/fileserver/share Let's mount share: mount /dev/fileserver/share /var/share and in the df -h output share should now have 50GB instead of 40: server1:~# df -h Shrinking a logical volume is the other way round: first we must shrink the filesystem before we reduce the logical volume's size. Let's shrink share to 40GB again: umount /var/share df -h server1:~# df -h e2fsck -f /dev/fileserver/share server1:~# e2fsck -f /dev/fileserver/share When resizing an ext3 filesystem to a certain size (instead of all available space), resize2fs takes the number of blocks as argument (you can as well specify the new size in MB, etc. See man resize2fs for more details). From our previous operation we know the 40GB equals 10485760 blocks so we run resize2fs /dev/fileserver/share 10485760 server1:~# resize2fs /dev/fileserver/share 10485760 We've shrinked the filesystem, now we must shrink the logical volume, too: lvreduce -L40G /dev/fileserver/share server1:~# lvreduce -L40G /dev/fileserver/share We can ignore the warning that data might be destroyed because we have shrinked the filesystem before. Let's mount share again: mount /dev/fileserver/share /var/share The output of df -h should now look like this: server1:~# df -h
|
www.seamlessenterprise.com
One number. One voicemail. Seize the lead. Sprint Mobile Integration.
www.seamlessenterprise.com
One Number. One Voicemail.
Make it easier for clients to reach you. Turn your desk phone and mobile phone into one with Sprint Mobile Integration.
www.seamlessenterprise.com
One number. One voicemail. Sprint Mobile Integration.
www.seamlessenterprise.com
AT&T Synaptic Compute as a Service. Boost your power on demand.
Trial: IBM Cognos Express Reporting, Analysis & Planning




print: 

Recent comments
13 hours 11 min ago
15 hours 12 min ago
18 hours 24 min ago
20 hours 43 min ago
21 hours 53 min ago
23 hours 11 min ago
1 day 3 hours ago
1 day 6 hours ago
1 day 7 hours ago
1 day 21 hours ago