注意:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Install/GPT Partitioning"

From Funtoo
Jump to navigation Jump to search
(remove note suggesting EVERYONE use GPT. muh mbr is still old trusty)
m (Reverted edits by Pnoecker (talk) to last revision by Drobbins)
Tag: Rollback
Line 11: Line 11:


<!--T:3-->
<!--T:3-->
{{Note|GPT is more modern than BIOS/MBR and has many features, including features to address partition count, and size limitations in MBR.}}
{{Note|Use this method if you are interested in booting using UEFI, and if your Funtoo LiveCD initial boot menu was black and white, or the system booted without a boot menu. If it was light blue, this method will not work. Instead, use the instructions in the previous section then skip this section, or reboot LiveCD in UEFI mode first.}}


<!--T:20-->
<!--T:20-->
{{Note|You can build legacy mode into your GPT partition table but it requires a 1M BIOS Boot partition at the start of the disk.}}
{{Note|You can build legacy mode into your GPT partition table but it requires a BIOS Boot partition. see [[Talk:Install/GPT_Partitioning]]}}


<!--T:4-->
<!--T:4-->
Line 20: Line 20:


<!--T:5-->
<!--T:5-->
{{console|body=###i## gdisk /dev/funtoo}}
{{console|body=###i## gdisk /dev/sda}}


<!--T:6-->
<!--T:6-->
Line 32: Line 32:
Proceed? (Y/N): ##i##y ↵
Proceed? (Y/N): ##i##y ↵
}}
}}
<!--T:19-->
This partition is mandatory for booting in legacy mode.  Your system might not boot without it, and it is used for debugging uefi.
'''Create Partition 4''' (BIOS Boot)
{{console|body=
Command: ##i##n ↵
Partition Number: ##i##4 ↵
First sector: ##i##↵
Last sector: ##i##+1M ↵
Hex Code: ##i##EF02 ↵
Command: ##i##c ↵
Partition number: ##i##4
Enter name: ##i##BIOS Boot
}}
'''Create Partition 1''' (boot):
'''Create Partition 1''' (boot):


Line 55: Line 39:
Partition Number: ##i##1 ↵
Partition Number: ##i##1 ↵
First sector: ##i##↵
First sector: ##i##↵
Last sector: ##i##+256M
Last sector: ##i##+128M
Hex Code: ##i##EF00 ↵
Hex Code: ##i##EF00 ↵
}}
}}
Line 82: Line 66:
Hex Code: ##i##↵
Hex Code: ##i##↵
}}
}}
(Optional) If you wish to use PARTLABEL= /etc/fstab statements:
(Optional) If you wish to use disk labels instead of /dev/sdXX (where XX is your disk and partition number) do:
{{console|body=
{{console|body=
Command: ##i##c ↵
Command: ##i##c ↵
Line 89: Line 73:
Command: ##i##c ↵
Command: ##i##c ↵
Partition Number: ##i##2
Partition Number: ##i##2
Enter name: ##i##SWAP
Enter name: ##i##swap
Command: ##i##c ↵
Command: ##i##c ↵
Partition Number: ##i##3
Partition Number: ##i##3
Enter name: ##i##FUNTOO
Enter name: ##i##ROOT
}}
}}


Line 112: Line 96:


<!--T:17-->
<!--T:17-->
* {{c|/dev/funtoo1}}, which will be used to hold the {{c|/boot}} filesystem,  
* {{c|/dev/sda1}}, which will be used to hold the {{c|/boot}} filesystem,  
* {{c|/dev/funtoo2}}, which will be used for swap space, and  
* {{c|/dev/sda2}}, which will be used for swap space, and  
* {{c|/dev/funtoo3}}, which will hold your root filesystem, and
* {{c|/dev/sda3}}, which will hold your root filesystem.
* {{c|/dev/funtoo4}}, which will enable legacy, & UEFI booting.


<!--T:18-->
<!--T:18-->
{{Tip|You can verify that the block devices above were correctly created and mapped by running the commands {{c|lsblk}} and {{c|ls -al /dev/funtoo*}}.}}
{{Tip|You can verify that the block devices above were correctly created by running the command {{c|lsblk}}.}}
</translate>
</translate>
<noinclude>{{InstallNavigation|num=4|prev=MBR Partitioning|next=Creating Filesystems|align=right}}</noinclude>
<noinclude>{{InstallNavigation|num=4|prev=MBR Partitioning|next=Creating Filesystems|align=right}}</noinclude>

Revision as of 04:48, December 12, 2020

Other languages:
English • ‎español • ‎polski • ‎português do Brasil • ‎русский • ‎中文(中国大陆)‎

Install Guide: GPT Partitioning

Install Guide, Chapter 4 < Prev Next >

UEFI/GPT Method

   Note

Use this method if you are interested in booting using UEFI, and if your Funtoo LiveCD initial boot menu was black and white, or the system booted without a boot menu. If it was light blue, this method will not work. Instead, use the instructions in the previous section then skip this section, or reboot LiveCD in UEFI mode first.

   Note

You can build legacy mode into your GPT partition table but it requires a BIOS Boot partition. see Talk:Install/GPT_Partitioning

The gdisk commands to create a GPT partition table are as follows. Adapt sizes as necessary, although these defaults will work for most users. Start gdisk:

root # gdisk /dev/sda

Within gdisk, follow these steps:

Create a new empty partition table (This will erase all data on the disk when saved):

Command: o ↵
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y ↵

Create Partition 1 (boot):

Command: n ↵
Partition Number: 1 ↵
First sector: 
Last sector: +128M ↵
Hex Code: EF00 ↵

Create Partition 2 (swap):

Command: n ↵
Partition Number: 2 ↵
First sector: 
Last sector: +4G ↵
Hex Code: 8200 ↵

Create Partition 3 (root):

Command: n ↵
Partition Number: 3 ↵
First sector: 
Last sector:  (for rest of disk)
Hex Code: 

(Optional) If you wish to use disk labels instead of /dev/sdXX (where XX is your disk and partition number) do:

Command: c ↵
Partition Number: 1
Enter name: BOOT 
Command: c ↵
Partition Number: 2
Enter name: swap
Command: c ↵
Partition Number: 3
Enter name: ROOT

Along the way, you can type "p" and hit Enter to view your current partition table. If you make a mistake, you can type "d" to delete an existing partition that you created. When you are satisfied with your partition setup, type "w" to write your configuration to disk:

Write Partition Table To Disk:

Command: w ↵
Do you want to proceed? (Y/N): Y ↵

The partition table will now be written to the disk and gdisk will close.

Now, your GPT/GUID partitions have been created, and will show up as the following block devices under Linux:

  • /dev/sda1, which will be used to hold the /boot filesystem,
  • /dev/sda2, which will be used for swap space, and
  • /dev/sda3, which will hold your root filesystem.
   Tip

You can verify that the block devices above were correctly created by running the command lsblk.

Install Guide, Chapter 4 < Prev Next >