linux:storage
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
linux:storage [2019-04-30 13:46] – created gabriel | linux:storage [2019-08-10 19:04] (current) – title capitalization gabriel | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Linux Storage | + | ====== Linux storage |
This page contains my personal notes on Linux filesystems, | This page contains my personal notes on Linux filesystems, | ||
+ | |||
+ | > **Update:** Due to a a number of stability issues I've returned to using [[https:// | ||
===== Partitioning for Ubuntu 19.04 workstations ===== | ===== Partitioning for Ubuntu 19.04 workstations ===== | ||
Line 8: | Line 10: | ||
* 256GB NVMe drive | * 256GB NVMe drive | ||
+ | * 256MiB EFI partition as a raw FAT partition | ||
* 512MiB /boot partition as a raw ext4 partition | * 512MiB /boot partition as a raw ext4 partition | ||
- | * 512MiB EFI partition as a raw FAT partition | ||
* the rest of the disk is configured as an LVM PV consuming 92% of the drive | * the rest of the disk is configured as an LVM PV consuming 92% of the drive | ||
* this currently contains one volume group with two logical volumes, 16GiB for swap (to allow hibernate) and the remaining space is used for / | * this currently contains one volume group with two logical volumes, 16GiB for swap (to allow hibernate) and the remaining space is used for / | ||
Line 22: | Line 24: | ||
mklabel gpt | mklabel gpt | ||
unit MiB # use binary format units when partitioning | unit MiB # use binary format units when partitioning | ||
- | mkpart efi fat32 1MiB 513MiB | + | mkpart efi fat32 1MiB 257MiB |
- | mkpart boot ext4 513MiB 1025MiB | + | mkpart boot ext4 257MiB 769MiB |
- | mkpart pv0 ext4 1025MiB | + | mkpart |
</ | </ | ||
Line 32: | Line 34: | ||
(parted) print | (parted) print | ||
Model: PC401 NVMe SK hynix 256GB (nvme) | Model: PC401 NVMe SK hynix 256GB (nvme) | ||
- | Disk / | + | Disk / |
Sector size (logical/ | Sector size (logical/ | ||
Partition Table: gpt | Partition Table: gpt | ||
Disk Flags: | Disk Flags: | ||
- | Number | + | Number |
- | | + | |
- | | + | |
- | | + | |
</ | </ | ||
+ | |||
+ | As far as I can tell parted can't label volumes as Linux LVM, so I do that using fdisk. | ||
+ | |||
+ | <file sh> | ||
+ | root@kubuntu: | ||
+ | |||
+ | Welcome to fdisk (util-linux 2.33.1). | ||
+ | Changes will remain in memory only, until you decide to write them. | ||
+ | Be careful before using the write command. | ||
+ | |||
+ | |||
+ | Command (m for help): t | ||
+ | Partition number (1-3, default 3): 3 | ||
+ | Partition type (type L to list all types): 31 | ||
+ | |||
+ | Changed type of partition 'Linux filesystem' | ||
+ | |||
+ | Command (m for help): p | ||
+ | Disk / | ||
+ | Disk model: PC401 NVMe SK hynix 256GB | ||
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/ | ||
+ | I/O size (minimum/ | ||
+ | Disklabel type: gpt | ||
+ | Disk identifier: 14779AE7-C2BB-4F6A-9F6E-A927FAF7AAFB | ||
+ | |||
+ | Device | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | Command (m for help): w | ||
+ | The partition table has been altered. | ||
+ | Calling ioctl() to re-read partition table. | ||
+ | Syncing disks. | ||
+ | </ | ||
+ | |||
+ | === Create filesystems and LVM structure === | ||
+ | |||
+ | <file sh> | ||
+ | pvcreate / | ||
+ | vgcreate vg0 / | ||
+ | lvcreate -n swap0 -L 16GiB vg0 | ||
+ | lvcreate -n root -l 100%FREE vg0 | ||
+ | </ | ||
+ | |||
+ | If you did this correctly you should see the following | ||
+ | |||
+ | <file sh> | ||
+ | lvs | ||
+ | LV VG Attr | ||
+ | root vg0 -wi-a----- 202.64g | ||
+ | swap0 vg0 -wi-a----- | ||
+ | </ | ||
+ |
linux/storage.1556646418.txt.gz · Last modified: 2019-04-30 13:46 by gabriel