Skip to contentSkip to conversation

-G to smaller doesn't move superblock... is there _any_ way to shrink?

DISCUSSION Thomas Arthur Oehser 3 participants 3 messages Nov 6, 2009 MD RAID

lore
Share & tools
lore
#0 lore raw

So, I thought the logical sequence was:

resize2fs <smaller>
mdadm -G -z <smaller>
fdisk <smaller>

... but ...

the mdadm -G -z <smaller> seems to leave the superblock at the end of the partition...

Is there _any_ way to do what I'm trying to do? I don't see options to tell it I want the superblock to be at offset X or that the partition is "going to be" smaller... and I don't see options for switching the superblock format and moving stuff around... and I'm really not wanting to do --create and cross my fingers that everything "just works".

-Tom

Signature · 6 lines
"Let us do our duty in our shop or our kitchen, the market, the street, the
office, the school, the home, just as faithfully as if we stood in the front
rank of some great battle, and we knew that victory for mankind depended upon
our bravery, strength, and skill.  When we do that the humblest of us will be
serving in that great army which achieves the welfare of the world."
 --Theodore Parker
#1 lore raw
Quoted 12 lines · Thomas Arthur Oehser

So, I thought the logical sequence was:

resize2fs <smaller>
mdadm -G -z <smaller>
fdisk <smaller>

... but ...

the mdadm -G -z <smaller> seems to leave the superblock at the end of the partition...

Quoted 8 lines

Is there _any_ way to do what I'm trying to do? I don't see options to tell it I want
the superblock to be at offset X or that the partition is "going to be" smaller... and
I don't see options for switching the superblock format and moving stuff around... and
I'm really not wanting to do --create and cross my fingers that everything "just works".

Other than using --create, which isn't much of a risk, the only way to do what you want is to fail and remove each device from the array, resize the device, add it back to the array, then when recovery completes, move on to the next device.

NeilBrown

#2 lore raw
Quoted 6 lines

Other than using --create, which isn't much of a risk, the only way to do what you want is to fail and remove each device from the array, resize the device, add it back to the array, then when recovery completes, move on to the next device.

NeilBrown

That's one more reason to use the 1.1 or 1.2 format for everything except /boot .