LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 09-11-2012, 06:54 AM   #1
czezz
Member
 
Registered: Nov 2004
Location: Poland/Warsaw
Distribution: Slackware/Solaris
Posts: 563

Rep: Reputation: 30
Partition does not start on physical sector boundary


I have installed Slackware 14 RC2.
I have used regular procedure and on the beginning created partition with fdisk, then installed system.

After system was up and running I have noticed that fdisk shows me some problem with just created partitions:
Code:
# 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: 0x1a0c9604

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    19535039     9767488+  83  Linux
Partition 1 does not start on physical sector boundary.
/dev/sda2       968772798   976773167     4000185   82  Linux swap
Partition 2 does not start on physical sector boundary.
/dev/sda3        19535040   968772797   474618879   83  Linux
As far as I can see it is because of this:
Code:
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
My questions:
1. How can I correct it now ? (I have remote access with SSH only).
2. Why the heck fdisk set sectore size like this ? I have never before had to pay attention for that. (I was just using defaults).


Please note:
/dev/sda3 was created later; Not during OS installation process.

Last edited by czezz; 09-11-2012 at 06:55 AM.
 
Old 09-11-2012, 07:26 AM   #2
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,544

Rep: Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229Reputation: 1229
I do not think you need to do anything. Probably it is not nice or surprising, but it is still ok.
 
Old 09-11-2012, 08:22 AM   #3
Fred-1.2.13
Member
 
Registered: Jan 2006
Location: Midwest USA
Distribution: Started with Slackware - 3.0 1995 Kernel 1.2.13 - Currently Slackware 14.1
Posts: 59

Rep: Reputation: 7
Seems to be a fairly common problem.

Google for this: linux partition 1 does not start on physical sector boundary

You will get many results! Good luck!

Last edited by Fred-1.2.13; 09-11-2012 at 08:24 AM.
 
Old 09-11-2012, 03:50 PM   #4
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,240

Rep: Reputation: 196Reputation: 196
In the BUGS section of man fdisk you can read the following information:

Quote:
There are several *fdisk programs around. Each has its problems and strengths. Try them in the order cfdisk, fdisk, sfdisk. (Indeed, cfdisk is a beautiful program that has strict requirements on the partition tables it accepts, and produces high quality partition tables. Use it if you can. fdisk is a buggy program that does fuzzy things - usually it happens to produce reasonable results.
So fdisk authors advise to use cfdisk rather than fdisk.

Now you installed the system so you canít redefine the partition boundaries. The next time youíll decide to install the system prepare the partition table using cfdisk.
 
1 members found this post helpful.
Old 09-11-2012, 04:12 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,438
Blog Entries: 2

Rep: Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001
Quote:
Originally Posted by pan64 View Post
I do not think you need to do anything. Probably it is not nice or surprising, but it is still ok.
As fdisk shows, the OP has a disk with 4k physical sectors. Unaligned partitions will cause a major performance impact on these partitions (the same is true for partitions on SSDs). So it is not OK.
What surprises me is that newer fdisk versions shouldn't create the first partition at sector 63 by default, as it happened to you, for exactly this reason, the first partition should have been created at sector 2048.
I would recommend to delete those partitions and re-install the OS, this time using cfdisk instead. Have a look at partition alignment before starting the installation of the OS.
 
Old 09-11-2012, 04:49 PM   #6
gazj
Member
 
Registered: Oct 2010
Location: Cambs, England, UK
Distribution: Slackware 14
Posts: 32

Rep: Reputation: 6
Dang it, my 2tb home drive is partitioned like this :S This is going to take some serious time to backup repartition and restore!
 
Old 09-11-2012, 05:02 PM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,438
Blog Entries: 2

Rep: Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001
Quote:
Originally Posted by gazj View Post
Dang it, my 2tb home drive is partitioned like this :S This is going to take some serious time to backup repartition and restore!
Before doing that action make sure that you really have a disk with 4k physical sectors. On disks with 512 byte sectors this type of partitioning is OK.
 
Old 09-11-2012, 05:24 PM   #8
gazj
Member
 
Registered: Oct 2010
Location: Cambs, England, UK
Distribution: Slackware 14
Posts: 32

Rep: Reputation: 6
Well this is what I get, so I guess I need to sort it out?

Code:
gary@Slacker ~ $ sudo /sbin/fdisk -l /dev/sdb

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 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: 0x0007ad01

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63  3907024064  1953512001   83  Linux
Partition 1 does not start on physical sector boundary.
 
Old 09-11-2012, 05:57 PM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,438
Blog Entries: 2

Rep: Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001
Seems so. Which OS/version/tool did you use to partition that disk?
 
Old 09-11-2012, 06:55 PM   #10
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 13.37
Posts: 535

Rep: Reputation: 36
Quote:
Originally Posted by TobiSGD View Post
the first partition should have been created at sector 2048.
Why 2048. Isn't any sector, divisible by 8 sufficient, like 64.

Cheers.
 
Old 09-11-2012, 07:01 PM   #11
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,438
Blog Entries: 2

Rep: Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001
The problem with a start sector at 63 comes up with the 4K drives, but SSDs also have the same problem, only with different sector sizes (usually between 128K and 512K). To have some room for future devices the developers came up with 2048 logical sectors, which resemble 1M physical sectors.

Last edited by TobiSGD; 09-11-2012 at 07:02 PM.
 
Old 09-11-2012, 10:20 PM   #12
jtsn
Member
 
Registered: Sep 2011
Location: Europe
Distribution: Slackware
Posts: 803

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
SSDs have the same 4K physical sectors as HDDs. The 1M alignment is due to the erase-block size of simpler flash media (like SD cards and USB flash drives) and doesn't affect SSDs, which use a 4K-sector-based wear-leveling.
 
Old 09-12-2012, 01:51 AM   #13
gazj
Member
 
Registered: Oct 2010
Location: Cambs, England, UK
Distribution: Slackware 14
Posts: 32

Rep: Reputation: 6
Quote:
Originally Posted by TobiSGD View Post
Seems so. Which OS/version/tool did you use to partition that disk?
Hmm, no telling I have had this home partition around for sometime. It could of been Slackware, Arch or maybe even Gentoo. I tend to us cfdisk of fdisk however. But that is not even a certainty. Sorry that doesn't really help much does it?
 
Old 09-12-2012, 03:16 AM   #14
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,438
Blog Entries: 2

Rep: Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001Reputation: 4001
Quote:
Originally Posted by jtsn View Post
SSDs have the same 4K physical sectors as HDDs. The 1M alignment is due to the erase-block size of simpler flash media (like SD cards and USB flash drives) and doesn't affect SSDs, which use a 4K-sector-based wear-leveling.
OK, I shouldn't have said physical sector size, but flash block erase boundaries. Those are usually between 128K-512K and are those that have the performance impact when writing to the SSD. Partitions should be aligned to this erase boundaries and since 1M is a multiple of the usual sizes 2048 logical sectors is a save bet to start with.
 
Old 09-12-2012, 03:34 PM   #15
Martinus2u
Member
 
Registered: Apr 2010
Distribution: Slackware
Posts: 343

Rep: Reputation: 56
Quote:
Originally Posted by TobiSGD View Post
since 1M is a multiple of the usual sizes 2048 logical sectors is a save bet to start with.
another reason may be compatibility with a commercial operating system by a vendor based in Redmond.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
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
need partition to end on cylinder boundary Master of Reality Linux - General 5 02-03-2006 09:51 PM
Partition does not end on cylinder boundary. snisheeth Linux - Hardware 0 01-24-2004 04:49 PM


All times are GMT -5. The time now is 11:36 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration