[CentOS] ext4, 4k sector alignment

Mon Jul 25 18:42:51 UTC 2011
Brian Mathis <brian.mathis+centos at betteradmin.com>

On Mon, Jul 25, 2011 at 1:10 PM, Les Mikesell <lesmikesell at gmail.com> wrote:
> I've mentioned this problem before but put off doing anything about it
> and maybe now someone can suggest the best solution.
>
> I have a 3-member RAID1 set where one of the members is periodically
> swapped and rotated offsite.  The filesystem contains a backuppc archive
> which has millions of hardlinks that make it impractical to copy with a
> file-oriented approach.  The current filesystem is ext3 with one
> partition that uses the entire disk capacity (no lvm).  It works as is,
> but...
>
> I'd like to use a laptop size drive for the swapped member and the only
> ones available that match the size have 4k sectors.  I have swappable,
> trayless SATA bays available for both drive sizes.  The problem is that
> with the current partition layout, the drive with 4k sectors takes more
> than a day to re-sync even though on read access the speed is a match
> for the full sized drives that sync in a few hours.
>
> My questions for any filesystem experts are:
>
> Is there a way to adjust the existing md partitions to get the right
> alignment for 4k sectors without having to do a file-oriented copy to
> new partitions?  A resize + a dd copy to shift the position might be
> feasible time-wise if that would work.
>
> Is it worth converting to ext4?
>
> Is there a difference between doing this on 5.6 or 6.x?
>
> If I start over from scratch with 6.x, will the partitioning tools
> automatically align for 4k sector drives (with/without lvm?)?
>
> --
>   Les Mikesell
>    lesmikesell at gmail.com


I've wondered many times, though haven't tried it, if the issues with
hard links and backuppc could be solved by using a container file with
a loopback mount, and then that file could be moved around as needed
without running into hard-link issues.

In this case, you could format the external drive in the optimal mode
for 4k sectors, then create a container file and mount it using
loopback.  Then add the loopback device to the mdraid and have it
sync.


-☙ Brian Mathis ❧-