Skip to contentSkip to conversation

LWN article: 4K disk sectors

DISCUSSION Michael Monnerie 5 participants 9 messages Mar 12, 2009 – Mar 14, 2009

lore
Share & tools
lore
#0 lore raw

http://lwn.net/SubscriberLink/322777/16380cde8af0a37e/

4K disk sectors coming 2011, might be interesting for devs to prepare supporting it.

mfg zmi

Signature · 10 lines
// Michael Monnerie, Ing.BSc    -----      http://it-management.at
// Tel: 0660 / 415 65 31                      .network.your.ideas.
// PGP Key:         "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: AC19 F9D5 36ED CD8A EF38  500E CE14 91F7 1C12 09B4
// Keyserver: wwwkeys.eu.pgp.net                  Key-ID: 1C1209B4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#1 lore raw
Quoted 4 lines · Michael Monnerie

http://lwn.net/SubscriberLink/322777/16380cde8af0a37e/

4K disk sectors coming 2011, might be interesting for devs to prepare supporting it.

Take a look at the mkfs.xfs man page:

-s sector_size
This option specifies the fundamental sector size of the filesystem. The sector_size is specified either as a value in bytes with size=value or as a base two loga- rithm value with log=value. The default sector_size is 512 bytes. The minimum value for sector size is 512; the maximum is 32768 (32 KiB). The sector_size must be a power of 2 size and cannot be made larger than the filesystem block size.

-Eric

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw
Quoted 11 lines · On Donnerstag 12 März 2009 Eric Sandeen wrote:

Take a look at the mkfs.xfs man page:

       -s sector_size
              This option specifies the fundamental  sector  size  of the filesystem.  The sector_size is specified either as a value in bytes with size=value or as a base two loga- rithm value with log=value.  The default sector_size is 512 bytes. The minimum value for sector  size  is  512; the  maximum is 32768 (32 KiB). The sector_size must be a power of 2 size and cannot be made  larger  than  the filesystem block size.

Ugh, I felt so good this morning, until you responded ... ;-)

I thought that it's a limitation of the Linux kernel in more parts than just the filesystem (like block cache), that sector sizes must be 512B. If I had a 4K drive, would that be usable with XFS already?

mfg zmi

Signature · 10 lines
// Michael Monnerie, Ing.BSc    -----      http://it-management.at
// Tel: 0660 / 415 65 31                      .network.your.ideas.
// PGP Key:         "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: AC19 F9D5 36ED CD8A EF38  500E CE14 91F7 1C12 09B4
// Keyserver: wwwkeys.eu.pgp.net                  Key-ID: 1C1209B4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#3 lore raw

Am Donnerstag 12 März 2009 schrieb Michael Monnerie:

Quoted 13 lines · On Donnerstag 12 März 2009 Eric Sandeen wrote:
Quoted 11 lines

Take a look at the mkfs.xfs man page:

       -s sector_size
              This option specifies the fundamental  sector  size  of the filesystem.  The sector_size is specified either as a value in bytes with size=value or as a base two loga- rithm value with log=value.  The default sector_size is 512 bytes. The minimum value for sector  size  is  512; the  maximum is 32768 (32 KiB). The sector_size must be a power of 2 size and cannot be made  larger  than  the filesystem block size.

Quoted 5 lines

Ugh, I felt so good this morning, until you responded ... ;-)

I thought that it's a limitation of the Linux kernel in more parts than just the filesystem (like block cache), that sector sizes must be 512B. If I had a 4K drive, would that be usable with XFS already?

I have an USB stick with 2KB hardware sector size. It worked nicely when using fdisk instead of cfdisk which only supports 512 byte sectors. Dunno remember exactly which filesystems I tried back then.

And first I wondered why it had a partition in the first quarter of it and then empty space. I thought it might have been a fake 1 GB stick, but still just deleted the partition and made it size the whole disk in cfdisk - well at least I thought I did. The Linux kernel complained about writing beyond end of device while mkfsing, I think it was an ext3.

