LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 10-07-2012, 05:22 PM   #1
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 106

Rep: Reputation: 17
Running fdisk -l misidentifies my hard disks as GPT


I have three 2 TB hard disks, with various Linux and Windows partitions on them in a multi-boot system.

When I run fdisk -l, on any one of the Linux distros I have installed, it always starts off its display of the partitions on my three hard drives with the message:

WARNING: GPT (GUID Partition Table) detected on '/dev/sd(a|b|c)'! The util fdisk doesn't support GPT. Use GNU Parted.

and then shows the partitions correctly. But all my hard disks are MBR, not GPT.

Does anybody know why fdisk misidentifies the hard disks as GPT partitioning as opposed to MBR partitioning, which they are ?

Before you tell me to run gparted or KDE partition manager, I had a recent experience where running gparted on one of my Linux OSs, without changing anything, wiped out the partition table of my second and third hard disks and set them to GPT disks, so I am loath to do that anymore. This may have been a bug in an older version of gparted.

The partition managers, Minitools, EaseUS, Acronis DD11, and Clonezilla all show my hard disks correctly as MBR when I boot from their live disks.
 
Old 10-07-2012, 05:55 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
For clarity, could you please post the full output of:

Code:
parted -l
followed by,
Code:
fdisk -l
 
Old 10-13-2012, 05:17 PM   #3
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 106

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by andrewthomas View Post
For clarity, could you please post the full output of:

Code:
parted -l
followed by,
Code:
fdisk -l
I am running a number of different Linux distros. In most of them 'parted -l' gives an error saying that my second and third disks ( sdb and sdc ) "contains GPT signatures, indicating that it has a GPT table." But in the latest version of 'parted' in Fedora 17, it correctly reads sdb and sdc as MBR disks.

Rather than give you 'parted -l' output for all 5 Linux distros I run, I will concentrate on Suse 11.4 and Fedora 17. Here is the output for 'parted' on each.

Code:
_________

Suse 11.4
_________

parted -v

parted (GNU parted) 2.3

Model: ATA Hitachi HDS72302 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      32.3kB  240GB   240GB   primary   ntfs         hidden, type=17
 2      240GB   593GB   353GB   primary   ntfs         boot, hidden, type=17
 3      593GB   599GB   5355MB  extended               type=05
 5      593GB   595GB   1077MB  logical   ext3         type=83
 6      595GB   596GB   1053MB  logical   ext3         type=bb
 7      596GB   597GB   1077MB  logical   ext3         type=bb
 8      597GB   598GB   1077MB  logical   ext3         type=bb
 9      598GB   599GB   1069MB  logical   ext3         type=bb
 4      1999GB  2000GB  1160MB  primary   fat32        hidden, lba, type=1c


Warning: /dev/sdb contains GPT signatures, indicating that it has a GPT table.
However, it does not have a valid fake msdos partition table, as it should.
Perhaps it was corrupted -- possibly by a program that doesn't understand GPT
partition tables.  Or perhaps you deleted the GPT table, and are now using an
msdos partition table.  Is this a GPT partition table?
Yes/No? No                                                                
Sector size (logical/physical): 512B/4096B

Warning: /dev/sdc contains GPT signatures, indicating that it has a GPT table.  However, it does not have a valid fake msdos partition table, as it should.  Perhaps it was
corrupted -- possibly by a program that doesn't understand GPT partition tables.  Or perhaps you deleted the GPT table, and are now using an msdos partition table.  Is this a GPT
partition table?
Yes/No? No                                                                
Sector size (logical/physical): 512B/512B

Warning: Unable to open /dev/fd0 read-write (Read-only file system).  /dev/fd0 has been opened read-only.
Error: /dev/fd0: unrecognised disk label                                  
Sector size (logical/physical): 512B/512B
Code:
_________

Fedora 17
_________

parted -v

parted (GNU parted) 3.0

parted -l

Model: ATA Hitachi HDS72302 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system  Flags
 1      32.3kB  240GB   240GB   primary   ntfs         hidden
 2      240GB   593GB   353GB   primary   ntfs         boot, hidden
 3      593GB   599GB   5355MB  extended
 5      593GB   595GB   1077MB  logical   ext3
 6      595GB   596GB   1053MB  logical   ext3
 7      596GB   597GB   1077MB  logical   ext3
 8      597GB   598GB   1077MB  logical   ext3
 9      598GB   599GB   1069MB  logical   ext3
 4      1999GB  2000GB  1160MB  primary   fat32        hidden, lba


Model: ATA WDC WD20EARX-00P (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system     Flags
 1      8225kB  545GB   545GB   extended                  lba
 5      8258kB  53.7GB  53.7GB  logical   ext4
 6      53.7GB  107GB   53.7GB  logical   ext3
 7      107GB   161GB   53.7GB  logical   ext4
 8      161GB   215GB   53.7GB  logical   ext3
 9      215GB   268GB   53.7GB  logical   ext4
10      268GB   321GB   52.4GB  logical   ext3
11      321GB   373GB   52.4GB  logical   ext4
12      373GB   426GB   52.4GB  logical   ext3
13      426GB   485GB   59.6GB  logical   ext3
14      485GB   540GB   55.1GB  logical
15      540GB   545GB   4187MB  logical   linux-swap(v1)
 2      1782GB  2000GB  219GB   primary   ntfs            boot, hidden


Model: ATA ST2000DL003-9VT1 (scsi)
Disk /dev/sdc: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system  Flags
 1      8225kB  106GB   106GB   extended               boot
 5      8258kB  52.5GB  52.5GB  logical   ext4
 6      52.5GB  106GB   53.7GB  logical   ext4
As far as fdisk is concerned it always gives a "WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted" on all my distros but then goes on to show the partition tables for all 3 disks as MBR. Again I will give just the outputs for Suse 11.4 and Fedora 17.

Code:
_________

Suse 11.4
_________

fdisk -v

fdisk (util-linux 2.19)

fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 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 / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000001

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63   469274714   234637326   17  Hidden HPFS/NTFS
/dev/sda2   *   469274715  1159025489   344875387+  17  Hidden HPFS/NTFS
/dev/sda3      1159041555  1169499869     5229157+   5  Extended
/dev/sda4      3904758900  3907024064     1132582+  1c  Hidden W95 FAT32 (LBA)
/dev/sda5      1159041618  1161146069     1052226   83  Linux
/dev/sda6      1161146133  1163202389     1028128+  bb  Boot Wizard hidden
/dev/sda7      1163202453  1165306904     1052226   bb  Boot Wizard hidden
/dev/sda8      1165306968  1167411419     1052226   bb  Boot Wizard hidden
/dev/sda9      1167411483  1169499869     1044193+  bb  Boot Wizard hidden

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


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

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1           16065  1063711844   531847890    f  W95 Ext'd (LBA)
Partition 1 does not start on physical sector boundary.
/dev/sdb2   *  3479646870  3907024064   213688597+  17  Hidden HPFS/NTFS
Partition 2 does not start on physical sector boundary.
/dev/sdb5           16128   104872319    52428096   83  Linux                                                                            
/dev/sdb6       104872383   209728574    52428096   bb  Boot Wizard hidden                                                               
Partition 6 does not start on physical sector boundary.                                                                                  
/dev/sdb7       209728638   314584829    52428096   bb  Boot Wizard hidden                                                               
Partition 7 does not start on physical sector boundary.                                                                                  
/dev/sdb8       314584893   419441084    52428096   bb  Boot Wizard hidden                                                               
Partition 8 does not start on physical sector boundary.                                                                                  
/dev/sdb9       419441148   524297339    52428096   83  Linux
Partition 9 does not start on physical sector boundary.                                                                                                                             
/dev/sdb10      524297403   626695649    51199123+  bb  Boot Wizard hidden                                                                                                          
Partition 10 does not start on physical sector boundary.                                                                                                                            
/dev/sdb11      626695713   729110024    51207156   bb  Boot Wizard hidden                                                                                                          
Partition 11 does not start on physical sector boundary.                                                                                                                            
/dev/sdb12      729110088   831508334    51199123+  bb  Boot Wizard hidden                                                                                                          
/dev/sdb13      831508398   947851064    58171333+  83  Linux                                                                                                                       
Partition 13 does not start on physical sector boundary.                                                                                                                            
/dev/sdb14      947851128  1055534759    53841816    b  W95 FAT32                                                                                                                   
/dev/sdb15     1055534823  1063711844     4088511   82  Linux swap / Solaris                                                                                                        
Partition 15 does not start on physical sector boundary.                                                                                                                            
                                                                                                                                                                                    
WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.                                                                     


Disk /dev/sdc: 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 / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1aeffb21

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *       16065   207302759   103643347+   5  Extended
/dev/sdc5           16128   102494699    51239286   bb  Boot Wizard hidden
/dev/sdc6       102494763   207302759    52403998+  bb  Boot Wizard hidden
Code:
_________

Fedora 17
_________

fdisk -v

fdisk (util-linux 2.21.2)

fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 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 / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000001

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63   469274714   234637326   17  Hidden HPFS/NTFS
/dev/sda2   *   469274715  1159025489   344875387+  17  Hidden HPFS/NTFS
/dev/sda3      1159041555  1169499869     5229157+   5  Extended
/dev/sda4      3904758900  3907024064     1132582+  1c  Hidden W95 FAT32 (LBA)
/dev/sda5      1159041618  1161146069     1052226   bb  Boot Wizard hidden
/dev/sda6      1161146133  1163202389     1028128+  bb  Boot Wizard hidden
/dev/sda7      1163202453  1165306904     1052226   83  Linux
/dev/sda8      1165306968  1167411419     1052226   bb  Boot Wizard hidden
/dev/sda9      1167411483  1169499869     1044193+  bb  Boot Wizard hidden

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


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

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1           16065  1063711844   531847890    f  W95 Ext'd (LBA)
Partition 1 does not start on physical sector boundary.
/dev/sdb2   *  3479646870  3907024064   213688597+  17  Hidden HPFS/NTFS
Partition 2 does not start on physical sector boundary.
/dev/sdb5           16128   104872319    52428096   bb  Boot Wizard hidden
/dev/sdb6       104872383   209728574    52428096   bb  Boot Wizard hidden
Partition 6 does not start on physical sector boundary.
/dev/sdb7       209728638   314584829    52428096   83  Linux
Partition 7 does not start on physical sector boundary.
/dev/sdb8       314584893   419441084    52428096   bb  Boot Wizard hidden
Partition 8 does not start on physical sector boundary.
/dev/sdb9       419441148   524297339    52428096   bb  Boot Wizard hidden
Partition 9 does not start on physical sector boundary.
/dev/sdb10      524297403   626695649    51199123+  bb  Boot Wizard hidden
Partition 10 does not start on physical sector boundary.
/dev/sdb11      626695713   729110024    51207156   83  Linux
Partition 11 does not start on physical sector boundary.
/dev/sdb12      729110088   831508334    51199123+  bb  Boot Wizard hidden
/dev/sdb13      831508398   947851064    58171333+  83  Linux
Partition 13 does not start on physical sector boundary.
/dev/sdb14      947851128  1055534759    53841816    b  W95 FAT32
/dev/sdb15     1055534823  1063711844     4088511   82  Linux swap / Solaris
Partition 15 does not start on physical sector boundary.

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdc: 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 / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1aeffb21

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *       16065   207302759   103643347+   5  Extended
/dev/sdc5           16128   102494699    51239286   bb  Boot Wizard hidden
/dev/sdc6       102494763   207302759    52403998+  bb  Boot Wizard hidden
I also run Mandriva 2010/2, CentOS 5.8, and CentOS 6.3 but basically there outputs are similar to Suse 11.4 in claiming that my MBR disks are GPT.
 
Old 10-13-2012, 07:37 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,781

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
It appears that those disks were at one time partitioned with GPT and then someone used a non-GPT partitioning tool to delete the type EE partition that was in the conventional MBR and then define new partitions, all without overwriting the GPT that begins at LBA 1. You can confirm that by running
Code:
dd if=/dev/sdb skip=1 count=1 | hexdump -C
and looking for the words "EFI PART" at the beginning of the dump.

Since you're not using that GPT, you can zero it out with
Code:
dd if=/dev/zero count=1 seek=1 of=/dev/sdb
but please be very careful that you've typed that command correctly and don't do it unless you saw that "EFI PART" signature. Now fdisk will no longer complain about seeing a GPT header.

Last edited by rknichols; 10-13-2012 at 07:38 PM.
 
Old 10-13-2012, 10:52 PM   #5
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 106

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by rknichols View Post
It appears that those disks were at one time partitioned with GPT and then someone used a non-GPT partitioning tool to delete the type EE partition that was in the conventional MBR and then define new partitions, all without overwriting the GPT that begins at LBA 1. You can confirm that by running
Code:
dd if=/dev/sdb skip=1 count=1 | hexdump -C
and looking for the words "EFI PART" at the beginning of the dump.

Since you're not using that GPT, you can zero it out with
Code:
dd if=/dev/zero count=1 seek=1 of=/dev/sdb
but please be very careful that you've typed that command correctly and don't do it unless you saw that "EFI PART" signature. Now fdisk will no longer complain about seeing a GPT header.
Bravo ! Your suppositions were correct about the "EFI PART" for sdb and sdc. After using your command to zero out the 512 bytes of LBA 1, 'parted -l' now understands my disks to all be MBR disks.

It is amusing that 'fdisk' still thinks the disks are GPT, even though it displays all the information for them. But that is less worrisome since I believe 'fdisk' has been superceded by 'parted' on nearly all modern Linux systems.

Thanks very much for your help in straightening out this problem.
 
Old 10-14-2012, 08:57 AM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,781

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by eldiener View Post
It is amusing that 'fdisk' still thinks the disks are GPT, even though it displays all the information for them.
There is a backup GPT header in the very last LBA on the disk (num_sectors - 1). I just looked at the source, and fdisk also probes for that. To keep everything happy you should zero out that one too.
 
Old 10-14-2012, 06:39 PM   #7
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 106

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by rknichols View Post
There is a backup GPT header in the very last LBA on the disk (num_sectors - 1). I just looked at the source, and fdisk also probes for that. To keep everything happy you should zero out that one too.
I can see the GPT signature on the last sector on all 3 of my hard drives. Is it guaranteed for an MBR drive that this last sector can not be used as part of a partition ?
 
Old 10-14-2012, 08:51 PM   #8
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,781

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by eldiener View Post
I can see the GPT signature on the last sector on all 3 of my hard drives. Is it guaranteed for an MBR drive that this last sector can not be used as part of a partition ?
No, it certainly could be included in a partition, but if the disk is partitioned using "cylinder" units, then there is usually some unused space at the end since the space on the drive usually isn't an integral number of those fictitious cylinders. When partitioned using "sector" units, then that last sector would certainly be used unless some space were deliberately left unallocated.

Personally, I wouldn't hesitate to zero out a leftover GPT header that I found there.
 
Old 10-14-2012, 10:57 PM   #9
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 106

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by rknichols View Post
No, it certainly could be included in a partition, but if the disk is partitioned using "cylinder" units, then there is usually some unused space at the end since the space on the drive usually isn't an integral number of those fictitious cylinders. When partitioned using "sector" units, then that last sector would certainly be used unless some space were deliberately left unallocated.

Personally, I wouldn't hesitate to zero out a leftover GPT header that I found there.
I checked where the last partition ended on my drives and none of them ended at the last sector. So I zeroed out the last sector and now 'fdisk' correctly sees the hard diska as MBR.

I do see two more anomalies:

1) The partition type of the extended partition on one of my hard drives is 0xf rather than 0x5. This does not seem to matter much, but I could not tell from my investigation of partition types if I will be adversely affected by it.

2) On one of my hard drives, the actual physical sector size is 4096, or 8 logical 512 byte sectors. On that drive fdisk reports that a number of partitions do not start at a physical sectory boundary.
 
Old 10-15-2012, 08:33 AM   #10
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,781

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by eldiener View Post
1) The partition type of the extended partition on one of my hard drives is 0xf rather than 0x5. This does not seem to matter much, but I could not tell from my investigation of partition types if I will be adversely affected by it.
Shouldn't be a problem. Type 0xf ("W95 Extended LBA") vs. 0x5 ("Extended") won't make any difference to Linux. fdisk will allow you to change the type to 5 (or 85 "Linux extended") if you want to.
Quote:
Originally Posted by eldiener View Post
2) On one of my hard drives, the actual physical sector size is 4096, or 8 logical 512 byte sectors. On that drive fdisk reports that a number of partitions do not start at a physical sectory boundary.
I wasn't aware that fdisk checked for that. Are you sure it wasn't complaining about cylinder boundary? Partitions that don't begin/end on cylinder boundaries are normal and pretty much necessary on drives with 4KB sector size (the default cylinder size is not a multiple of that sector size), but partitions that aren't aligned on physical sector boundaries are going to have a severe impact on write performance (possibly a factor of 10) and should be corrected.
 
