1

Keep in mind that this question is not about how to resize/grow a RAID array or RAID partition.

I have a 4 TB partition (/dev/sdb1) on a 8 TB physical HDD (/dev/sdb). The partition has the flag raid because it is part of an incomplete RAID1 array. There is no other partition on that HDD.

$ sudo fdisk -l /dev/sdb
Disk /dev/sdb: 7,3 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: TOSHIBA HDWG180 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 1F88C10B-74C7-B940-801A-556C5F5E2DA8

Device     Start        End    Sectors  Size Type
/dev/sdb1   2048 7814037134 7814035087  3,7T Linux RAID

I want to resize that partition to use the full 8TB HDD without loosing the data in the partition.

If this would be a usual filesystem (e.g. ext4) I would know what to do. But with a Linux RAID type I am not sure if this is a filesystem or not. Or does the RAID1 on the higher level influence all that.

Of course a "simple" mdadm --grow does not work because the underlying partition (/dev/sdb1) is to small.

$ sudo mdadm --grow /dev/md0 --size=max
mdadm: component size of /dev/md0 has been set to 3906885447K

Background info: The RAID1 currently has no second device/partition - it is missing. In the last consequence I want to grow the "higher-level" RAID1 partition (/dev/md0; assembled from /dev/sdb1 only, with a missing/failed/removed second device).

1 Answer 1

2

There is nothing magic about the raid flag ( in fact, all it does is change the partition table type, and Linux doesn't really give a fig about partition table types ). Partitions are partitions, and the contents are the contents. Resize the partition just as you would for an ext4 filesystem, then mdadm --grow can grow the raid array to use the additional space. Then you'll want to grow whatever is inside the raid array.

You must log in to answer this question.

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