disks overzicht
- bios kent sequence number aan disks toe
die volgorde wordt vertaald in linux disk-device names:/dev/sda /dev/sdb /dev/sdc /dev/sdd ...
- elke disk wordt gepartitioneerd:
tenminste 1 partition of multiple partitions
partitions zijn genummerd:
/dev/sda1 -- /dev/sdc6 -- /dev/sdm2
- MBR of GPT
==>
partitions>
2TB -->gdisk
==>
partitions<
2TB -->fdisk
ofgdisk
fdisk
-->
MBR (master boot record)
max 4 primary partitions:
/dev/sda1 -- /dev/sda2 -- /dev/sda3 -- /dev/sda4
meer nodig dan 4 => one partition is EXTENDED partition
extended partition bevat logical partitions
/dev/sda5 -- /dev/sda6 -- /dev/sda7 -- ..
gdisk
--> GPT (GUID partition table)
standaard 128 partitions ../dev/sda1 -- /dev/sda2 -- ..
-
partitions moeten geformatteerd worden ...
# mkfs.ext4 /dev/sdd7
ext4 --> mkfs.ext4 xfs --> mkfs.xfs ntfs --> mkfs.ntfs fat32 --> mkfs.vfat
-
geformatteerde partities moeten gemount worden ..
$ sudo mkdir /system-a
$ sudo mount /dev/sda1 /system-a
$ sudo mkdir /mnt/spare
$ sudo mount /dev/sdd7 /mnt/spare
$ sudo mkdir -p /filezilla/ftp
$ sudo mount /dev/sdc1 /filezilla/ftp
-
auto-mount via edit of
/etc/fstab
$ sudo cp /etc/fstab /etc/fstab.old
$ sudo nano /etc/fstab
by device name:
/dev/sda1 /home/ftp ext4 defaults 0 0
by uuid:# /home was on /dev/sda8 during installation UUID=2e145554-df73-49aa-8cbc-a839f529452f /home ext4 defaults 0 0
- hoe vind je uuid
$ ls /dev/disk/by-uuid/ -l
of
$ sudo blkid /dev/sda6
/dev/sda6: UUID="6e04800d-d1a8-4e84-93b8-f89e33d2e3f1" TYPE="ext4"
- swap partitie
aanmaken metmkswap /dev/sdc8
activeren metswapon /dev/sdc8
- controlleren
gebruikdf
ofmount
voor data-partities
gebruikswapon -s
offree
voor swap-partities
-
nuttige commando's
lsblk
user@pc135:~$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 465,8G 0 disk ├─sda1 8:1 0 512M 0 part /boot/efi └─sda2 8:2 0 73,2G 0 part / sdb 8:16 0 1,8T 0 disk ├─sdb1 8:17 0 29,8G 0 part [SWAP] ├─sdb2 8:18 0 100G 0 part /home └─sdb3 8:19 0 750G 0 part /home/vms
-
blkid
user@pc135:~$ blkid /dev/sdb2 /dev/sdb2: UUID="e1ddbc0c-7f56-4bf9-aa08-7fc461540678" TYPE="xfs" PARTLABEL="Linux filesystem" PARTUUID="cb504c58-a20e-4010-8c4b-f765e18e590a"