Old 10-15-2012, 07:10 PM   #11
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 106

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by rknichols View Post
Shouldn't be a problem. Type 0xf ("W95 Extended LBA") vs. 0x5 ("Extended") won't make any difference to Linux. fdisk will allow you to change the type to 5 (or 85 "Linux extended") if you want to.
I wasn't aware that fdisk checked for that. Are you sure it wasn't complaining about cylinder boundary? Partitions that don't begin/end on cylinder boundaries are normal and pretty much necessary on drives with 4KB sector size (the default cylinder size is not a multiple of that sector size), but partitions that aren't aligned on physical sector boundaries are going to have a severe impact on write performance (possibly a factor of 10) and should be corrected.
Good to know there is no difference in Linux between the extended partition types of 0x5 and 0xf.

fdisk says "Partition n(1,2,etc.) does not start on physical sector boundary."

I will look for a program that can move the partitions on physical sector boundaries without destroying the data in them. But first I will back up everything on the drive where this occurs, before I try to maneuver the boundaries.
 
Old 10-15-2012, 07:28 PM   #12
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,781

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by eldiener View Post
I will look for a program that can move the partitions on physical sector boundaries without destroying the data in them. But first I will back up everything on the drive where this occurs, before I try to maneuver the boundaries.
Good luck on that. I doubt you'll find a tool that will attempt something as dangerous as an overlapping move of a partition, but do post back if you should find one.
 
