Answer the question
In order to leave comments, you need to log in
How to expand file system on mdadm RAID volume?
Hello!
There is such a RAID1
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 vda1[2] vdb1[3]
5236736 blocks super 1.2 [2/2] [UU]
unused devices:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 248M 0 rom
vda 254:0 0 10G 0 disk
└─vda1 254:1 0 5G 0 part
└─md0 9:0 0 5G 0 raid1 /
vdb 254:16 0 10G 0 disk
└─vdb1 254:17 0 5G 0 part
└─md0 9:0 0 5G 0 raid1 /
Disk /dev/vda: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe6cdecc3
Device Boot Start End Sectors Size Id Type
/dev/vda1 * 2048 10483711 10481664 5G 83 Linux
Disk /dev/vdb: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xedf06c71
Device Boot Start End Sectors Size Id Type
/dev/vdb1 * 2048 10483711 10481664 5G fd Linux raid autodetect
Disk /dev/md0: 5 GiB, 5362417664 bytes, 10473472 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
- i.e. nothing has changed
mdadm --grow /dev/md0 --size=max
mdadm: component size of /dev/md0 unchanged at 5236736K
Answer the question
In order to leave comments, you need to log in
So you have an array and only half of the volume is allocated.
Eject the disk from the array
mdadm /dev/md0 -f /dev/vda
mdadm /dev/md0 -r /dev/vda
repartition the disk to full capacity and add back
mdadm /dev/md0 -a /dev/vda
Watch the synchronization process, when finished repeat with another disk.
However, through parted resizepart it should be possible to expand the partition without resynchronizing the array.
Then
mdadm --grow /dev/md0 --size=max
resize2fs /dev/md0
And the question aside: vda/vdb - usually denote a virtual machine. Are you sure that you need a guest raid at all? Usually a raid on the host system is done.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question