LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   GParted won't reduce partition size (https://www.linuxquestions.org/questions/linux-newbie-8/gparted-wont-reduce-partition-size-4175573104/)

Delusion of Adequacy 02-24-2016 07:42 AM

GParted won't reduce partition size
 
The Issue

As I screwed my linux install (the home folder is encrypted and through a series of unfortunate events, I know cannot decrypt it) I want to make another partition on the HDD and install linux mint to that partition, so I don't have to work from a live USB anymore. However, GParted won't resize the partition.

I Tried

I started GParted from the start menu, selected the prober hdd, and hit 'move/resize'. However, it says the minimum size is ~900 GB (almost the entire hard drive) even though there's only around 100GB used (which is what the file system shows me). Therefore, I can't decrease the partition size, even though it should be mostly empty.

I tried running GParted as root, to see if that helps, but the terminal gave the below response.

Code:

sudo gparted
======================
libparted : 2.3
======================

(gpartedbin:6758): GLib-CRITICAL **: Source ID 7 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 6 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 26 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 25 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 303 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 302 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 307 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 306 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 312 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 311 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 315 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 314 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 319 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 318 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 322 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 321 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 327 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 326 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 330 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 329 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 333 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 332 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 897 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 896 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 931 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 930 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 1119 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 1118 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 1146 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 1145 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 1150 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 1149 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 1153 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 1152 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 1158 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 1157 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 1161 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 1160 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 1166 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 1165 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 1171 was not found when attempting to remove it

(gpartedbin:6758): GLib-CRITICAL **: Source ID 1170 was not found when attempting to remove it

I have tried to find a solution through DuckDuckGo, as well as the search on this forum, but I have been unsuccessful. The tutorials I find, all show the partition with unused space, but my GParted shows it is used almost entirely, with only 12 MiB unused.

