LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-24-2012, 10:58 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
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?


kernel 3.2.29, slackware 14.0
 
Old 12-24-2012, 11:14 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
Quote:
Originally Posted by stf92 View Post
Code:
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).
 
Old 12-24-2012, 01:25 PM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
How do I do to make the partition start at 4k sector boundaries? Has cfdisk/fdisk any option to do that?
 
Old 12-25-2012, 08:40 PM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
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.
 
Old 12-27-2012, 08:41 PM   #5
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Quote:
Originally Posted by stf92 View Post
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'?

Last edited by stf92; 12-27-2012 at 08:57 PM.
 
Old 12-27-2012, 09:25 PM   #6
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
Quote:
Originally Posted by stf92 View Post
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 View Post
(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 View Post
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.
 
Old 12-27-2012, 09:41 PM   #7
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
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.

Last edited by stf92; 12-27-2012 at 09:55 PM.
 
Old 12-27-2012, 09:48 PM   #8
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
Quote:
Originally Posted by stf92 View Post
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.
 
Old 12-27-2012, 10:05 PM   #9
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
The fdisk man page says

Code:
      -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.

EDIT: sorry, you posted as I was writing.

Last edited by stf92; 12-27-2012 at 10:08 PM.
 
Old 03-03-2013, 02:24 PM   #10
jasmines
LQ Newbie
 
Registered: Mar 2013
Posts: 2

Rep: Reputation: Disabled
http://askubuntu.com/q/156994/32230
 
Old 03-03-2013, 05:46 PM   #11
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Hopefully the OP has fixed his issue some time in the past 2 months.
 
Old 03-04-2013, 08:47 AM   #12
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Partition does not start on physical sector boundary czezz Slackware 19 02-06-2013 02:39 AM
freebsd fdisk warning 'chunk ... does not start on a track boundary' vonbiber *BSD 4 11-27-2011 12:54 PM
WD20EARS - smartctl is reporting 4K physical sector size ^^ Orangutanklaus Linux - Hardware 3 09-19-2011 09:36 AM
Should a bootable partition start from sector 1 on a hard disk? citizen22445 Linux - Newbie 2 12-20-2010 06:36 PM
fdisk -ul why does first partition start at sector 63? nickamon Linux - Newbie 3 07-17-2009 04:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration