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 12-04-2020, 06:42 AM   #1
blooperx3
Member
 
Registered: Nov 2020
Posts: 67

Rep: Reputation: Disabled
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.
========================================
 
Old 12-04-2020, 09:19 AM   #2
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 4,014
Blog Entries: 33

Rep: Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471
blooperx3,

This link may help:
https://thequantitative.medium.com/r...m-6ef475619745
 
Old 12-04-2020, 12:23 PM   #3
blooperx3
Member
 
Registered: Nov 2020
Posts: 67

Original Poster
Rep: Reputation: Disabled
Thanks. I erased everything and started over.

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
 
Old 12-04-2020, 12:42 PM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by blooperx3 View Post
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.
 
Old 12-04-2020, 01:43 PM   #5
blooperx3
Member
 
Registered: Nov 2020
Posts: 67

Original Poster
Rep: Reputation: Disabled
ahhh - filesystems take 5%.

Appreciate the help.
 
Old 12-04-2020, 04:26 PM   #6
masterclassic
Member
 
Registered: Jun 2007
Distribution: Knoppix, antiX
Posts: 252

Rep: Reputation: 73
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.
 
  


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
How dangerous to shrink system LVM partition a little bit with gparted? [CentOS 7] ohmster CentOS 21 05-30-2015 10:20 PM
Shrink partition (LVM encrypted PVs + encrypted LVs) gedaj Linux - Newbie 2 05-22-2013 03:44 AM
Shrink os partition using Gparted nnjond Linux - Newbie 2 02-12-2011 01:18 PM
Gparted not letting me shrink Vista partition despite free space allele Linux - Software 5 06-24-2009 06:37 AM
rEFIt problem, cannot boot linux after using gparted to shrink non-OS partition jeberd Linux - Software 6 01-29-2009 01:51 AM

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

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