1

Topic: shrinking a raid partition, using the free space for new partitions?

I was trying to shrink a raid partition and reuse the free space for a new partion (new raid partition)

But it fails.

The filesystem is successfully shrinked but creating the new partition fails.

is there a workaround?



GParted 0.32.0 --enable-libparted-dmraid --enable-online-resize

Libparted 3.2

Shrink /dev/md2 from 922.08 GiB to 824.42 GiB  00:00:34    ( SUCCESS )
       
calibrate /dev/md2  00:00:00    ( SUCCESS )
       
path: /dev/md2 (device)
start: 0
end: 1933731455
size: 1933731456 (922.08 GiB)
check file system on /dev/md2 for errors and (if possible) fix them  00:00:34    ( SUCCESS )
       
e2fsck -f -y -v -C 0 '/dev/md2'  00:00:34    ( 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

1318106 inodes used (2.44%, out of 54034432)
12031 non-contiguous files (0.9%)
1126 non-contiguous directories (0.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 1266005/1422/3
168861566 blocks used (78.13%, out of 216116480)
0 bad blocks
50 large files

1147024 regular files
101549 directories
55 character device files
25 block device files
0 fifos
285 links
69250 symbolic links (50394 fast symbolic links)
194 sockets
------------
1318382 files
e2fsck 1.44.5 (15-Dec-2018)
shrink file system  00:00:00    ( SUCCESS )
       
resize2fs -p '/dev/md2' 864465920K  00:00:00    ( SUCCESS )
       
resize2fs 1.44.5 (15-Dec-2018)
The filesystem is already 216116480 (4k) blocks long. Nothing to do!

========================================

Create Primary Partition #1 (ext4, 97.66 GiB) on /dev/md2  00:00:01    ( ERROR )
       
create empty partition  00:00:01    ( ERROR )
       
libparted messages    ( ERROR )
       
Too many primary partitions.
========================================

2

Re: shrinking a raid partition, using the free space for new partitions?

It appears that your RAID device has no partition table.

Typically a path, such as /dev/md2, represents a device.
Further a path, such as /dev/md2p3, would represent a partition.

Hence it appears that you have shrunk the file system on a device which has no partition table and hence you cannot add another partition.

You might try the GParted menu View -> Device Information to see what is listed for Partition table.