Signature · 7 lines
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#4 lore raw
Quoted 15 lines · Martin Steigerwald

Am Donnerstag 12 März 2009 schrieb Michael Monnerie:

Quoted 14 lines · On Donnerstag 12 März 2009 Eric Sandeen wrote:
Quoted 11 lines

Take a look at the mkfs.xfs man page:

-s sector_size
This option specifies the fundamental sector size of the filesystem. The sector_size is specified either as a value in bytes with size=value or as a base two loga- rithm value with log=value. The default sector_size is 512 bytes. The minimum value for sector size is 512; the maximum is 32768 (32 KiB). The sector_size must be a power of 2 size and cannot be made larger than the filesystem block size.

Ugh, I felt so good this morning, until you responded ... ;-)

Quoted 7 lines
Quoted 3 lines

I thought that it's a limitation of the Linux kernel in more parts than just the filesystem (like block cache), that sector sizes must be 512B. If I had a 4K drive, would that be usable with XFS already?

I have an USB stick with 2KB hardware sector size. It worked nicely when using fdisk instead of cfdisk which only supports 512 byte sectors. Dunno remember exactly which filesystems I tried back then.

really? what kind of usb stick? I've never seen such a thing.

-Eric

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#5 lore raw

Am Donnerstag 12 März 2009 schrieb Eric Sandeen:

Quoted 20 lines
Quoted 19 lines · Martin Steigerwald

Am Donnerstag 12 März 2009 schrieb Michael Monnerie:

Quoted 17 lines · On Donnerstag 12 März 2009 Eric Sandeen wrote:
Quoted 10 lines

Take a look at the mkfs.xfs man page:

-s sector_size
This option specifies the fundamental sector size
of the filesystem. The sector_size is specified either as a value in bytes with size=value or as a base two loga- rithm value with log=value. The default sector_size is 512 bytes. The minimum value for sector size is 512; the maximum is 32768 (32 KiB). The sector_size must be a power of 2 size and cannot be made larger than the filesystem block size.

Ugh, I felt so good this morning, until you responded ... ;-)

I thought that it's a limitation of the Linux kernel in more parts than just the filesystem (like block cache), that sector sizes must be 512B. If I had a 4K drive, would that be usable with XFS already?

Quoted 5 lines
Quoted 3 lines

I have an USB stick with 2KB hardware sector size. It worked nicely when using fdisk instead of cfdisk which only supports 512 byte sectors. Dunno remember exactly which filesystems I tried back then.

really? what kind of usb stick? I've never seen such a thing.

Its a stick I got from a customer.

shambhala:~> tail -fn0 /var/log/syslog

Mar 14 20:07:53 localhost kernel: usb 2-4: new high speed USB device using 
ehci_hcd and address 18
Mar 14 20:07:53 localhost kernel: usb 2-4: configuration #1 chosen from 1 
choice
Mar 14 20:07:53 localhost kernel: scsi16 : SCSI emulation for USB Mass 
Storage devices
Mar 14 20:07:53 localhost kernel: usb 2-4: New USB device found, 
idVendor=17ef, idProduct=3815
Mar 14 20:07:53 localhost kernel: usb 2-4: New USB device strings: Mfr=1, 
Product=2, SerialNumber=3
Mar 14 20:07:53 localhost kernel: usb 2-4: Product: Flash Disk
Mar 14 20:07:53 localhost kernel: usb 2-4: Manufacturer:
Mar 14 20:07:53 localhost kernel: usb 2-4: SerialNumber: ABCDEF1234000423
Mar 14 20:07:53 localhost kernel: usb-storage: device found at 18
Mar 14 20:07:53 localhost kernel: usb-storage: waiting for device to 
settle before scanning
Mar 14 20:07:58 localhost kernel: usb-storage: device scan complete
Mar 14 20:07:58 localhost kernel: scsi 16:0:0:0: Direct-Access              
Flash Disk       5.00 PQ: 0 ANSI: 2
Mar 14 20:07:58 localhost kernel: sd 16:0:0:0: [sdb] 504832 2048-byte 
hardware sectors: (1.03 GB/986 MiB)
Mar 14 20:07:58 localhost kernel: sd 16:0:0:0: [sdb] Write Protect is off
Mar 14 20:07:58 localhost kernel: sd 16:0:0:0: [sdb] Mode Sense: 0b 00 00 
08
Mar 14 20:07:58 localhost kernel: sd 16:0:0:0: [sdb] Assuming drive cache: 
write through
Mar 14 20:07:58 localhost kernel: sd 16:0:0:0: [sdb] 504832 2048-byte 
hardware sectors: (1.03 GB/986 MiB)
Mar 14 20:07:58 localhost kernel: sd 16:0:0:0: [sdb] Write Protect is off
Mar 14 20:07:58 localhost kernel: sd 16:0:0:0: [sdb] Mode Sense: 0b 00 00 
08
Mar 14 20:07:58 localhost kernel: sd 16:0:0:0: [sdb] Assuming drive cache: 
write through
Mar 14 20:07:58 localhost kernel: sdb: sdb1
Mar 14 20:07:58 localhost kernel: sd 16:0:0:0: [sdb] Attached SCSI 
removable disk
Mar 14 20:07:58 localhost kernel: sd 16:0:0:0: Attached scsi generic sg2 

