tech-kern archive

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

Re: File systems on 4k sector devices?



On Thu, Jun 07, 2012 at 08:08:50AM +0000, David Holland wrote:
> On Thu, Jun 07, 2012 at 12:49:52AM -0700, Phil Nelson wrote:
>  > (parts of the disk label)
>  > bytes/sector: 4096
>  > sectors/track: 32
>  > tracks/cylinder: 64
>  > sectors/cylinder: 2048
>  > cylinders: 357698
>  > total sectors: 732566642
>  > 
>  >   d: 732566642         0     unused      0     0        # (Cyl.      0 - 
> 357698*)
>  >  e:     50000        63     4.2BSD   1024  8192     0  # (Cyl.      0*-    
>  24*)
>  >  f: 732516579     50063     4.2BSD   4096 32768     0  # (Cyl.     24*- 
> 357698*)
>                         ^^
> 
> I suspect your problem is that those 63's are making the partition not
> sector-aligned.

This looks like a device that reports 4k sectors, as such the offset
of 63 is in 4k sectors - so shouldn't, it itself, be an issue.

> disklabel is supposed to not do that on 4k-sector disks, but I think
> the logic involved is more recent than the 5.1 release.

You are thinking of code that uses different rules for 'large' disks
in order to avoid RMW issues on disks that report 512 byte sectors
but really have 4k ones.

> The 63 thing is an old MSDOS-related superstition and there's no
> reason to follow it now. (Even if there ever was, which wasn't ever
> entirely clear.)

I suspect it comes from reserving the first track - whether for the
boot code/bios or just to avoid crossing the track boundary is unclear.

Support for non-512 byte disks is somewhere between non-existant and patchy.
Partially because it isn't actually obvious what to do!

Constraints in the file system layout actually mean that some things
that are currently treated as 'sector offsets' need to be 'byte offsets'.
(Like the location of the disklabel on i386/amd64 etc)

My personal opinion is that a filesystem image should be copyable between
physical media with different block sizes provided that the fs allocation
unit remains larger than the physical sector size.
So with a 4k physical sector ffs would have to have a fragment size of
at least 4k.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index