[BlueOnyx:17869] Re: Re-partition

Michael Stauber mstauber at blueonyx.it
Sat Jun 20 22:29:40 -05 2015


Hi Tom,

> I did a server image backup of my old RAID drives. I installed new drives, 
> hardware raided them and did an image restore. Everything is up and 
> running, no errors. However, as I already knew, even though the new drive 
> size is 1TB, all the partitions are exactly as the original, totaling 
> 250GB, with the rest unallocated.

When you restore a disk image, then this usually inherits the same
partitioning table as the old disk(s) had.

So if you installed the image on a bigger disk, then there will be space
free. To make use of it you can use several file system related tools to
"grow" one of the partitions.

How to do that depends on a few factors. Like: Are you using LVM? Or is
it a "native" partition? In BlueOnyx we usually use LVM as a default.
Then this also depends on if this is software RAID1 or not using RAID at
all.

The mechanisms of how this is actually done depends more on the
combination of factors (RAID, LVM, native partitions) than on the Linux
distributions themselves. The "tools" are generally the same:

- resize2fs (resize partition)
- pvresize (resize LVM)
- mdadm (can be used to reize raid members)

Now let me add a word of warning and some wisdom: In the last 15 years I
resized LVM partitions on RAID1 maybe 4-5 times. I always managed to do
it without data loss (so I got that going for me, which is nice). But I
wouldn't recommend it as it's not worth the hassles. You can only really
do it properly if you boot off a CD in rescue mode. Which is often not
practical. And there is the chance of it going wrong. So added to the
unavoidable downtime of doing it that way there is the good chance that
you have to start over doing a fresh install and a restore from a CMU
backup. Which you know will work 99.9% of the time and the guide for
that is fully accurate and out there.

So if you'd ask me "Hey, can you resize this for me?" I'd say "Hell, no.
I won't." Because it's risky. For that reason I also rather not link to
a guide for doing it, because most of them require a fairly solid
understanding of what the commands actually do and if you should run
this commands in first place given the partitioning layout and architecture.

But let me add another snippet of info: LVM can span multiple
partitions. So you could do this (instead of resizing):

Create a new partition using the free space. Add that to the RAID1 (if
your box is using RAID1) and then reconfigure the LVM /home partition to
span both the old space of /home and the new partition and then "grow"
that to the maximum with pvresize.

But in the end the approach that requires the lowest Linux skillset and
has the highest success rate is a cmuExport / cmuImport.

See: http://www.blueonyx.it/index.php?page=cmu-migrations

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list