type 0
^C

Hmmm, it appears to be from Lenovo.

shambhala:~> lsusb | grep USB
Bus 002 Device 018: ID 17ef:3815 Lenovo ChipsBnk 2GB USB Stick

But its definately not 2 GB... strange. Its branded for the customer, no manufacturer logo on it.

Signature · 7 lines
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#6 lore raw
In reply to Michael Monnerie
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Michael" == Michael Monnerie <[email protected]> writes:

Michael> I thought that it's a limitation of the Linux kernel in more Michael> parts than just the filesystem (like block cache), that sector Michael> sizes must be 512B.

Nope. We've supported bigger sector sizes for years because of CD-ROMs, mainframe DASD, etc.

Michael> If I had a 4K drive, would that be usable with XFS already?

# cat /sys/block/sdc/queue/hw_sector_size 
4096
# xfs_info /mnt
meta-data=/dev/sdc1              isize=256    agcount=16, agsize=5113686 blks
         =                       sectsz=4096  attr=0
data     =                       bsize=4096   blocks=81818976, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=1
naming   =version 2              bsize=4096  
log      =internal               bsize=4096   blocks=32768, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0
Signature · 6 lines
Martin K. Petersen	Oracle Linux Engineering

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#7 lore raw
In reply to Michael Monnerie
Quoted 13 lines · Michael Monnerie
Quoted 11 lines · On Donnerstag 12 März 2009 Eric Sandeen wrote:

Take a look at the mkfs.xfs man page:

-s sector_size
This option specifies the fundamental sector size of the filesystem. The sector_size is specified either as a value in bytes with size=value or as a base two loga- rithm value with log=value. The default sector_size is 512 bytes. The minimum value for sector size is 512; the maximum is 32768 (32 KiB). The sector_size must be a power of 2 size and cannot be made larger than the filesystem block size.

Quoted 5 lines

Ugh, I felt so good this morning, until you responded ... ;-)

I thought that it's a limitation of the Linux kernel in more parts than just the filesystem (like block cache), that sector sizes must be 512B. If I had a 4K drive, would that be usable with XFS already?

Other layers need work, yes, but by and large xfs should be ready when the rest of the kernel & linux infastructure catches up.

-Eric

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#8 lore raw
In reply to Michael Monnerie
Quoted 4 lines · Michael Monnerie

http://lwn.net/SubscriberLink/322777/16380cde8af0a37e/

4K disk sectors coming 2011, might be interesting for devs to prepare supporting it.

Fortunately there's not just the PC world. 4k is the standard sector size of most common mainframe DASD so the Linux filesystems including xfs deal with it very well. The real issue are bootloader and anything involving the DOS partitioning scheme.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs