LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-26-2010, 05:17 PM   #1
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 18.04 / CentOS 7.6
Posts: 397

Rep: Reputation: 62
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.
 
Old 10-26-2010, 05:57 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Use resize2fs & lvreduce.

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


Cheers,
Tink
 
Old 10-26-2010, 06:50 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Then of course you'll have to reduce the pv. This was discussed here recently, a quick search should find it.
 
Old 10-27-2010, 08:28 AM   #4
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 18.04 / CentOS 7.6
Posts: 397

Original Poster
Rep: Reputation: 62
Thanks
 
Old 10-27-2010, 09:21 AM   #5
meandsushil
Member
 
Registered: Feb 2010
Posts: 143

Rep: Reputation: 14
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!
 
1 members found this post helpful.
Old 10-27-2010, 09:23 AM   #6
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 18.04 / CentOS 7.6
Posts: 397

Original Poster
Rep: Reputation: 62
Quote:
Originally Posted by meandsushil View Post
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?
 
Old 10-28-2010, 09:02 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by arashi256 View Post
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.
 
Old 10-28-2010, 09:48 AM   #8
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 18.04 / CentOS 7.6
Posts: 397

Original Poster
Rep: Reputation: 62
Cool, thanks. I'm not *too* worried about hosing the drive....I have two nightly backups to different drives via a bash script/cronjob
 
Old 10-28-2010, 10:43 AM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by arashi256 View Post
Cool, thanks. I'm not *too* worried about hosing the drive....I have two nightly backups to different drives via a bash script/cronjob
Very wise, and well done.

What version of Fedora are you running?
 
Old 10-28-2010, 12:48 PM   #10
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 18.04 / CentOS 7.6
Posts: 397

Original Poster
Rep: Reputation: 62
Quote:
Originally Posted by TB0ne View Post
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 Only needed to happen once! I'm running the latest Fedora - Fedora 13 "Goddard".
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Different sizes in data after resizing Logical Volume fabbie Linux - General 5 07-09-2010 04:35 AM
LVM free space problem after resizing the logical volume wdorninger Linux - Enterprise 0 11-06-2009 07:00 AM
Resizing Logical Volume Partition BobNutfield Fedora 4 02-03-2008 05:56 PM
superblock error after resizing logical volume austin_it Linux - General 3 11-29-2007 03:56 AM
resizing a logical volume nicentral AIX 2 06-11-2005 04:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration