HDD: Difference between revisions

From Q
Jump to navigation Jump to search
Tgurr (talk | contribs)
No edit summary
Tgurr (talk | contribs)
No edit summary
Line 1: Line 1:
== Typical Linux partitioning ==
== Create a simple Linux GPT partition layout ==


fdisk /dev/sda
{{Code|Simple GPT partition layout|
<pre>
<pre>
/dev/sda1 Boot partition (32MB)
/dev/sda1 1  MiB EF02 BIOS boot BIOS boot partition
/dev/sda2 Swap partition (512MB)
/dev/sda2 100 MiB /boot 8300 ext4 Linux filesystem
/dev/sda3 Root partition (xxGB)
/dev/sda3 512 MiB 8200 swap Linux swap
/dev/sda4  Portage tree partition (2GB)
/dev/sda4 25 GiB / 8300 ext4 Linux filesystem
</pre>
}}


p
{{Root|gdisk /dev/sda}}
 
{{Code|gdisk commands|
<pre>
Command (? for help): p
Disk /dev/sda: 156301488 sectors, 74.5 GiB
[...]


n
n
p
1
1
enter
enter
+32M
+1M
EF02


n
n
p
2
2
enter
enter
+512M
+100M
8300


n
n
p
3
3
enter
enter
+25GB
+512M
8200


n
n
p
4
4
enter
enter
enter
enter
 
8300
 
a
1
 
t
2
82


p
p
w
w
Y
</pre>
</pre>
}}


== Create the filesystems ==


== Formating ==
{{Root|mkfs.ext4 /dev/sda2}}


mke2fs /dev/sda1
{{Root|mkswap /dev/sda3}}


mkfs.ext4 /dev/sda3
{{Root|mkfs.ext4 /dev/sda4}}


mkfs.xfs /dev/sda4
== Label the filesystems ==


mkswap /dev/sda2  
{{Root|tune2fs -L boot /dev/sda2}}


{{Root|mkswap -L swap /dev/sda3}}


== Mounting ==
{{Root|tune2fs -L root /dev/sda4}}


swapon /dev/sda2
And verify with:


mount /dev/sda3 /mnt/gentoo
{{Root|blkid}}


mkdir -p /mnt/gentoo/usr/portage
== Mount the filesystems ==


mount /dev/sda4 /mnt/gentoo/usr/portage
{{Root|mkdir -p /mnt/exherbo}}


mkdir /mnt/gentoo/boot
{{Root|swapon /dev/sda3}}


mount /dev/sda1 /mnt/gentoo/boot
{{Root|mount /dev/sda4 /mnt/exherbo}}


{{Root|mkdir /mnt/exherbo/boot}}


== Volume labels ==
{{Root|mount /dev/sda2 /mnt/exherbo/boot}}


(tune2fs -L boot /dev/hda4)
== Configure /etc/fstab ==


(tune2fs -L swap /dev/hda4)
List the UUID's with


tune2fs -L root /dev/sda3
{{Root|blkid}}


(tune2fs -L portage /dev/sda4)
{{File|/etc/fstab|
 
== Using ext4 ==
 
{{Kernel|Kernel .config|
<pre>
<pre>
-*- Enable the block layer  --->
UUID=0930a69b-f2d5-4607-93fe-4f8bfdf2ea87      /boot  ext4    defaults        1 2
--- Enable the block layer
UUID=8431f5f2-0cb1-4831-aed2-00d618543e0a      swap    swap    defaults        0 0
[*]  Support for large block devices and files
UUID=cf602240-7bac-4b29-8930-2080a5aac7cd      /      ext4    defaults        1 1
</pre>
</pre>
}}
}}
Proceed to configure [[GRUB]]

Revision as of 13:07, 4 May 2012

Create a simple Linux GPT partition layout

Code: Simple GPT partition layout
/dev/sda1	1   MiB		EF02	BIOS boot	BIOS boot partition
/dev/sda2	100 MiB	/boot	8300	ext4		Linux filesystem
/dev/sda3	512 MiB		8200	swap		Linux swap
/dev/sda4	25  GiB	/	8300	ext4		Linux filesystem
# gdisk /dev/sda
Code: gdisk commands
Command (? for help): p
Disk /dev/sda: 156301488 sectors, 74.5 GiB
[...]

n
1
enter
+1M
EF02

n
2
enter
+100M
8300

n
3
enter
+512M
8200

n
4
enter
enter
8300

p
w
Y

Create the filesystems

# mkfs.ext4 /dev/sda2
# mkswap /dev/sda3
# mkfs.ext4 /dev/sda4

Label the filesystems

# tune2fs -L boot /dev/sda2
# mkswap -L swap /dev/sda3
# tune2fs -L root /dev/sda4

And verify with:

# blkid

Mount the filesystems

# mkdir -p /mnt/exherbo
# swapon /dev/sda3
# mount /dev/sda4 /mnt/exherbo
# mkdir /mnt/exherbo/boot
# mount /dev/sda2 /mnt/exherbo/boot

Configure /etc/fstab

List the UUID's with

# blkid
File: /etc/fstab
UUID=0930a69b-f2d5-4607-93fe-4f8bfdf2ea87       /boot   ext4    defaults        1 2
UUID=8431f5f2-0cb1-4831-aed2-00d618543e0a       swap    swap    defaults        0 0
UUID=cf602240-7bac-4b29-8930-2080a5aac7cd       /       ext4    defaults        1 1

Proceed to configure GRUB