[SOLVED] fdisk: Partition 2 does not start on physical sector boundary.
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
fdisk: Partition 2 does not start on physical sector boundary.
Hi:
I have just installed slackware 14.0 (32 bits). When I run fdisk I get the following:
Code:
root@darkstar:~# fdisk -l /dev/sda
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x4cf30742
Device Boot Start End Blocks Id System
/dev/sda1 * 63 40965749 20482843+ 7 HPFS/NTFS/exFAT
Partition 1 does not start on physical sector boundary.
/dev/sda2 40965750 80035829 19535040 83 Linux
Partition 2 does not start on physical sector boundary.
/dev/sda3 80035830 97610939 8787555 82 Linux swap
Partition 3 does not start on physical sector boundary.
/dev/sda4 97610940 976773167 439581114 7 HPFS/NTFS/exFAT
Partition 4 does not start on physical sector boundary.
root@darkstar:~#
However, everything seems to be running correctly. What can be the cause of that weird message? I partitioned the disk with cfdisk. I've have read other posts in LQ and google on this issue but haven't been able to get a clear picture of the nature of this problem.
I'll be replacing the 32-bit version of 14.0 by the 64-bit one in a few days. So, what options could I give cfdisk to avoid this problem?
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
Your hard drive has a physical sector size of 4096 bytes, but for compatibility reasons, it reports a logical sector size of 512 bytes.
If your partitions don't start at 4k sector boundaries, write performance will suffer. You could repartition and reinstall, but if you're dual-booting between Windows and Linux (I noticed your first primary partition is NTFS), make sure your Windows version can handle a boot partition that starts somewhere other than at sector 63 (XP can't).
Newer versions of fdisk have a setting called "DOS Compatibility Flag", and if not set, the 1st partition starts at sector 2048. 2048 is divisible by 8 and thus aligned to a 4k sector boundary (if the drive has 4k physical sectors but reports 512 byte logical sectors). I think you still need to make sure other partitions start at a 4k boundary.
A quick Google search revealed that parted has an --align optimal parameter that supposedly aligns partitions on "advanced format" drives. As for other partitioning tools, I'm afraid I don't know.
Hi:
I have just installed slackware 14.0 (32 bits). When I run fdisk I get the following:
Code:
root@darkstar:~# fdisk -l /dev/sda
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x4cf30742
Device Boot Start End Blocks Id System
/dev/sda1 * 63 40965749 20482843+ 7 HPFS/NTFS/exFAT
Partition 1 does not start on physical sector boundary.
/dev/sda2 40965750 80035829 19535040 83 Linux
Partition 2 does not start on physical sector boundary.
/dev/sda3 80035830 97610939 8787555 82 Linux swap
Partition 3 does not start on physical sector boundary.
/dev/sda4 97610940 976773167 439581114 7 HPFS/NTFS/exFAT
Partition 4 does not start on physical sector boundary.
root@darkstar:~#
I have two questions:
(a) I know partition 1 is 20GB long. Therefore, 'start' and 'end' are given in 512-byte sectors (logical sectors). From this, the quantity under 'blocks' is given in 1024-byte units. I.e., 1 block = 1024 bytes. Am I right? (Although the man page says that sizes are shown in sectors by default, it does not say what size a block is.)
(b) How are logical sectors counted? Is the first sector on a track sector 0? In DOS sectors were counted from 1. If first sector = sector 0 it makes sense, for then partition 1 starts at the beginning of a track, because 1 track = 63 sectors.
EDIT: One other question. Partition 1 starts at sector 63 and 64 * 512 = 32768. Therefore the partition 1 starts at a 4K boundary because 32768 is divisible by 4098! What is the problem then? Why does fdisk report 'Partition does not start at pphysical sector boundary'?
I have two questions:
(a) I know partition 1 is 20GB long. Therefore, 'start' and 'end' are given in 512-byte sectors (logical sectors). From this, the quantity under 'blocks' is given in 1024-byte units. I.e., 1 block = 1024 bytes. Am I right? (Although the man page says that sizes are shown in sectors by default, it does not say what size a block is.)
Yes, that is correct.
Quote:
Originally Posted by stf92
(b) How are logical sectors counted? Is the first sector on a track sector 0? In DOS sectors were counted from 1. If first sector = sector 0 it makes sense, for then partition 1 starts at the beginning of a track, because 1 track = 63 sectors.
The first sector is sector 0. The concept of "tracks" or "cylinders" are no longer used. Instead, LBA addressing simply counts sectors from the start of the disk.
Quote:
Originally Posted by stf92
EDIT: One other question. Partition 1 starts at sector 63 and 64 * 512 = 32768. Therefore the partition 1 starts at a 4K boundary because 32768 is divisible by 4098! What is the problem then? Why does fdisk report 'Partition does not start at pphysical sector boundary'?
Since the first sector is sector 0 and each sector is 512 bytes (0.5 kb), logical sectors 0, 8, 24, 32 etc. represent the start of a 4k physical sector.
Sector 63 is the 64th logical sector on the drive, and the last logical sector (out of 8) of the 8th physical 4k sector. So no, a partition starting at logical sector 63 does not start at a physical sector boundary.
I understand. However, sector 63 is the first sector of the second track, and it makes sense that a partition starts at the beginning of a track! But you're right. 63 * 512 is not divisible by 4096.
However I understand the division into secs, heads, cylinders has no meaning for modern disks. Otherwise, it would be odd that a disk has 63 secs per track instead of a power of 2.
I understand. However, sector 63 is the first sector of the second track, and it makes sense that a partition starts at the beginning of a track!
Except it doesn't really start at the beginning of a track.
It's been years (if not decades) since the "track" number represented an actual, physical track on the disk. Modern drives have very few platters/heads and a godawful number of tracks with a variable numbers of sectors on each track.
The Cylinder-Head-Sector (CHS) numbering scheme assumes a fixed number of sectors on each track and no more than 63, so the a modern drive compensates by reporting fewer tracks with fewer sectors and a ridiculous number of heads.
-c[=mode]
Specify the compatiblity mode, 'dos' or 'nondos'. The default
is non-DOS mode. For backward compatibility, it is possible to
use the option without the <mode> argument -- then the default
is used. Note that the optional <mode> argument cannot be sepa-
rated from the -c option by a space, the correct form is for
example '-c=dos'.
which is, I think, the compatibility flag you referred to in post #4. Cfdisk, instead has this command:
Code:
m Maximize disk usage of the current partition. This command will
recover the unused space between the partition table and the
beginning of the partition, but at the cost of making the parti-
tion incompatible with DOS, OS/2 and possibly other operating
systems. This option will toggle between maximal disk usage and
DOS, OS/2, etc. compatible disk usage. The default when creat-
ing a partition is to create DOS, OS/2, etc. compatible parti-
tions.
If the fdisk -c option does the same as cfdisk m command, then using fdisk with the -c=nondos option wouldn't do.
On the other hand, fdisk man page recommends using cfdisk instead of fdisk. There are two other programs in slackware 14, sfdisk and parted. Perhaps one of these could solve my problem.
I'm afraid, although the problem is now solved, I did not documented the procedure I followed, and if I did it, I do not find the file or papers. However, I do remember I finally used the parted command to partition and, if everything turns about the new 4096-byte sector size, I do not think I'll have a problem when faced with the task of partitioning an advanced format drive again. Thanks.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.