LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Resizing initially installed logical volume? (https://www.linuxquestions.org/questions/linux-newbie-8/resizing-initially-installed-logical-volume-840618/)

arashi256 10-26-2010 05:17 PM

Resizing initially installed logical volume?
 
Hi,

Back in the day, I foolishly installed my Fedora server with the default logical volume layout on one physical volume. Knowing now that this is a huge waste of space (partition is large) I'd like to reduce the logical volume and somehow detach this now unused space and mount as a normal partition. Is this possible? Only 20GB of the 160GB has been used for the OS. Home partition is on a secondary disk.

Tinkster 10-26-2010 05:57 PM

Use resize2fs & lvreduce.

Make sure you read the man-pages of both tools carefully, and
that you have a current backup ;}


Cheers,
Tink

syg00 10-26-2010 06:50 PM

Then of course you'll have to reduce the pv. This was discussed here recently, a quick search should find it.

arashi256 10-27-2010 08:28 AM

Thanks :)

meandsushil 10-27-2010 09:21 AM

use this method for reducing logical volume

1.First unmount that partition by "umount /dev/vol0/root" whatever it is, check in "/etc/fstab"
2.then run "fsck -f /dev/vol0/root"
3.resize2fs /dev/vol0/root 5G" if wan to reduce to 5GB
4.run lvreduce -L 5G /dev/vol0/root"
5.mount -a

That's it. This is the normal operation. I do in this way, use this method!

arashi256 10-27-2010 09:23 AM

Quote:

Originally Posted by meandsushil (Post 4140982)
use this method for reducing logical volume

1.First unmount that partition by "umount /dev/vol0/root" whatever it is, check in "/etc/fstab"
2.then run "fsck -f /dev/vol0/root"
3.resize2fs /dev/vol0/root 5G" if wan to reduce to 5GB
4.run lvreduce -L 5G /dev/vol0/root"
5.mount -a

That's it. This is the normal operation. I do in this way, use this method!

Perfect - will I have to use a rescue CD, Knoppix or similar if the OS is on that partition?

TB0ne 10-28-2010 09:02 AM

Quote:

Originally Posted by arashi256 (Post 4140984)
Perfect - will I have to use a rescue CD, Knoppix or similar if the OS is on that partition?

Take great care in following that advice....I suggest reading some earlier posts by the user, to give you background.

Honestly, the best (and safest) way to do this, would be to back your data up, and do a fresh install. If you're not already at Fedora 13, it's a perfect opportunity to not only resize/repartition your disks, but upgrade your OS as well.

But before you do ANYTHING, make very, VERY sure you have good backups!!! Anytime you mess with volume sizes, partitons, etc., there's always a chance things can go bad.

arashi256 10-28-2010 09:48 AM

Cool, thanks. I'm not *too* worried about hosing the drive....I have two nightly backups to different drives via a bash script/cronjob :D

TB0ne 10-28-2010 10:43 AM

Quote:

Originally Posted by arashi256 (Post 4142290)
Cool, thanks. I'm not *too* worried about hosing the drive....I have two nightly backups to different drives via a bash script/cronjob :D

Very wise, and well done.

What version of Fedora are you running?

arashi256 10-28-2010 12:48 PM

Quote:

Originally Posted by TB0ne (Post 4142340)
Very wise, and well done.

What version of Fedora are you running?

I backup everything since I hosed my first DOS computer by uninstalling SuperStor (disk compression) when I was a kid :D Only needed to happen once! I'm running the latest Fedora - Fedora 13 "Goddard".


All times are GMT -5. The time now is 11:02 AM.