LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 10-03-2015, 05:42 AM   #1
mshlinux
Member
 
Registered: Mar 2013
Location: Yangon, Myanmar.
Distribution: Fedora, Arch
Posts: 177

Rep: Reputation: Disabled
reducing LVM ?


in Fedora 22, I am trying to make room for other distro reducing my fedora LVM partition.
Code:
[msh@localhost ~]$ sudo lvscan
[sudo] password for msh: 
  ACTIVE            '/dev/fedora/swap' [7.75 GiB] inherit
  ACTIVE            '/dev/fedora/home' [407.32 GiB] inherit
  ACTIVE            '/dev/fedora/root' [50.00 GiB] inherit
[msh@localhost ~]$ lsblk
NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda               8:0    0 465.8G  0 disk 
├─sda1            8:1    0   200M  0 part /boot/efi
├─sda2            8:2    0   500M  0 part /boot
└─sda3            8:3    0 465.1G  0 part 
  ├─fedora-swap 253:0    0   7.8G  0 lvm  [SWAP]
  ├─fedora-root 253:1    0    50G  0 lvm  /
  └─fedora-home 253:2    0 407.3G  0 lvm  /home
sr0              11:0    1  1024M  0 rom
I want to make 50G standard partition (not LVM) at the end of my hard drive.
Eg:
Code:
|_sda4       8:4    0     50G
yes, I have read wiki pages a lot online.
but I just want any suggestion straight to my need beforehand.
 
Old 10-04-2015, 10:51 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
While LVM makes it simple to add space, shrinking existing space becomes harder. You'll need to do all this while booted from a live CD because you cannot shrink a filesystem while it is mounted. I suggest the gparted 0.23.0 live CD.

While running from that CD, start a terminal with root permissions and shrink your /home filesystem and LV:
Code:
lvresize --size=350G --resizefs /dev/fedora/home
Now, refresh the devices in gparted (Ctrl+R), and it should show that sda3 is no longer completely used. Click on "Resize/Move" and adjust that partition to the minimum allowed size. You should now have 50GB of unallocated space for a new partition. This assumes that fedora-home is physically located at the end of the PV. If not, resizing the partition is going to be harder.

Resizing filesystems is always a risky operation. I strongly recommend that you have a full backup before doing this.

Last edited by rknichols; 10-04-2015 at 10:55 AM.
 
Old 10-06-2015, 01:09 AM   #3
mshlinux
Member
 
Registered: Mar 2013
Location: Yangon, Myanmar.
Distribution: Fedora, Arch
Posts: 177

Original Poster
Rep: Reputation: Disabled
thanks for ur suggestion...
yeah! right...
Quote:
While LVM makes it simple to add space, shrinking existing space becomes harder.
that is what I also notice.

Quote:
This assumes that fedora-home is physically located at the end of the PV. If not, resizing the partition is going to be harder.
My /dev/fedora/home is at the middle of physical volumn, unfortunately. So, I have to use "pvmove".

I did
Code:
# lvresize -L -50G --resizefs /dev/fedora/home
# pvmove --alloc anywhere /dev/sda3:xxxxxx-xxxxxx /dev/sda3:xxxxxx-xxxxxx
# pvresize --setphysicalvolumnsize 350G /dev/sda3
well done.
 
  


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
Reducing LVM partition size geekslinux Linux - Server 9 01-29-2014 10:49 PM
reducing ext3 lvm's. majeztik Red Hat 7 01-04-2010 08:52 AM
Reducing size in LVM SBN Linux - General 8 07-28-2009 06:30 AM
Reducing the Linux LVM(8e) partition itself (not PV, VG or LV). ajitkth Linux - General 1 03-08-2005 03:45 AM
Reducing size of PV (partition) in LVM clacour Linux - General 2 10-24-2003 08:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 11:25 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