Any help would be much appreciated, as I really don't want to format the entire HDD, because I still have hope of getting access to the encrypted folders which hold quite some files I can't easily replace (KeePass database, work-related stuff, research material and articles I wrote. There's many days of work in there).

relevant info

I'm running Linux Mint 17.2 on an external HDD, as my internal HD died months ago. It's the XFCE edition of Mint. I've been using Linux for around 6-8 months, so I have working knowledge of the terminal and most of the software on here, but I am not very familiar with the underlying workings of the OS.

Edit:
I just noticed the partition has an LVM flag. I imagine that could have something to do with it, but I don't know how this applies to the actions I have to undertake. I'll be looking for a solution and updating this question if I find anything. In the meantime, any help is still highly appreciated.

yancek 02-24-2016 08:51 AM

Quote:

I started GParted from the start menu,
The above comment would indicate to me that you are running GParted from an installed system. You can't modify partitions from a running system that is mounted. It's always simpler to use GParted from the installation medium if you have it and Mint does. You could also download GParted and put it on a bootable CD. You need to unmount any partition before you resize or try to modify it in any way.

I don't use LVM but I think you can do it with a newer version of GParted. Check the link below or do an online search for "resize lvm partitons with GParted".

Delusion of Adequacy 02-24-2016 09:03 AM

Quote:

Originally Posted by yancek (Post 5505449)
The above comment would indicate to me that you are running GParted from an installed system.

I'm running it from a live USB with Linux Mint 17.2

Quote:

Originally Posted by yancek (Post 5505449)
I don't use LVM but I think you can do it with a newer version of GParted. Check the link below or do an online search for "resize lvm partitons with GParted".

I can't see your link, but I'll see what else I can find.

Thanks for your input so far!

Delusion of Adequacy 02-24-2016 10:00 AM

I managed to resize the LVM partition using system-config-lvm as outlined here: http://askubuntu.com/questions/19612...hysical-volume

Now at least GParted shows the partition as having unused space. However, when I now try to resize the partition down to the amount of space it actually uses, I get the below result.

What am I missing here?

Code:

GParted 0.18.0 --enable-libparted-dmraid --enable-online-resize

Libparted 2.3
Shrink /dev/sda5 from 931.24 GiB to 145.27 GiB  00:00:01    ( ERROR )
           
calibrate /dev/sda5  00:00:01    ( SUCCESS )
           
path: /dev/sda5
start: 501760
end: 1953456127
size: 1952954368 (931.24 GiB)
check file system on /dev/sda5 for errors and (if possible) fix them  00:00:00    ( SUCCESS )
           
lvm pvck -v /dev/sda5
           
Found label on /dev/sda5, sector 1, type=LVM2 001
Found text metadata area: offset=4096, size=1044480
Scanning /dev/sda5
Found LVM2 metadata record at offset=14848, size=512, offset2=0 size2=0
Found LVM2 metadata record at offset=13312, size=1536, offset2=0 size2=0
Found LVM2 metadata record at offset=11776, size=1536, offset2=0 size2=0
Found LVM2 metadata record at offset=10240, size=1536, offset2=0 size2=0
Found LVM2 metadata record at offset=8704, size=1536, offset2=0 size2=0
shrink file system  00:00:00    ( ERROR )
           
lvm pvresize -v --setphysicalvolumesize 152330240K /dev/sda5
           
0 physical volume(s) resized / 1 physical volume(s) not resized
Using physical volume(s) on command line
Archiving volume group "mint-vg" metadata (seqno 8).
/dev/sda5: Pretending size is 304660480 not 1952952320 sectors.
Resizing volume "/dev/sda5" to 1952952320 sectors.
Resizing physical volume /dev/sda5 from 0 to 37189 extents.
/dev/sda5: cannot resize to 37189 extents as later ones are allocated.


sgosnell 02-24-2016 10:14 AM

If you know you can't use the data currently on the disk, don't bother with resizing. Just delete the partition and add a new one.

Delusion of Adequacy 02-24-2016 10:20 AM

Quote:

Originally Posted by Delusion of Adequacy (Post 5505484)
I managed to resize the LVM partition using system-config-lvm as outlined here: http://askubuntu.com/questions/19612...hysical-volume

Now at least GParted shows the partition as having unused space. However, when I now try to resize the partition down to the amount of space it actually uses, I get the below result.

What am I missing here?

Code:

GParted 0.18.0 --enable-libparted-dmraid --enable-online-resize

Libparted 2.3
Shrink /dev/sda5 from 931.24 GiB to 145.27 GiB  00:00:01    ( ERROR )
           
calibrate /dev/sda5  00:00:01    ( SUCCESS )
           
path: /dev/sda5
start: 501760
end: 1953456127
size: 1952954368 (931.24 GiB)
check file system on /dev/sda5 for errors and (if possible) fix them  00:00:00    ( SUCCESS )
           
lvm pvck -v /dev/sda5
           
Found label on /dev/sda5, sector 1, type=LVM2 001
Found text metadata area: offset=4096, size=1044480
Scanning /dev/sda5
Found LVM2 metadata record at offset=14848, size=512, offset2=0 size2=0
Found LVM2 metadata record at offset=13312, size=1536, offset2=0 size2=0
Found LVM2 metadata record at offset=11776, size=1536, offset2=0 size2=0
Found LVM2 metadata record at offset=10240, size=1536, offset2=0 size2=0
Found LVM2 metadata record at offset=8704, size=1536, offset2=0 size2=0
shrink file system  00:00:00    ( ERROR )
           
lvm pvresize -v --setphysicalvolumesize 152330240K /dev/sda5
           
0 physical volume(s) resized / 1 physical volume(s) not resized
Using physical volume(s) on command line
Archiving volume group "mint-vg" metadata (seqno 8).
/dev/sda5: Pretending size is 304660480 not 1952952320 sectors.
Resizing volume "/dev/sda5" to 1952952320 sectors.
Resizing physical volume /dev/sda5 from 0 to 37189 extents.
/dev/sda5: cannot resize to 37189 extents as later ones are allocated.


Turned out there was a swap partition at the end of the logical volume. Deleted it, recreated it, tried to resize again, success!

Now to create the new partition for my new install, and one for my files. If all goes well, I'll list the thread resolved.


All times are GMT -5. The time now is 04:31 PM.