I have a 1T USB disk with Fedora 20 installed. It shows as sdd in the first image below. I only used about 50GB. There are 3 logic volumes under the sdd2 and also there are about 620GB of free space after I shrunk its home logical partition, as shown in the second image.

I am thinking create a physical volume/partition, sdd3, by using that 620GB free space. I hope other logical volumes will not be damaged and data will stay unchanged. how can I do that?

I have created a disk image with clonezilla. So I am not worry about data loss during the process.

The purpose of doing this is I want to move the installation on my 1T disk with settings over to my another 500GB USB disk. I have tried many ways, clonezilla, dd logical partition(s), true image, gparted, .... no one can help me or gives me a good result due to the lvm and smaller destination. I hope I can dd physical partition after the new physical partition takes over some space.

sdd is the 1T USB disk

green color is the free space


My have to restart my ubuntu live CD session. now the target disk is sdb . I got error when I try to resize the sdb2:

ubuntu@ubuntu:~$ sudo su
root@ubuntu:/home/ubuntu# pvdisplay /dev/sdb2
  --- Physical volume ---
  PV Name               /dev/sdb2
  VG Name               fedora_lym
  PV Size               930.99 GiB / not usable 4.00 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              238333
  Free PE               160569
  Allocated PE          77764
  PV UUID               Ytsy31-op7u-DqLM-lJG7-uIFb-2hAG-eZhn0a

root@ubuntu:/home/ubuntu# pvresize --setphysicalvolumesize 320G /dev/sdb2
  /dev/sdb2: cannot resize to 81919 extents as later ones are allocated.
  0 physical volume(s) resized / 1 physical volume(s) not resized


Done, sdb3 is here now:

root@ubuntu:/home/ubuntu# lsblk
sda                     8:0    0 223.6G  0 disk 
├─sda1                  8:1    0   100M  0 part 
└─sda2                  8:2    0 223.5G  0 part 
sdb                     8:16   0 931.5G  0 disk 
├─sdb1                  8:17   0   500M  0 part 
├─sdb2                  8:18   0 312.5G  0 part 
│ ├─fedora_lym-swap 252:0    0   3.8G  0 lvm  
│ ├─fedora_lym-home 252:1    0   250G  0 lvm  
│ └─fedora_lym-root 252:2    0    50G  0 lvm  
└─sdb3                  8:19   0 618.5G  0 part 
sr0                    11:0    1   4.4G  0 rom  /cdrom
loop0                   7:0    0   1.1G  1 loop /rofs

2 Answers 2


If I understand you correctly, you want to use the free space on sdd2 for creating another Partition sdd3. To do that, you first need to resize the physical volume (if you haven't done that already) using pvresize.

First have a look at how big your physical volume is using pvdisplay /dev/sdd2. If it already has the correct size, skip to the next step. Otherwise you need to resize it first:

pvresize --setphysicalvolumesize 123G /dev/sdd2

Instead of 123G use the appropriate new size. Be careful with this.

When pvresize fails with an error that certain extents are allocated, then there can be two reasons for it: 1) you tried to make the pv size too small 2) certain extents are allocated towards the end of the disk instead of the beginning.

In the latter case you need to move those extents to the beginning first. For a list of contiguous segment allocations run

pvs -v --segments

When you have free space on your PV, not everything will be allocated from first to last segment. Move the fragments that block your pvresize to the beginning with

pvmove --alloc anywhere SOURCE_SEGMENTS

(SOURCE_SEGMENTS being the segments you want to move)

For a more detailed explanation have a look at the answers here: https://unix.stackexchange.com/a/67707/154982

The next step is to reduce the partition size. Write down the new total size of your physical volume. Then use fdisk (or your graphical tool or whatever partitioning program you prefer), write down the starting block of the partition sdd2, delete it and create a new one with the size of your physical volume. It is important that this new partition starts at the exact same block that your old sdd2 partition started at! For the partition size, keep in mind, that you may have to convert block/sector numbers into bytes. fdisk will tell you how many bytes are allocated for one sector (usually 512). Also keep in mind, that magnitudes are of base 1024, not 1000 (i.e. KiB instead of kB).

After creating the new smaller sdd2 you have new unallocated space on your disk which you can use to create another partition sdd3.

However, if you just want to use the free 600MB at the end of sdd2 for your LVM, you may just want to enlarge your pv using

pvresize /dev/sdd2

Afterwards increase the size of your lv and file system (using lvresize -r) and you're done. You can, of course also create a new lv on the free pv space.

  • I need to do the first step. Do you have graphical tool recommendation for the second step to reduce the partition instead of using fdisk? Commented Feb 13, 2016 at 17:06
  • I don't use GUI tools for partitioning, but kvpm (from which you posted the screenshots above) should be able to do it. Another common tool is gparted. But before shrinking partitions, make sure that your pv has the correct size. Commented Feb 13, 2016 at 17:10
  • i got error when I try the first step to resize the sdb2, which is the previous sdd2. please see my update above. Commented Feb 13, 2016 at 18:38
  • I updated my answer to include your pvresize problem. Commented Feb 13, 2016 at 19:33
  • BTW you are wasting a bit of space when resizing to 320GiB. You have 77764PE allocated. With a PE size of 4MiB, this is ~304GiB. You should either resize the pv to that size or enlarge your lv afterwards to fill the remaining space on the pv. Commented Feb 13, 2016 at 19:43

So I wanted to use pvresize and fdisk but was too cowardly to calculate the starting blocks myself (I didn't want to make assumptions about the meaning of size and extents).

The entire operation can be done by resizing the volume within gparted (right-click resize volume), with the exception that you might have to manually move some extents.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .