[mythtv-users] Change filesystem format in place?

Simon Hobson linux at thehobsons.co.uk
Mon Jul 13 07:20:25 UTC 2015


Seeker <seeker5528 at comcast.net> wrote:

> Any partition operation has a risk that is greater than zero.

Indeed, and another reason for employing a new drive - your old drive becomes a backup should the copy fail for any reason.

> Any change that moves the beginning of the parition, no matter how "small" is a major undertaking that will
> cause the entire partition to be re-written. 
> Long operation, much more risk that something could be done incorrectly or that something might happen
> that will interrupt the process.

AFAIK there are no filesystem utils to do this - certain ext[234] utils only move the end of the partition.
In theory, as long as the tool is written to do it, a filesystem resize tool can do everything safely - ie write the data to it's new location, sync the data, update the filesystem structures, sync the changes - so in theory they could be written to be safely interruptible (I don't know if they are written that way). Moving the partition isn't a safe operation - once you start, you have a corrupt filesystem until it's finished.

> My personal tactic would be to free up enough space so the newly resized partition will be some gigabytes
> less than %50 of the drive, but still leaving some gigabytes of free space within the shrunken partition, moving
> the trailing end of the partition to the desired size.
> 
> Then copy the resulting partition to the end of the free space.

I did have another idea working with less free space.
Shrink the existing filesystem and partition. Create a new one in the empty space, and move as many files as will fit to it.
Shrink the existing partition again, create a new partition in the empty space, move files ...
When you get to the point that the existing partition is empty, make a new filesystem in it, move the files from the last created temporary partition, delete that partition, expand the original one, rinse and repeat.
But it's still a lot of work, so ...

> For myself, I wouldn't consider the reward to be worth the effort, so would wait until I was ready to get 
> another drive anyway, set up the new drive the way I want, keep the old drive unchanged for a few months.

+1
Indeed, a new drive doesn't cost that much, and the extra space is always useful.





More information about the mythtv-users mailing list