Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (Not For Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (Not For Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10th May 2007, 02:52 PM
markkuk Offline
Registered User
 
Join Date: Apr 2005
Location: Finland
Posts: 5,072
How to shrink your LVM root volume using rescue mode

The initial situation: Fedora Core 6 basic desktop installation with default partitioning
  • A /boot partition of about 100 MiB
  • The rest of disk space set up as a LVM physical volume containing
    • 2xRAM size of swap space
    • the rest filled by the / logical volume
(click for a full-size image)

The goal: shrink / to allow creation of separate logical volumes for e.g. /home, /tmp or other uses.

Step 1: Starting the rescue mode Because mounted ext3 filesystems can't be reduced, we must boot the machine in rescue mode. You can use either the first install CD, the install DVD or the separate rescue CD, and boot with the "linux rescue" command.

First the rescue environment asks you to pick your language and keyboard layout. Choose the ones matching your Fedora system. You can skip the networking setup, it's not needed in this process.

Let the rescue system mount your Fedora installation, this ensures that the LVM system is correctly initialized, all necessary modules are loaded and the /dev entries for LVM volumes are created.


If everything is OK, you will see this screen, and pressing Enter will start the rescue mode Bash shell.


Step 2: Preparations Start with checking the disk information, the command "mount" shows you the name of the / logical volume, now mounted as /mnt/sysimage. "df -h" shows the disk usage. Write down the device name of the volume you are going to resize and the amount of used space on that volume, in the example it's /dev/VolGroup00/LogVol00 with 2.0 GiB in use.


Unmount everything under /mnt/sysimage and finally /mnt/sysimage itself. Use the "-l" option for umount if you get complaints about busy devices.


Step 3: Shrinking the filesystem Before you can resize the filesystem you must run "e2fsck -f" on it. Resize2fs will complain and refuse to work if you forget to run e2fsck.
There are two things you must remember when choosing the new size of your filesystem:
  • LVM allocates space in 32MiB chunks by default, the new size must be a multiple of the LVM extent size.
  • The filesystem mustn't be too full after resizing or you may have problems when restarting the system. Try to leave at least 20% free space on the volume.
The resize2fs program will take a while to run. You can add "-p" option to its command line to see a progress bar.


Step 4: Shrinking the logical volume The rescue disc has only the "lvm" command shell instead of separate commands for each LVM operation. While in the lvm shell, you can use the "help" command to display information such as a list of commands and options available for each command. Shrink the volume to the same size you specified in the previous step for the filesystem. Use "exit" or "quit" to leave the lvm shell.


Step 5: Reboot The command "exit" will leave the rescue mode and reboot the machine. Remove the rescue disc from the drive and the system should boot normally to the GUI mode.


Checking the result Compare the graphical LVM status to the initial version and you see the unused space available for creating new logical volumes.
(click for a full-size image)
Reply With Quote
 

Tags
lvm , mode , rescue , root , shrink , volume

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
LiveCD Volume to Shrink Error khskinsfan Installation, Upgrades and Live Media 0 20th June 2009 07:22 PM
Rescue mode-how to get root SRT Using Fedora 5 6th August 2006 07:23 PM
FC4: Installation warning (lvm) and fix: default partitioning shrink logical volume urilabob EOL (End Of Life) Versions 9 30th April 2006 01:21 PM
Is it possible to shrink a Logical Volume? ajwynn Using Fedora 2 7th May 2005 03:11 AM
Shrink volume group? veritas Using Fedora 2 12th April 2005 01:55 PM


Current GMT-time: 01:16 (Saturday, 21-10-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat