LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 03-17-2018, 09:06 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 1,339

Rep: Reputation: 119Reputation: 119
troubles setting partition type with fdisk


I am completely stumped! I have booted from the 14.2 installation DVD, created some partitions using 'fdisk /dev/sda', and when I set the partition type to 7, it set it as "PowerPC PReP boot"! When I did the 'l' command to list the partition type I got something completely different than I'm used to. There were a bunch of type codes and descriptions, 1 line per code, with a big long string of hex digits to the right of each looking something like a UUID. In this list, a Linux swap partition is listed as type 19, whereas it is normally type 82. A Linux filesystem is listed as type 20 whereas it is normally 83.

Using this same fdisk command in this same computer I looked at /dev/sdb, and it partition types are normal (e.g. a 7 is HPRS/NTFS/exFAT).

Where in the world did this "alt-ID" table come from and how can I get back to a normal partition id list? I'm stuck not being able to use this disk.
 
Old 03-18-2018, 07:53 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1 on Lenovo Thinkpad W520
Posts: 8,204

Rep: Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982
Quote:
Originally Posted by mfoley View Post
Where in the world did this "alt-ID" table come from and how can I get back to a normal partition id list? I'm stuck not being able to use this disk.
This disk has a GUID partition table, in other words a partition table with a gpt label, which implies a different partition types numbering. Just press l to list the partition numbers and associated types and select the appropriate ones, e.g. 19 for Linux swap (if you need that) and 20 for Linux filesystem, that's all. Also, the partition numbering differ upon the tool used, you have to use the relevant numbers for the tool you are using (fdisk or gdisk vs cfdisk or cgdisk). There is really nothing magic with these numbers, that's just an easy way to select the partition type non ambiguously.

To know more, read:
https://en.wikipedia.org/wiki/GUID_Partition_Table

Last edited by Didier Spaier; 03-18-2018 at 08:00 AM.
 
1 members found this post helpful.
Old 03-19-2018, 08:31 AM   #3
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 1,339

Original Poster
Rep: Reputation: 119Reputation: 119
Thanks Didier. That explains the mystery. I do have some GPT drives on a RAID, so I checked that and sure enough, they have these "funny" partition IDs. The drive in my OP was supposed to be MBR and I used fdisk to partition it, but it must have been previously GPT'd on some other system. Apparently, deleting the partitions does not change this GPT/MBR setting. I wiped it by 'dd if=/dev/zero =of /dev/sda bs=512 count=1000'
 
1 members found this post helpful.
Old 03-19-2018, 09:03 AM   #4
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1 on Lenovo Thinkpad W520
Posts: 8,204

Rep: Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982
Quote:
Originally Posted by mfoley View Post
I wiped it by 'dd if=/dev/zero =of /dev/sda bs=512 count=1000'
Why? there is no need to do that and fdisk as well as cfdisk can handle GPT.

Better get acquainted with this kind of partition table, it's here to stay and has only advantages, no inconvenience vs dos partition tables as far as I know.
 
Old 03-19-2018, 10:04 AM   #5
abga
Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 397

Rep: Reputation: 194Reputation: 194
Quote:
Originally Posted by Didier Spaier View Post
Why? there is no need to do that and fdisk as well as cfdisk can handle GPT.
Handle for sure, removing the GPT (fully clean the GPT records at the end of the drive (designed like a "virus" you cannot get rid of)) might need some more voodoo magic ATM. I was also wiping the entire HDD with dd before I learned about the gdisk tool, still doing it now if I don't have gdisk available. The Internet is filled with articles about removing GPT and most of them are filled with ambiguity + the results are not 100% OK.
I have a bookmark on the one article on stackexchange that was presenting gdisk that I could follow and get the desired results:
https://unix.stackexchange.com/quest...lt-back-to-mbr

- the answer by VaTo - "Use gdisk /dev/sda"

Last edited by abga; 03-19-2018 at 10:19 AM. Reason: typo
 
Old 03-20-2018, 08:03 AM   #6
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 1,339

Original Poster
Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by Didier Spaier View Post
Why? there is no need to do that and fdisk as well as cfdisk can handle GPT.

Better get acquainted with this kind of partition table, it's here to stay and has only advantages, no inconvenience vs dos partition tables as far as I know.
My only familiarity with GPT is with the aforementioned RAID whose member drivers are 4TB. I did use gdisk to partition those. I had though GPT was necessary only for > 2TB drives.

I figured out where the GPT came from to start with. I had booted an Acronis tool which booted UEFI and when I added this drive it automatically did it as GPT. Are UEFI and GPT somehow related? Do UEFI and Linux play well together?
 
Old 03-20-2018, 09:09 AM   #7
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1 on Lenovo Thinkpad W520
Posts: 8,204

Rep: Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982Reputation: 2982
Quote:
Originally Posted by mfoley View Post
Are UEFI and GPT somehow related? Do UEFI and Linux play well together?
Some links:
http://uefi.org/specifications
https://en.wikipedia.org/wiki/Unifie...ware_Interface
https://en.wikipedia.org/wiki/GUID_Partition_Table

Happy reading.
 
1 members found this post helpful.
  


Reply

Tags
fdisk, partition table


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
role of partition type (code) in fdisk vincix Linux - Newbie 4 10-18-2015 01:06 AM
[SOLVED] fdisk shows wrong partition type BlackTornado Linux - Newbie 3 03-06-2013 02:39 AM
fdisk created fat32 partition, which type 0b or 0c? onedingo Linux - General 12 05-21-2008 07:56 AM
Dual Boot Vista Suse 10.2 error setting type of partition to type 82 jmp559 Linux - General 1 05-15-2008 06:40 PM
fdisk partition type question downinthemine Slackware - Installation 5 12-22-2003 07:52 AM

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

All times are GMT -5. The time now is 09:06 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration