LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-02-2013, 07:50 PM   #1
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,276

Rep: Reputation: 229Reputation: 229Reputation: 229
Warning! Non-GPT or damaged disk detected!


I use Slackware 14.0 and in the nearest future I’d like to install Slackware 14.1. Before I installed my current system I made the partitions on my hard disk using cfdisk. Today I checked that hard disk with cgdisk and it displayed a bothering message:

cgdisk /dev/sda
Code:
Warning! Non-GPT or damaged disk detected! This program will attempt to
convert to GPT form or repair damage to GPT data structures, but may not
succeed. Use gdisk or another disk repair tool if you have a damaged GPT
disk.

Press any key to continue....
As you see cgdisk offered to convert the disk to GPT. I was afraid that this operation may destroy my data so I broke that program with Ctrl+C.

Then I tested that hard disk with fdisk:

fdisk /dev/sda
Code:
Welcome to fdisk (util-linux 2.21.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.

Command (m for help): p

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: 0x55aa7c45

   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        19535040    58605119    19535040   83  Linux
/dev/sda3        58605120   968558849   454976865   83  Linux
/dev/sda4       968558850   976773167     4107159   82  Linux swap
Partition 4 does not start on physical sector boundary.

Command (m for help): q
This program complained that: “The device presents a logical sector size that is smaller than the physical sector size”. You may see that in the following line:

Code:
Sector size (logical/physical): 512 bytes / 4096 bytes
Finally I tested that hard disk with cfdisk:

cfdisk /dev/sda
Code:
                                    cfdisk (util-linux 2.21.2)

                                       Disk Drive: /dev/sda
                                Size: 500107862016 bytes, 500.1 GB
                       Heads: 255   Sectors per Track: 63   Cylinders: 60801

    Name           Flags         Part Type     FS Type             [Label]            Size (MB)
 -------------------------------------------------------------------------------------------------
    sda1                          Primary      ext4                                    10001.95    
    sda2                          Primary      ext4                                    20003.89
    sda3                          Primary      ext4                                   465896.31
    sda4                          Primary      swap                                     4205.74   *
This last program doesn’t complain at all.

***

For many years I used fdisk to create the partition table. Some day I realized that the partitions made with fdisk aren’t perfect so since that moment I use cfdisk. I do that according to suggestion from the BUGS section from man fdisk:

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. Its single advantage is that it has some support for BSD disk labels and other non-DOS partition tables. Avoid it if you can. sfdisk is for hackers only -- the user interface is terrible, but it is more correct than fdisk and more powerful than both fdisk and cfdisk. Moreover, it can be used noninteractively.)
So I partitioned the discussed here 500 GB hard disk using cfdisk. Now cgdisk and fdisk complain about “Non-GPT or damaged disk detected” and “The device [which] presents a logical sector size that is smaller than the physical sector size”.

***

I found some information concerning the mentioned topic here: Fdisk shows logical sector size smaller than physical sector size after clonezilla.

Here’s the next output for my hard disk made by fdisk:

fdisk -lu /dev/sda
[EDIT]
(Removed the output because it was the same as the previous one).
[/EDIT]

***

My question is: Which program should I use when I’ll decide to repartition my hard disk before the next installation of the system – is cgdisk the right tool for that purpose?

(I found a nice cgdisk tutorial here: A cgdisk Walkthrough).

Last edited by w1k0; 12-02-2013 at 08:06 PM.
 
Old 12-02-2013, 11:29 PM   #2
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,860
Blog Entries: 36

Rep: Reputation: 459Reputation: 459Reputation: 459Reputation: 459Reputation: 459
Personally, I use parted. Their docs say partition creation is experimental but that has been the disclaimer for years and I haven't encountered an issue with it yet. Generally I use it to partition and then use the mkfs tools to create the filesystems.
 
1 members found this post helpful.
Old 12-03-2013, 12:09 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,362

Rep: Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001
cgdisk is for GPT partitioned disks only. If you don't want to change your disk to GPT partitioning, don't use it.

Any recent version of fdisk will default to working with sector (as opposed to cylinder) units and create partitions with 1-MiB alignment (2048 512-byte sectors), which should be satisfactory for today's hard disks and SSDs. That message about logical/physical sector sizes and alignment is just informative. The messages that indicate a problem are the ones that say, "Partition {n} does not start on physical sector boundary."

I regard cfdisk's lack of complaint about your current partition alignment as a very serious flaw. Partitions that are not aligned to physical sector boundaries will degrade your write performance by a factor of 10 or more.
 
1 members found this post helpful.
Old 12-03-2013, 02:30 PM   #4
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,276

Original Poster
Rep: Reputation: 229Reputation: 229Reputation: 229
So I could try parted or come back to fdisk. I will compare the results produced by both these programs and then decide which one is better for me. Thank you guys!
 
  


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
can't get rid of GPT disk label rbdavis Linux - General 16 02-05-2017 06:24 AM
Is my hard disk damaged ? chrischristian Linux - Newbie 7 02-01-2009 09:23 AM
Can't mount disk--could be damaged? grittyminder Linux - Hardware 17 08-11-2007 12:00 AM
hard disk damaged aral Linux - Hardware 1 10-19-2006 07:02 PM
Boot Disk Damaged xm0b31 Linux - Newbie 3 05-04-2004 10:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:30 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration