Solved MY GPT partitioning questions.
While waiting for a response to my GPT disk partitioning question, I did more research & decided
to alter my Parted commands. The following commands were used & resulted in a GRUB2 bootable GPT
Partition setup for my Fedora-15 Linux system.
parted /dev/sdb ..start parted interactively on disk /dev/sdb
mklabel gpt ..create an empty GPT partition table on /dev/sda (Partition Code: EF02 auto asigned)
mkpart linux ---- 17.4KB 2MB ..create a 1983KB (BIOS BOOT) partition# 1 {1st 17.4KB (34 x 512 =17408 sectors) used by parted for its data}
set 1 bios_grub on ..tell linux partition# 1 will hold the GRUB2 (core.img) stage2 bootcode
mkpart linux ext2 2MB 252MB ..create a 250MB partition# 2
set 2 legacy_boot on ..tell special purpose software that the #2 GPT partition may be bootable
..used by software like syslinux to determine which partition to boot when
in BIOS mode. (Syslinux GPT boot loader for BIOS systems --not supported by Fedora)
mkpart linux ext2 252MB 50252MB ..create a 50GB (50,000,000,000 bytes) partition# 3
mkpart swap linux-swap 50252MB 52252MB ..create a 2GB ( 2,000,000,000 bytes) partition# 4
mkpart linux ext2 52252MB 62252MB ..create a 10GB (10,000,000,000 bytes) partition# 5
mkpart linux ext2 60.252GB 100% ..partition remaining disk space as linux partition# 6
---or---
mkpart linux ext2 60.252GB -1 ..partition remaining disk space as linux partition# 6
Here is a list of the GTP partitions created with the above "Parted" commands:
[root@localhost stan]# parted -l
Model: ATA WDC WD3200AAJS-5 (scsi)
Disk /dev/sdb: 320GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags ID MNT-PT
1 17.4kB 2000kB 1983kB linux bios_grub EF02 ----- --grub2 will put its core.img data here
2 2097kB 252MB 250MB ext3 linux legacy_boot 0700 /boot --grub2 files, grub.cfg & kernel
3 252MB 50.3GB 50.0GB ext4 linux 0700 / --Fedora rootfs (/usr;/run;/var;/dev; ..etc)
4 50.3GB 52.3GB 2048MB linux-swap(v1) swap 8300 swap --linux-swap (activated by /etc/fstab entry)
5 52.3GB 62.3GB 10.0GB ext4 linux 0700 /home --user(s) personal files
6 62.3GB 320GB 258GB ext4 linux 0700 /mnt/* --misc file storage area mounted only as needed
NOTE:
* 1.) GPT partitions don't use Primary Extended & Logical partition types (Use name: linux)
2.) Parted asks for FS-Type & only presents ext2 as an option. This is used to set a partition-type ID code in partition table.
(eg.) FS-TYPE ext2 ..set code to 0700 or 8300
FS-TYPE linux-swap ..set code to 8200
FS-TYPE bios_grub --set code to EF02 (AKA: BIOS BOOT partition)
3.) You must create a filesystem on a partition outside of the parted utility before it will be displayed by parted.
* 4.) The command "parted -l" doesn't display partition ID codes. You must use the "gdisk" utility to see ID codes.
5.) Parted commads "set" & disk_set share the same flags
FLAG is one of: boot, root, swap, hidden, raid, lvm, lba, hp-service, palo, prep, msftres, bios_grub, atvrecv, diag, legacy_boot
6.) Parted will alter partition "Start End" entries & compute sensible ranges for the locations you specify. If the calculated values
differ too much, Parted will ask you for confirmation. ...Use the "p" print interactive command after each partition you create
so you can determine the proper Start-End range for your next partition.
Here is what the utility "gdisk" displays:
[root@localhost stan]# gdisk -l /dev/sdb
GPT fdisk (gdisk) version 0.8.2
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/sdb: 625142448 sectors, 298.1 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): E6DBFCBB-349A-435B-BF35-11F59DB70B42
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 625142414
Partitions will be aligned on 8-sector boundaries
Total free space is 844 sectors (422.0 KiB)
Number Start (sector) End (sector) Size Code Name
1 34 3906 1.9 MiB EF02 linux ..34 sectors: 512x34=17408 bytes (17.4KB) Bios Boot partition
2 4096 491519 238.0 MiB 0700 linux
3 491520 98148351 46.6 GiB 0700 linux
4 98148352 102148095 1.9 GiB 8200 swap
5 102148096 121679871 9.3 GiB 0700 linux
6 121679872 625141759 240.1 GiB 0700 linux
I hope this helps others who are interested in a GPT (Globally_Unique_Identifier Partition Table) setup.
|