[opensuse] Disk Drive Technology and partition alignment [WAS: ]Re: 12.3 + ntfs + ext4 + USB3 + different copying speeds
Linda Walsh <suse@tlinx.org> wrote:
Greg Freemyer wrote:
It is time for you to enter the 21st century in respects to disk
geometry. ---- Greg, stop showing your ignorance.
Ignorant of disk drive tech? Me? I'm open to learn, so let's see where we end up.
The LBA still corresponds to CHS *internally* -- just that the nums are internal to each HD.
My statement, which I stand by, is that the CHS value returned by the drive is meaningless in modern rotating drives. Obviously drives still have cylinders, heads, and sectors, they just don't try to relate that geometry via the CHS info that was so important prior to 1995 or so. Further, I state that the S value for sectors per track is not constant for the entire drive. You say there are lots of zones. I'm open to the idea that there are lot of values for S, depending where on the disk you are. Ignoring any zoning effects: Ie. S = int( (PI * D) / L) Where D = diameter L = linear length of a sector I'm open to the idea that a disk drive would have the cylinders grouped into zones of fixed S (sectors / track). I state that S and RPMs drive the transfer rate, so that is why you see different rates for different parts of the drive. Ie. Transfer rate = (RPMs / 60) * S * 512 / 1,000,000 = x MB/sec Hdd drives run at a constant rpm, so the reason for the variation in transfer rate is the variation in S from one zone to another. So for a drive spinning at 7200 rpm and transferring 120 MB/sec for the outer cylinders, that is about 2000 sectors/track.
For at least the last decade the linear density of sectors is
typically constant over the whole platter. Since you know circumference of a circle is PI * D, a track 3 inches from the center holds 3x the sectors as one 1 inch from the center. That means number of sectors per track isn't even a constant for a modern drive. ---- Wrong. Right!
Modern HD's have been divided into zones for the past 15+years...
Zones == collections of cylinders with the same # of sectors/track? If so, we both agree, but I have no idea why you said "wrong". Anyway that means there is a fixed S (sectors/track) for each zone. How can you know what the zones are and what the sectors per track are for any given zone? Without that info you can't attempt to align your partitions, so I'm still at a loss that you say partitions are aligned to tracks in drives made since 1995 or so.
Modern HD's have almost 1 zone/TB, but you can see a most modern examople at:
I guess you meant GB? If a track has 2000 sectors per the above, and a drive has 4 heads then that's 4 MB per cylinder. Thus 1 GB is 250 cylinders. So I guess your saying a zone has roughly 250 cylinders. I have no feedback about that, but it seems reasonable.
http://media.bestofmicro.com/E/N/362111/original/throughput-diagram-wd4001FA...
Latest 4TB HD... That isn't a smooth curve -- Each notch is a zone.. Across each zone the number of sectors is constant.
Very odd on that graph... notice as some have noted the first 50-100GB are slightly lower than just past the 100GB mark -- for READS... writes seem to be very smooth but likely due to internal disk buffering...
Fyi: both modern windows and linux align to 1MB boundaries with no
concern how that aligns with tracks. ---- Depends on what disk partition tool you use, but I don't know of any that use MB.
Hmmm... I do computer forensics for a living. I see lots of real world drives, but mostly windows. The first partition on most of them starts at sector 63 or 2048. 63 is from partitioning tools that try to align the first partition and believe the lie that the CHS data provides. Windows xp does that. 2048 is what newer computers typically have. They no longer worry about tracks and just align to 1 MB boundaries. Vista and win7 do that. Linux partitioning tools in general got updated a couple years ago to default to MB alignment. My favorite tool for listing partition setups is mmls (it only outputs info since it is a reporting only tool). (Install sleuthkit it you want to use mmls). For my laptop, by chance in Jan I put in a brand new unformatted drive in Jan and then did a full openSUSE 12.2 install. Nothing fancy and I accepted the partition alignment as proposed by the installer:
sudo mmls /dev/sda DOS Partition Table Offset Sector: 0 Units are in 512-byte sectors
Slot Start End Length Description 00: Meta 0000000000 0000000000 0000000001 Primary Table (#0) 01: ----- 0000000000 0000002047 0000002048 Unallocated 02: 00:00 0000002048 0004208639 0004206592 Linux Swap / Solaris x86 (0x82) 03: 00:01 0004208640 0012595199 0008386560 Linux (0x83) 04: ----- 0012595200 0046153727 0033558528 Unallocated 05: 00:02 0046153728 0255866879 0209713152 Linux (0x83) 06: ----- 0255866880 0976773167 0720906288 Unallocated Note that mmls shows not only the allocated partitions, but also the unallocated space between partitions. So the the line starting with 02: is the first partition and you can see it starts at sector 2048. Note that 4208640 and 46153728 are also both multiples of 2048, thus all 3 real partitions are 1 MB aligned. Thus it is clear that whatever default openSUSE partitioner is used during install does 1 MB alignment. Now I happen to have a 1.5 TB external drive hooked up. What does mmls show for it:
sudo mmls /dev/sdb root's password: DOS Partition Table Offset Sector: 0 Units are in 512-byte sectors
Slot Start End Length Description 00: Meta 0000000000 0000000000 0000000001 Primary Table (#0) 01: ----- 0000000000 0000002047 0000002048 Unallocated 02: 00:00 0000002048 2930272255 2930270208 NTFS (0x07) 03: ----- 2930272256 2930277166 0000004911 Unallocated Now that drive was formatted by Seagate at their factory, and guess what, they too start the first partition at 1 MB. The rest of your email I'm going to ignore because it seems to be about how the tools report partitions, not how they create them. If you want me to test any particular partitioner, just ask. That 1.5 TB external is a scratch drive. I can use dd to wipe the partition table and then use whatever tiool you want to create new partitions. I don't know which have been updated to default to 1 MB alignment, but I hope most have by now. Greg
The default display in fdisk:...sd Device Boot Start End Blocks Id System /dev/sdc1 63 25398764 12699351 83 Linux /dev/sdc2 25398765 42009974 8305605 83 Linux /dev/sdc3 * 42009975 44130554 1060290 83 Linux Shows POSIX standard 512 byte sectors.
parted.. Number Start End Size Type File system Flags 1 32.3kB 13.0GB 13.0GB primary xfs type=83 2 13.0GB 21.5GB 8505MB primary xfs type=83 3 21.5GB 22.6GB 1086MB primary xfs boot, type=83 4 22.6GB 146GB 123GB extended type=05 5 22.6GB 31.2GB 8595MB logical linux-swap(v1) type=82 6 31.2GB 47.3GB 16.1GB logical xfs type=83 7 47.3GB 58.0GB 10.7GB logical xfs type=83 8 59.1GB 145GB 85.9GB logical type=83
Hmm....looks like kB is the lowest unit well...nope... (parted) help unit unit UNIT set the default unit to UNIT
UNIT is one of: s, B, kB, MB, GB, TB, compact, cyl, chs, %, kiB, MiB, GiB, TiB default is 'compact'...
As for my other two sd's, they both start at 17.4kB -- that's not a 1MB boundary either... it's actually 34 sectors -- I guess thats a gpt size -- and boot drive is sdc... starting at the 63 sector Looking at the # blocks/partition and dividing by 2*1024*1024 (sectors->MB): fdisk -l /dev/sdc|cut -c41-49|grep -P '^\s*[0-9]+$'|while read secs;do printf "%10d %s\n" "$secs" "$(pcalc "$secs/(2*1024*1024)"|grep -P '= \d')" done 12699351 = 6.05552244186401 8305605 = 3.96042108535767 1060290 = 0.505585670471191 120278655 = 57.3533320426941 8393931 = 4.00253820419312 15735636 = 7.50333595275879 10490413 = 5.00221872329712 83883366 = 39.9987058639526 ----
I would say those are track aligned -- That's a 21st century 15K SAS drive.
MB alignment?... I don't think even windows is that dumb. Track alignment is still an issue -- ask anyone running RAID -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Greg Freemyer wrote:
Zones == collections of cylinders with the same # of sectors/track? If so, we both agree, but I have no idea why you said "wrong".
---- One of my best friends and I often argue over terminology...ALOT... Once we figure out what each of us is saying we find we are in agreement most of the time. But one thing he says to me that you just reminded me of... "Why do you say 'no' when you mean 'yes'?".... Well usually because it's not exactly what he's saying, but with conditionals that to him don't make a difference. Sound familiar...
I do computer forensics for a living. I see lots of real world drives, but mostly windows. The first partition on most of them starts at sector 63 or 2048. 63 is from partitioning tools that try to align the first partition and believe the lie that the CHS data provides. Windows xp does that.
My drives were last formatted on linux to be win compatible, as I thought I might need the compat for some reason or another. The larger drives weren't weren't setup for win compat and parted on suse chose 34 sectors -- not optimal. I note that it now has 4 settings for alignment you can choose when creating a partition -- it doesn't say which is the default. But options are 'none', 'min', 'optimal' and 'cylinder'. So I wonder how optimal would differ from a cylinder -- but also how one optimizes RAID layouts in light of 'optimal' being a different (and not necessarily equal or not-equal) option from 'cylinder'.
2048 is what newer computers typically have. They no longer worry about tracks and just align to 1 MB boundaries. Vista and win7 do that.
--- Just looked at my Winbox... I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xf19ce566 Device Boot Start End Blocks Id System /dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT /dev/sda2 206848 1573070847 786432000 7 HPFS/NTFS/exFAT /dev/sda3 1573070848 1707288575 67108864 7 HPFS/NTFS/exFAT ------ I'd have to be in agreeance with you on that point -- with a conditional. The above is a 4 disk SSD-based RAID.... so it wouldn't have any cylinders to align on.
Linux partitioning tools in general got updated a couple years ago to default to MB alignment.
Likely right after my last partitioning. But they don't do the same thing as Windows -- at least not fdisk (not going to try with parted -- it does things in real-time on disk if I remember correctly... owie!)
My favorite tool for listing partition setups is mmls (it only outputs info since it is a reporting only tool). (Install sleuthkit it you want to use mmls).
--- Will have to check it out...
Thus it is clear that whatever default openSUSE partitioner is used during install does 1 MB alignment.
I'm nearly always the type that doesn't choose default. I'm too particular (though many believe there there is no art, only 'e' with the 'i' coming laterl C`est la vie)
The rest of your email I'm going to ignore because it seems to be about how the tools report partitions, not how they create them.
--- Well .. those exact same tools were the ones that created them... fdisk for the smaller stuff, parted for large and gpt partitions... Now this is interesting... my current HD formatted by fdisk..the one that shows: /dev/sdc1 63 25398764 12699351 83 Linux /dev/sdc2 25398765 42009974 8305605 83 Linux /dev/sdc3 * 42009975 44130554 1060290 83 Linux /dev/sdc4 44130555 284687864 120278655 5 Extended /dev/sdc5 44130618 60918479 8393931 82 Linux swap / Solaris /dev/sdc6 60918543 92389814 15735636 83 Linux /dev/sdc7 92389878 113370704 10490413+ 83 Linux /dev/sdc8 115475283 283242014 83883366 83 Linux For the last partitions, I used some random GUI -- dunno which, but I first tried deleting sdc8 and recreating -- it wanted to put the new partition at 113372753 -- 13*19*109*4211 (WT*?) must be a cylinder boundary... well put back /sdc8 the way it was and then tried 'n' again... then it said no more room. then I toggled the dos-compat flag to 'yes', was able to create 3 more partitions .. I re-ordered the partition table to match physical layout (I didn't save this to disk). But now it showed: /dev/sdc1 63 25398764 12699351 83 Linux /dev/sdc2 25398765 42009974 8305605 83 Linux /dev/sdc3 * 42009975 44130554 1060290 83 Linux /dev/sdc4 44130555 284687864 120278655 5 Extended /dev/sdc5 44130618 60918479 8393931 82 Linux swap / Solaris /dev/sdc6 60918543 92389814 15735636 83 Linux /dev/sdc7 92389878 113370704 10490413+ 83 Linux /dev/sdc8 113370768 113372752 992+ 83 Linux /dev/sdc9 113372753 115473234 1050241 83 Linux /dev/sdc10 115473298 115475282 992+ 83 Linux /dev/sdc11 115475283 283242014 83883366 83 Linux /dev/sdc12 283242078 283244062 992+ 83 Linux /dev/sdc13 283244063 284687864 721901 83 Linux ---- 1) when I created a default sector in fdisk, it skipped 992 sectors to create a partition it called 1GiB that it really rounded up by 1665 sectors. 2) next default was #13. at 721901 then it claimed no more space I set dos compat (now marked as deprecated) and I was able to create the 3 partitions 8 10 12 above... So in non-dos compat (default mode), fdisk now looks like it defaults to cylinder alignment. I installed the sleuthtools -- they don't like gpt partitions it seems: --- DOS Partition Table Offset Sector: 0 Units are in 512-byte sectors Slot Start End Length Size Description 00: Meta 0000000000 0000000000 0000000001 0512B Primary Table (#0) 01: ----- 0000000000 0000000000 0000000001 0512B Unallocated 02: 00:03 0000000001 0000000001 0000000001 0512B GPT Safety Partition (0xee) 03: ----- 0000000002 0000000033 0000000032 0016K Unallocated 04: 00:00 0000000034 4294967328 4294967295 0001T Linux (0x83) 05: ----- 4294967329 23435673599 19140706271 0008T Unallocated ---- But look at how it shows that disk above I was exploring with fdisk: DOS Partition Table Offset Sector: 0 Units are in 512-byte sectors Slot Start End Length Size Description 00: Meta 0000000000 0000000000 0000000001 0512B Primary Table (#0) 01: ----- 0000000000 0000000062 0000000063 0031K Unallocated 02: 00:00 0000000063 0025398764 0025398702 0012G Linux (0x83) 03: 00:01 0025398765 0042009974 0016611210 0007G Linux (0x83) 04: 00:02 0042009975 0044130554 0002120580 0001G Linux (0x83) 05: Meta 0044130555 0284687864 0240557310 0114G DOS Extended (0x05) 06: Meta 0044130555 0044130555 0000000001 0512B Extended Table (#1) 07: ----- 0044130555 0044130617 0000000063 0031K Unallocated 08: 01:00 0044130618 0060918479 0016787862 0008G Linux Swap / Solaris x86 (0x82) 09: Meta 0060918480 0092389814 0031471335 0015G DOS Extended (0x05) 10: Meta 0060918480 0060918480 0000000001 0512B Extended Table (#2) 11: ----- 0060918480 0060918542 0000000063 0031K Unallocated 12: 02:00 0060918543 0092389814 0031471272 0015G Linux (0x83) 13: Meta 0092389815 0113370704 0020980890 0010G DOS Extended (0x05) 14: Meta 0092389815 0092389815 0000000001 0512B Extended Table (#3) 15: ----- 0092389815 0092389877 0000000063 0031K Unallocated 16: 03:00 0092389878 0113370704 0020980827 0010G Linux (0x83) 17: ----- 0113370705 0115475282 0002104578 0001G Unallocated 18: Meta 0115475220 0283242014 0167766795 0079G DOS Extended (0x05) 19: Meta 0115475220 0115475220 0000000001 0512B Extended Table (#4) 20: 04:00 0115475283 0283242014 0167766732 0079G Linux (0x83) 21: ----- 0283242015 0284688383 0001446369 0706M Unallocated -------------------- Lots of unallocated 'holes' used to line things up on what appear to be cylinder boundaries... but that's really just a guess... sure ain't based on integer values of MB GB or such...
If you want me to test any particular partitioner, just ask. That 1.5 TB external is a scratch drive. I can use dd to wipe the partition table and then use whatever tiool you want to create new partitions. I don't know which have been updated to default to 1 MB alignment, but I hope most have by now.
----- Well -- the standard one's I use are fdisk and parted... I'd be curious about those whenever... ;-) Though I must say, with parted, it says you can choose 'optimal', which lets the disk tell you where to put things... so maybe the disks are telling SW 1MB? you might try parted w/the different alloc mechanisms -- if you are interested as well, that is... otherwise, I'll find out next time I do partitioning... ;-) Cheers... Linda -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (2)
-
Greg Freemyer
-
Linda Walsh