Difference between pages "Partitioning using gdisk" and "User:Mtew"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
 
(Created page with "{{Person |Geoloc=35.9940329, -78.898619 |Location name=Durham, North Carolina, United States of America |Blogs= }}")
 
Line 1: Line 1:
 
{{Person
===== Notes Before We Begin =====
|Geoloc=35.9940329, -78.898619
 
|Location name=Durham, North Carolina, United States of America
These install instructions assume you are installing Funtoo Linux to an empty hard disk using GUID partition tables (GPT). If you are installing Funtoo Linux on a machine where another OS is installed, or there is an existing Linux distribution on your system that you want to keep, then you will need to adapt these instructions to suit your needs.
|Blogs=
 
}}
===== Using gdisk =====
 
The first step after booting SystemRescueCd is to use <tt>gdisk</tt> to create GPT (also known as GUID) partitions, specifying the disk you want to use, which is typically <tt>/dev/sda</tt>, the first disk in the system:
 
<console># ##i##gdisk /dev/sda</console>
You should find <tt>gdisk</tt> very similar to <tt>fdisk</tt>. Here is the partition table we want to end up with:
 
<console>Command (? for help): ##i##p
Disk /dev/sda: 234441648 sectors, 111.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): A4E5208A-CED3-4263-BB25-7147DC426931
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 234441614
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)
 
Number  Start (sector)    End (sector)  Size      Code  Name
  1            2048          206847  500.0 MiB  8300  Linux filesystem
  2          206848          272383  32.0 MiB    EF02  BIOS boot partition
  3          272384        8660991  4.0 GiB    8200  Linux swap
  4        8660992      234441614  107.7 GiB  8300  Linux filesystem
 
Command (? for help): </console>
 
Above, you'll see that we have a 500 MiB boot partition, a 32 MiB "BIOS boot partition" (also known as the GRUB boot loader partition), 4 GiB of swap, and the remaining disk used by a 107.7 GiB root partition.
 
===== For new <tt>gdisk</tt> users =====
 
These partitions were created using the "<tt>n</tt>" command from within <tt>gdisk</tt>. The <tt>gdisk</tt> commands to create the partition table above are as follows. Adapt sizes as necessary, although these defaults will work for most users. The partition codes entered below can be found in the [[#Partitioning Recommendations|Partitioning Recommendations]] table below, in the GPT Code column.
 
Within <tt>gdisk</tt>, follow these steps:
 
'''Create a new empty partition table''' (This ''will'' erase all data on the disk when saved):
 
<console>
Command: ##i##o ↵
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): ##i##y ↵
</console>
 
'''Create Partition 1''' (boot):
 
<console>
Command: ##i##n ↵
Partition Number: ##i##1 ↵
First sector: ##i##↵
Last sector: ##i##+500M ↵
Hex Code: ##i##↵
</console>
 
'''Create Partition 2''' (GRUB):
 
<console>
Command: ##i##n ↵
Partition Number: ##i##2 ↵
First sector: ##i##↵
Last sector: ##i##+1M ↵
Hex Code: ##i##EF02 ↵
</console>
 
'''Create Partition 3''' (swap):
 
<console>
Command: ##i##n ↵
Partition Number: ##i##3 ↵
First sector: ##i##↵
Last sector: ##i##+4G ↵
Hex Code: ##i##8200 ↵
</console>
 
'''Create Partition 4''' (root):
 
<console>
Command: ##i##n ↵
Partition Number: ##i##4 ↵
First sector: ##i##↵
Last sector: ##i##↵##!i## (for rest of disk)
Hex Code: ##i##↵
</console>
 
Along the way, you can type "<tt>p</tt>" and hit Enter to view your current partition table. If you make a mistake, you can type "<tt>d</tt>" to delete an existing partition that you created. When you are satisfied with your partition setup, type "<tt>w</tt>" to write your configuration to disk:
 
'''Write Partition Table To Disk''':
 
<console>
Command: ##i##w ↵
Do you want to proceed? (Y/N): ##i##Y ↵
</console>
 
The partition table will now be written to disk and <tt>gdisk</tt> will close.
 
Now, your GPT/GUID partitions have been created, and will show up as the following ''block devices'' under Linux:
 
* <tt>/dev/sda1</tt>, which will be used to hold the <tt>/boot</tt> filesystem,
* <tt>/dev/sda2</tt>, which will be used directly by the new GRUB,
* <tt>/dev/sda3</tt>, which will be used for swap space, and
* <tt>/dev/sda4</tt>, which will hold your root filesystem.
 
===== All Done! =====
 
Now, you can return to the main [[Funtoo Linux Installation]] instructions. Please note that your root filesystem is on <code>/dev/sda4</code>, and your swap partition is <code>/dev/sda3</code>. You will need to adjust your <code>/etc/fstab</code> accordingly when you edit it.

Latest revision as of 05:33, July 31, 2014


Location

Loading map...
Durham, North Carolina, United States of America