Old 10-15-2012, 10:21 PM   #13
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 106

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by rknichols View Post
Good luck on that. I doubt you'll find a tool that will attempt something as dangerous as an overlapping move of a partition, but do post back if you should find one.
I don't want to do an overlapping move of a partition. I just want to be able to move one partiton at a time from the beginning to the left or from the end to the right so that each partition starts on a physical sector boundary. I will try Clonezilla live, or GParted live, or Parted Magic live to see which one allows me to specify the exact starting logical sector to move a partition to, while preserving the data in the partition, and updating the partition's table accordingly. I could probably do this with 'dd' if I could work out exactly how to update the partition tables and extended partition tables, but I have to think one of the partitioning tools I mention above will do the trick for me. I could, of course, now that I have backed up all partitions to my external drives, also delete all partitions from the drive and recopy each backed up partition to a correct area starting on a physical sectory boundary.

Last edited by eldiener; 10-15-2012 at 10:22 PM. Reason: Correct misspelling
 
Old 10-16-2012, 07:28 AM   #14
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,781

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
An overlapping move is one where the source and destination share some of the same area on the disk, which is exactly the case when you are trying to slide a partition a few sectors to the left or right. There is no simple way to do that that does not leave you with a huge mess if the operation gets aborted part way through.
 
Old 10-16-2012, 09:51 PM   #15
eldiener
Member
 
Registered: Nov 2006
Distribution: Mepis, CentOS, OpenSuse
Posts: 106

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by rknichols View Post
An overlapping move is one where the source and destination share some of the same area on the disk, which is exactly the case when you are trying to slide a partition a few sectors to the left or right. There is no simple way to do that that does not leave you with a huge mess if the operation gets aborted part way through.
I have used partition managers which did just such an overlapped move without any problems in the past. Even if the move got aborted somehow, which has never happened to me, at worst I just restore my backup and I am fine again.

Unfortunately none of the Linux live partition managers I tried, both gparted and KDE partition manager, would allow me move a partition by specifying a sector boundary. Curses ! Then I though I might use 'parted' from the command line, only to find out that the ability to even resize/move a partition was taken away from its command line functionality long ago. The only alternative, since I am an expert programmer, is to try to understand the API of libparted, and write my own program to do what I want.

So I am a bit stuck and will have to live with my partitions on my sdb drive, most of which do not start on a physical sector boundary, unless I write my own program.
 
  


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
[SOLVED] RAID 5 with 4 hard disks... array started with only 3 out of 4 disks kikinovak Slackware 9 08-11-2012 06:33 AM
[SOLVED] Problems to install Slack 13 64bit (GPT and fdisk) DecioSP Slackware 11 12-30-2009 12:46 AM
RHEL 5.3 on Bladecenter with GPT disks Teleute Linux - Hardware 4 08-31-2009 09:43 AM
GPT error with fdisk fakie_flip Linux - General 1 12-17-2007 09:21 PM

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

All times are GMT -5. The time now is 03:42 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
Open Source Consulting | Domain Registration