can't get rid of GPT disk label
I have a machine with a 3Ware 9650 RAID card controlling one small disk functioning as a standalone disk holding my Linux installation (/, /boot, etc.)
and several other disks which are aggregated into a RAID-5 volume. The system vendor configured the latter with a GPT disk label. The total RAID size is under 2 Tb so GPT is really not required, and I would prefer maintaining it with fdisk just because that's what I'm used to. fdisk complains that the disk device (/dev/sdb) has a GPT label, however. The vendor told me to wipe the beginning of the disk with dd and that would clear the GPT. It did not. I found documentation stating that a duplicate label was also stored at the end of the disk, so I also tried wiping that to no avail. These steps did, however, clear the partition table of entries and I can use fdisk to add new partitions, then use mke2fs to build a filesystem which looks OK. However, even after all this, whenever I use fdisk it still complains about the old GPT hanging around although that does not appear to otherwise impede fdisk's ability to manipulate the disk label. How the heck can I get rid of this GPT stuff, or does it not matter at all that it's still hanging around? The one thing I do not want obviously is to have my users fill this filesystem with data and then have it get ultimately corrupted because fdisk and GPT are fighting with each other. I also tried parted's own 'mklabel msdos' command, hoping that would get rid of the GPT and just leave me with an old-style label, but that did not clear the GPT either. Any advice on how to clean this mess up, or believable assurance that it does not actually matter? Thanks! Roger Davis Univ. of Hawaii |
Just make a new MSDOS partition table with fdisk and make a filesystem with mkfs.
|
can't get rid of GPT disk label
>Just make a new MSDOS partition table with fdisk and make a filesystem with mkfs.
Thanks, contusion, but that does not work. (I assume you mean fdisk's 'o' command.) Well, it works in the sense that the new label is built and the disk otherwise functions as expected, but I continue to get the error message about a pre-existing GPT whenever I run fdisk. |
Certainly it'd be overkill and take a while on a 2 TB disk, but you could use dd on the whole disk since it sounds like you missed part of the GPT label with dd. gparted can deal with GPT disks, so perhaps you could use it to restore it, then delete the GPT label and replace it with the "traditional" PC partition table.
|
First suggestion.
Since you have a raid card, most likely it will have its own bios. Have you checked it's bios to see anything related to hard drive setups? Maybe there's an option to overwrite the disklabel. Second suggestion. Have you tried deleting the partitions and creating new ones or changing the ID of the partition? A few years ago, I had a unused freebsd partition. I formatted it as an ext3 partition. I soon realized I was having issues with the partition. I type fdisk -l to check the layout. To my surprised, the partition ID said freebsd. That was strange. I formatted the partition as an ext3. So, I had a freebsd label with an ext3 file system. After a while of goggling, I saw a post that said to change the partition ID using fdisk. It said, run fdisk, then type the letter p to display entries. Then type t for partition type, select the partition you want to change, type L for listings and then type the ID code. Type p again to see if the changes were made. If satisfied, type w to write the new table. This procedure has worked and my partition ID said linux. Anyway, I hope this will help. Just a suggestion to try since it worked for me in the past. - Cheers |
Thanks to all for their suggestions, the problem is solved. The vendor who sold me the system and created the unwanted GPT was able to ultimately figure it out.
There really are GPTs at both the beginning and end of the disk, it is insufficient to clear only the first one. The following pair of dd commands ultimately worked. I had actually already tried something similar but the dd command I used for the end of the disk was somewhat different and failed to work for reasons unknown. These commands worked: # dd if=/dev/zero of=/dev/sdb bs=512 count=2 # dd if=/dev/zero of=/dev/sdb bs=512 seek=2929629465 (/dev/sdb has 182361 cylinders of 16065 512b sectors each for a total of 2929629465 sectors.) Thanks again to everyone! Roger Davis |
Though this is a very old thread, I just wanted to give my own thanks. I had tried deleting the partition with parted without success--not sure where my error was. This was an 8GB USB stick, that I had used for OS X things. Your solution worked perfectly.
Figured it merited thanks, despite the fact that this a 9 month old thread. |
Again, I appreciate that this is a very old thread, but solved my problem perfectly when no others could. Ironically, also with an 8GB USB stick.
Thank you. |
Thanks
Yes old post blabla but still very helpfull!
Could not crack this problem until this post. |
Yes very helpful, I was stuck unable to install my astaro security gateway even after trying bdans boot and nuke and gparted on the drive with out luck but the dd commands worked like a champ.
Thanks |
Can't belive how many people keep posting the wrong answer in this thread. There's no need to do the dd. Follow these steps EXACTLY and you WILL remove the partition:
Removing GPT information from a drive ===================================== Linux/Unix: 1. Type "parted /dev/<devicename>", usually "parted /dev/sda". 2. Once inside parted type "mktable": -> Table type: msdos -> Destroy data: yes -> quit 3. GPT should now be removed. |
heh, I see my response is about 2 years old by now--but yes, in the interim I've learned of your (kitearoundtheworld's) solution and yup, that works too.
|
Quote:
edit: Also this thread helped me a out a few years ago as well. |
Just highlighting something that may not be obvious (at least to me) -- the solution shown by original poster indicated:
Quote:
Code:
# sfdisk -g /dev/sdb |
Quote:
|
All times are GMT -5. The time now is 09:38 PM. |