Re: My MD is too big to resize ext4.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/08/2017 02:44 PM, Andreas Klauer wrote:
On Sat, Jul 08, 2017 at 01:12:11PM -0500, Ram Ramesh wrote:
     1. My MD uses partitions sd{b,c,d,e,f,g}1 instead of full disks. So
I can create partitions on the drive instead of on the MD.
     2. This means I need to shrink my current md device to smaller size
(say 12TB-14TB) - need to check my current
           active ext4 data size. It is definitely less than 16TB.
     3. Repartition the disks to create sd{b-g}2 for the reamining unused
6xnTB area.
     4. Created md1 with sd{b-g]2 to get md1.
     5. Mount and use md1.
Should work; you have to shrink the filesystem first, (or stick to
whatever size it has now), then the md, then the partition.

What makes this risky is that you have to pick the correct sizes.
When growing you can't go wrong. When shrinking, you have to be
careful not to shrink too much. Filesystems don't like it at all
if their end is missing, and md doesn't like it if the block device
is smaller than what it says in the metadata.

So you have to determine the exact filesystem size (tune2fs -l),
and take mdadm data offsets into account.

Not necessary if you know what you're doing but if in doubt,
you can leave a safety margin with each of these steps.

Regards
Andreas Klauer
My df shows that I use 10431258240 blocks (1K) in my ext4 on the md. This is less than 10T. So, resize2fs to 11T should be fine. I will shrink md to 11.5T and partition to 12T. I will use 2^30 to mean TB. Is 0.5T enough margin in each case?

I can also stretch the limit to 15TB for ext4 and 15.5 for md and 16TB for partiton. Is this better because it maxes out the 32bit ext4? Somehow something tells me pushing the limit is always a bad idea as mistakes generally happen on checking boundary conditions.

Alternatively, I can do resize2fs with -M to minimal size, but the man says calculations are not perfect for 1/2K block sizes. However, I see that dumpe2fs says I have 4K blocks.

Ramesh

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux