IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

HOWTOs

Search Howtos :Match :

11.9. Extending a logical volume

To extend a logical volume you simply tell the lvextend command how much you want to increase the size. You can specify how much to grow the volume, or how large you want it to grow to:

# lvextend -L12G /dev/myvg/homevol
lvextend -- extending logical volume "/dev/myvg/homevol" to 12 GB
lvextend -- doing automatic backup of volume group "myvg"
lvextend -- logical volume "/dev/myvg/homevol" successfully extended
        
will extend /dev/myvg/homevol to 12 Gigabytes.


# lvextend -L+1G /dev/myvg/homevol
lvextend -- extending logical volume "/dev/myvg/homevol" to 13 GB
lvextend -- doing automatic backup of volume group "myvg"
lvextend -- logical volume "/dev/myvg/homevol" successfully extended
        
will add another gigabyte to /dev/myvg/homevol.

After you have extended the logical volume it is necessary to increase the file system size to match. how you do this depends on the file system you are using.

By default, most file system resizing tools will increase the size of the file system to be the size of the underlying logical volume so you don't need to worry about specifying the same size for each of the two commands.

  1. ext2/ext3

    Unless you have patched your kernel with the ext2online patch it is necessary to unmount the file system before resizing it. (It seems that the online resizing patch is rather dangerous, so use at your own risk)
    
   # umount /dev/myvg/homevol/dev/myvg/homevol
       # resize2fs /dev/myvg/homevol
       # mount /dev/myvg/homevol /home
                

    If you don't have e2fsprogs 1.19 or later, you can download the ext2resize command from ext2resize.sourceforge.net and use that:
    
   # umount /dev/myvg/homevol/dev/myvg/homevol
       # ext2resize /dev/myvg/homevol
       # mount /dev/myvg/homevol /home
                

    For ext2 there is an easier way. LVM 1 ships with a utility called e2fsadm which does the lvextend and resize2fs for you (it can also do file system shrinking, see the next section).

    WarningLVM 2 Caveat
     

    There is currently no e2fsadm equivalent for LVM 2 and the e2fsadm that ships with LVM 1 does not work with LVM 2.

    so the single command
    
   # e2fsadm -L+1G /dev/myvg/homevol
                
    is equivalent to the two commands:
    
   # lvextend -L+1G /dev/myvg/homevol
       # resize2fs /dev/myvg/homevol
                

    NoteNote
     

    You will still need to unmount the file system before running e2fsadm.

  2. reiserfs

    Reiserfs file systems can be resized when mounted or unmounted as you prefer:

    • Online:
      
   # resize_reiserfs -f /dev/myvg/homevol
                        

    • Offline:
      
   # umount /dev/myvg/homevol
         # resize_reiserfs /dev/myvg/homevol
         # mount -treiserfs /dev/myvg/homevol /home
                        

  3. xfs

    XFS file systems must be mounted to be resized and the mount-point is specified rather than the device name.
    
   # xfs_growfs /home
                

  4. jfs

    Just like XFS the JFS file system must be mounted to be resized and the mount-point is specified rather than the device name. You need at least Version 1.0.21 of the jfs-utils to do this.
    
# mount -o remount,resize /home
                

    WarningKnown Kernel Bug
     

    Some kernel versions have problems with this syntax (2.6.0 is known to have this problem). In this case you have to explicitly specify the new size of the filesystem in blocks. This is extremely error prone as you must know the blocksize of your filesystem and calculate the new size based on those units.

    Example: If you were to resize a JFS file system to 4 gigabytes that has 4k blocks, you would write:
    
# mount -o remount,resize=1048576 /home
                  

Search Howtos :Match :
PhpMyAdmin 3.1.2 rc1
Php front-end to MySQL administration
Xine 1.1.6
Free video player
Glade 3.5.5
User interface builder for GTK+ and Gnome
Evolution 2.25.4
GNOME mailer, calendar, contact manager and communications tool
GEdit 2.25.4
Small but powerful text editor
Mutt 1.5.19
Small but very powerful text-based mail client.
Galculator 1.3.2
GTK 2 based scientific calculator
GTK2 2.14.7
GUI Toolkit
WebGUI 7.5.38
A fully featured content management system.
Brasero 0.9.0
Application to burn CD/DVD
Free IT Magazines, White Papers, eBooks, and more !
Dr. Dobb's Journal

Dr. Dobb's Journal enables programmers to write the most efficient and sophisticated programs and help in daily programming quandaries.

The 7 Things that IT Security Professionals MUST KNOW!

Gain key insight into security problem and find the safest means to protect your technological assets.

Database Trends and Applications

Provides timely coverage of the technology, intelligence and insight needed to plan, implement and manage information-rich projects.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info