View previous topic :: View next topic |
Author |
Message |
The_Great_Sephiroth Veteran
Joined: 03 Oct 2014 Posts: 1602 Location: Fayetteville, NC, USA
|
Posted: Mon Jan 05, 2015 5:27 pm Post subject: Wiki misconception... |
|
|
I have been reading all over the Gentoo wiki since I started using it a month or so back and have noticed a repeat problem. All of the guides that make a GPT disk name the partitions "primary". In parted you only need to use "primary" if making an msdos disklabel. In GPT the first parameter to mkpart can be anything, it's the name of the partition.
Code: |
unit mib
mklabel gpt
mkpart BIOS 1 8
set 1 bios_grub on
mkpart Boot 8 128
mkpart Linux 128 65536
mkpart Home 65536 100%
|
You only need to specify "primary" if you're on an MSDOS disk creating a primary partition.
Code: |
unit mib
mklabel msdos
mkpart primary 1 128
mkpart primary 128 65536
mkpart extended 65536 100%
mkpart logical 65537 100%
|
See the difference? I am not trying to criticize, just making a point. If you ever had to recover data and did not go back and name the partitions, you'd boot System Rescue CD or whatever and see a bunch of partitions named "primary", making it difficult to figure out. _________________ Ever picture systemd as what runs "The Borg"? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Mon Jan 05, 2015 8:44 pm Post subject: |
|
|
The_Great_Sephiroth,
You really aren't going to like the answer ...
Once upon a time, hard drives were small and partitions were not required. Indeed, the partition table was not yet invented.
Then hard drives got bigger than 32 Mb. (yes Megabytes) and MSDOS couldn't use a whole hard drive any more.
The partition table was born. Shoehorned into 66 byles of unused space at the end of the MSDOS boot loader.
There was space for at most, 4 entries.
Hard drives got bigger still. The next limit was 128 Mb, which was a partition table full of 32Mb partitions.
Enter the concept of the Extended Partition. The Extended partition just reserves space on disk.
Logical partitions are created inside to actually use the space reserved by the Extended partiton.
MSDOS Primary partitions use one of the entries is the original partiton table.
The partition table inside an Extendeod partition, describing the Logical partitons is in the form of a linked list. These two different data structures account for the odd behavior of MSDOS partiton tables.
The original four (primary) entries are always numbered 1..4, no matter if they are used or not.
The first logical partition is always 5.
Deleting any logical partition in, say 5,6,7,8, leaves 5,6 and 7 (its a linked list remember).
The icing on the cake in that the MSDOS partition table has been redesigned several times but always using 32 bit (or smaller) pointers, so it has a hard limit of 2TiB.
In short the MSDOS partition table started out as a hack and its been patched to keep it alive in the face of ever growing storage.several times since.
The GPT is not shoehorned into anywhere. It contains either 128 or 256 entries, I forget which and they are all primary partitions (to use an MSDOS term)
I think that they use 64 bit pointers too, which will keep HDD vendors at bay for a while.
parted will let you make extended and logical partitons on GPT but there is no need to. That concept was borne out of the constraints of the time.
Its really not difficult to work out what is what for data recovery. You mount it and look. If mount fails, you look at file names with a hex editor,
Partition names are a luxory - MSDOS disk lables do not support them.
Even having a partition table at all gives you a head start in data recovery. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
The_Great_Sephiroth Veteran
Joined: 03 Oct 2014 Posts: 1602 Location: Fayetteville, NC, USA
|
Posted: Mon Jan 05, 2015 9:43 pm Post subject: |
|
|
OH I know. I started programming in Basic when I was six on an Atari. It saved data to cassette tapes, and to 5.25" floppies. My first PC (Amstrad, 8086) had a 10MB HDD in an 8bit ISA slot and it was MONSTROUS. I went through all of that. My point was that in GPT mode, the first parameter to "mkpart" is a label, not a type specifier. In MSDOS mode it is a type specifier (primary, extended, or logical). I prefer GPT personally, but some older systems require the old MSDOS style, and some even REQUIRE the partition to start on sector 63, not 2048. If you align the partition before installing, the BIOS cannot boot it because it is hard-coded to look at sector 63. Aggravating! _________________ Ever picture systemd as what runs "The Borg"? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54237 Location: 56N 3W
|
Posted: Mon Jan 05, 2015 10:08 pm Post subject: |
|
|
The_Great_Sephiroth,
The convention was always Cyilnder 0, Sector 0, Head 1, whatever that was. In the days of HDD with stepper motors, it actually depended on the Geometry.
The CHS addressing system broke at 2Gb, apart from one special case. The Windows NT installer could use a 64k allocation unit before it switched the drive to NTFS.
You used to be able to start the first partition on Cyilnder 0, Sector 1, Head 0, if you were desperate for space.
When CHS addressing broke and these parameters became a fiction that HDD reported to the OS, the convention of starting the first partition on Cyilnder 0, Sector 0, Head 1 was preserved.
That became LBA 63, as thats the maximum number of sectors per track that CHS supports.
On a new MSDOS disk label, you can create either a primary or extended partition. Extended is a type of primary partiton. The partition tool needs to know.
On GPT, nobody cares. If you run out of primary partitions, you should have been using LVM anyway.
You can still make one Extended partiton but why bother, when the constraint that limited the partition table to four entries has gone? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6051 Location: Removed by Neddy
|
Posted: Mon Jan 05, 2015 10:49 pm Post subject: |
|
|
Don't forget the original ATA spec had a limit at 8gig but the original implementation at ATA HW messed that up limiting it to 504Meg & then another issue with the BIOS limiting detecting > 2gig _________________
Quote: | Removed by Chiitoo |
|
|
Back to top |
|
|
The_Great_Sephiroth Veteran
Joined: 03 Oct 2014 Posts: 1602 Location: Fayetteville, NC, USA
|
Posted: Tue Jan 06, 2015 1:32 pm Post subject: |
|
|
Neddy, your posts made me remember my IBM PS/2 system. It has a small HDD in it (30MB I think). It is used as storage only. DOS is actually flashed to a chip on the mainboard. It still works and sits in my office with my Tandy 2100 and a few other systems I have a connection with from my childhood and young adult life. I even have a functioning Vendex Headstart 286 PC with a 30MB HDD running DOS and Windows 3.11. Nostalgia!
Yeah, I have NEVER run out of partitions on GPT. I honestly do not see how one would run out of space unless you were doing some kind of virtualized setup, like the one you linked me in another thread, and were not using LVM. By the way, that was a GOOD read, but the kernel configuration options are missing in the article. I believe I know what to select however. I may be trying that on a spare Xeon system soon just for giggles.
Naib, the 8GB bug got me on a P2/233 back in the day. I owned (still do) a Gateway G6-233 system which came with a Quantum Fireball 3.2GB drive. I bought an 8.4GB drive to pop into it. No issue, but I could only partition 8.0GB, even if I used multiple partitions. I added the drive because I was always upgrading the system (CPU heatsink with a fan, S3 STB Nitro 4MB PCI card -> 3dfx Voodoo3 2000 PCI 16MB, the drive, etc) and ran out of space on my primary drive. I had all four Doom games (there were FOUR with the original engine), Wolfenstein 3D, Heretic, Hexen, Strife, Quake, Quake 2, etc etc on there. Just needed more space for more games! Duke 3D, Redneck Rampage, and Blood were large! Yes, DOS games rocked. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|