[SOLVED] GPARTED not letting me shrink partition on encrypted drive
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
GPARTED not letting me shrink partition on encrypted drive
I opened the luks encrypted drive and then tried it. I used fdisk to add 2 partitions and then tried it again on the non-encrypted partition, but get same error message:
Code:
GPARTED NOT WORKING SHRINK PARTITION
GParted 0.32.0 --enable-libparted-dmraid --enable-online-resize
Libparted 3.2
Shrink /dev/sda1 from 5.46 TiB to 1.91 TiB 00:06:11 ( ERROR )
calibrate /dev/sda1 00:00:00 ( SUCCESS )
path: /dev/sda1 (partition)
start: 2048
end: 11721043967
size: 11721041920 (5.46 TiB)
encryption path: /dev/mapper/three
check file system on /dev/mapper/three for errors and (if possible) fix them 00:00:29 ( SUCCESS )
e2fsck -f -y -v -C 0 '/dev/mapper/three' 00:00:29 ( SUCCESS )
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
11 inodes used (0.00%, out of 91586560)
0 non-contiguous files (0.0%)
0 non-contiguous directories (0.0%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 2/1
6061281 blocks used (0.83%, out of 732667904)
0 bad blocks
1 large file
0 regular files
2 directories
0 character device files
0 block device files
0 fifos
0 links
0 symbolic links (0 fast symbolic links)
0 sockets
------------
2 files
e2fsck 1.44.5 (15-Dec-2018)
shrink file system 00:05:41 ( SUCCESS )
resize2fs -p '/dev/mapper/three' 2047983616K 00:05:41 ( SUCCESS )
Resizing the filesystem on /dev/mapper/three to 511995904 (4k) blocks.
Begin pass 2 (max = 204801)
Relocating blocks XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 3 (max = 22360)
Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/mapper/three is now 511995904 (4k) blocks long.
resize2fs 1.44.5 (15-Dec-2018)
shrink encryption volume 00:00:01 ( ERROR )
cryptsetup -v --size 4095967232 resize 'three' 00:00:01 ( ERROR )
Command failed with code -1 (wrong or missing parameters).
Nothing to read on input.
========================================
IMPORTANT QUESTION: when i create multiple partitions in gparted, do i need to leave a certain amount of unallocated space or does the disk automatically take 5% even after i use
Code:
sudo dd if=/dev/zero bs=16M of=/dev/sdx
If i need to create it, i'm guessing i would take 5% of 5.5TB and use that amount for unallocated space?
Would like to know before i encrypt the partitions and start adding data. Right now US only has 100mb. thx
IMPORTANT QUESTION: when i create multiple partitions in gparted, do i need to leave a certain amount of unallocated space or does the disk automatically take 5%
Not sure what you're talking about; filesystems (not partitions, not disks) usually reserve 5% for privilegd processes. So the answer would be: no, you do not need to leave 5% of unallocated space.
GParted defaults to a partition alignment of 1 MiB, unless you need something else (i.e. cylinder alignment for very old operating systems and BIOS versions).
No need to leave anything more. Partition boot sectors are included in the space of each partition.
For a GUID partition table (GPT), the last partition is stopping at 1 MiB before the end of the drive, to leave space for the spare copy of the partition table.
As it concerns reserved space for Linux ext... filesystems, the default is 5%. GParted uses that default value and you can't change it. Nevertheless it is possible to manually format a partition using the command line arguments, to apply another value (I remember from the past that it can be 1% to 7%, I don't know if these values are still valid). It seems that it is more important for system partitions and less important for data partitions.
Anyway, it is always possible to free part or all of that reserved space using the command tune2fs. Keeping it helps to prevent excessive fragmentation and performance degradation if the free space is too low.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.