[opensuse] format disk with 4096 sector size
Hello reading the other thread about advantage of 4096 sector size disk, I noticed one of my (spare) 1Tb backup disk is given by hdparm to have 4096 sector size, and I wanted to use it. however I'm puzzled. what ever I do, hdparm always says logical 512 / physical 4096, fdisk and YaST 512/512 first tryed with yast, modifying the filesystem option to 4096, then tried manually with: fdisk -b 4096 /dev/sdp remove partitions, create new as default -hole disk), write disque /dev/sdp : 8001.6 Go, 8001639088128 octets, 1953525168 secteurs Unités = secteur de 1 × 4096 = 4096 octets Taille de secteur (logique / physique) : 4096 octets / 4096 octets but hdparm says: Logical Sector size: 512 bytes Physical Sector size: 4096 bytes and fdisk -l Disque /dev/sdp : 1000.2 Go, 1000204886016 octets, 1953525168 secteurs Unités = secteur de 1 × 512 = 512 octets Taille de secteur (logique / physique) : 512 octets / 512 octets so what? thanks jdd -- http://www.dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2014-07-07 12:32 (GMT+0200) jdd composed:
Hello reading the other thread about advantage of 4096 sector size disk, I noticed one of my (spare) 1Tb backup disk is given by hdparm to have 4096 sector size, and I wanted to use it.
however I'm puzzled.
what ever I do, hdparm always says logical 512 / physical 4096, fdisk and YaST 512/512
first tryed with yast, modifying the filesystem option to 4096, then tried manually with:
fdisk -b 4096 /dev/sdp
remove partitions, create new as default -hole disk), write
disque /dev/sdp : 8001.6 Go, 8001639088128 octets, 1953525168 secteurs Unités = secteur de 1 × 4096 = 4096 octets Taille de secteur (logique / physique) : 4096 octets / 4096 octets
but hdparm says:
Logical Sector size: 512 bytes Physical Sector size: 4096 bytes
and fdisk -l
Disque /dev/sdp : 1000.2 Go, 1000204886016 octets, 1953525168 secteurs Unités = secteur de 1 × 512 = 512 octets Taille de secteur (logique / physique) : 512 octets / 512 octets
so what?
So read the whole other thread again, paying closer attention to: http://www.seagate.com/tech-insights/advanced-format-4k-sector-hard-drives-m... I don't know that operating systems will be overhauling themselves any time soon, if ever, to make a minimum filesystem allocation size 4096 bytes instead of 512 bytes. It's much more wasteful. Also, 512 is intertwined with too many kernel, support system and application components. IOW, this 512/4096 thing is really about I/O efficiency. Just because disk makers have agreed they are committed to 4096 internally does not mean the rest of the universe must make the same atomic adjustment. So for the foreseeable future and beyond, the only things you should be concerned with are: 1-what is reported for optimal I/O size (minor concern) 2-I/O alignment to physical disk sectors (primary concern) The filesystems you use are likely already using a blocksize that matches the "advanced format" physical sector size, leaving the only concern #2, ensuring logical disk divisions are aligned to 4k multiples. You don't want to see tools mentioning an obsolete CHS of ?/255/63 or ?/240/63 as have been typical since a couple of decades or so ago. So, watch what happens when you create /dev/sdX1. Except on a disk with genuine 512 byte physical sectors, you do not want to see: Device Boot Start End Blocks Id System /dev/sda1 63 80324 40131 83 Linux Start = 63 == bad. Block count not evenly divisible by 8 == bad. On disks with 4096 byte physical sectors, you do want to see e.g.: Device Boot Start End Blocks Id System /dev/sda1 2048 821247 409600 83 Linux Start = 2048 == good. Block count evenly divisible by 8 == good. If using GPT, the desired start sector 2048 offset will happen automatically. Don't pay much attention to the logical/physical lies often reported about disks more than two years old. If in doubt about the physical sector size and it bothers you, consult the manufacturer specifications for your disk. Also for most uses, it hurts nothing to assume 4096 byte sectors in partitioning disks that have 512. The only situations where a 4096 blocksize assumption can hurt is for filesystems purposely configured with small blocksize because they play host to a huge number of small files. WRT $SUBJECT, you want a filesystem blocksize of 4096, not a sector size of 4096. Leave the OS, tools and applications to continue using the 512 byte standard sector size as always since the birth of the IBM PC. -- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Le 07/07/2014 17:14, Felix Miata a écrit :
So read the whole other thread again,
better not, already read most of it. Seems to say 4096 is much faster what is important for 1To backup paying closer attention to:
http://www.seagate.com/tech-insights/advanced-format-4k-sector-hard-drives-m...
not to be done in 1/4 hour, interesting, I will do later :-)
/dev/sda1 63 80324 40131 83 Linux
fdisk do 256, yast 2048 /dev/sdp1 2048 1953523711 976760832 83 Linux
If using GPT, the desired start sector 2048 offset will happen automatically.
I don't see how to use GPT. Having only one partition, its not important
assumption can hurt is for filesystems purposely configured with small blocksize because they play host to a huge number of small files.
should not be a problem with modern filesystem (hold small files in headers)
WRT $SUBJECT, you want a filesystem blocksize of 4096, not a sector size of 4096. Leave the OS, tools and applications to continue using the 512 byte standard sector size as always since the birth of the IBM PC.
ok, thanks jdd -- http://www.dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Mon, Jul 7, 2014 at 11:44 AM, jdd <jdd@dodin.org> wrote:
/dev/sda1 63 80324 40131 83 Linux
fdisk do 256, yast 2048
/dev/sdp1 2048 1953523711 976760832 83 Linux
256 * 4096 = 2048 * 512 = 1 MiB It is hard to even say which tool is reporting the right starting sector, but I'm willing to bet your partition is starting at a 1 MiB offset from the start of the drive. If so, that is the linux default as of a couple years ago. And 1 MiB is aligned with the physical sectors, so you should be good. Greg -- Greg Freemyer -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday, 2014-07-07 at 12:32 +0200, jdd wrote:
Hello reading the other thread about advantage of 4096 sector size disk, I noticed one of my (spare) 1Tb backup disk is given by hdparm to have 4096 sector size, and I wanted to use it.
however I'm puzzled.
what ever I do, hdparm always says logical 512 / physical 4096, fdisk and YaST 512/512
Telcontar:~ # hdparm -I /dev/sde | grep "Sector size" Logical Sector size: 512 bytes Physical Sector size: 4096 bytes Telcontar:~ # fdisk -l /dev/sde | grep "Sector size\|Units" Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes Perhaps you get confused with the "units" size. :-? I fact, recently I was goin to format a disk with yast, and I was not convinced that it was going to do it right re garding sector size, so instead I used gparted. If the hard disk report the "Logical Sector size" as 512 some utility might be confused and use that size. :-?
first tryed with yast, modifying the filesystem option to 4096, then tried manually with:
fdisk -b 4096 /dev/sdp
remove partitions, create new as default -hole disk), write
disque /dev/sdp : 8001.6 Go, 8001639088128 octets, 1953525168 secteurs Unités = secteur de 1 × 4096 = 4096 octets Taille de secteur (logique / physique) : 4096 octets / 4096 octets
but hdparm says:
Logical Sector size: 512 bytes Physical Sector size: 4096 bytes
and fdisk -l
Disque /dev/sdp : 1000.2 Go, 1000204886016 octets, 1953525168 secteurs Unités = secteur de 1 × 512 = 512 octets Taille de secteur (logique / physique) : 512 octets / 512 octets
Curious... Ah, one trick more: LANG=C fdisk -l will get you the output, for that time only, in English, so that people here can read it easily ;-) - -- Cheers, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iEYEARECAAYFAlO6wSMACgkQtTMYHG2NR9Vx6wCfd4L2KaOKR3rCnqgfES5jQojh z78AoJIvcEUphC3Ep/B70B0yTkEWNNr8 =//mt -----END PGP SIGNATURE-----
participants (4)
-
Carlos E. R.
-
Felix Miata
-
Greg Freemyer
-
jdd