Partitions, File Systems and Swap
Disks🔗
Rescan/detect disk changes
1 | |
Partitioning🔗
- linuxconfig.org |
parted|fdisk|lsblk|sgdisk(GPT)- File systems:
mkfs,mkswap- exFAT
- package
exfat-utilscontainsmkfs.exfatandexfatlabel - on Ubuntu/Debian package
exfat-fuse
- package
- swap (not really a file system)
- partition:
mkswap [-L label] /dev/... - file: create sparse file (didn’t work for me 2023-02-16), see sparse files, or create dummy with
dd if=/dev/zero of=/swap.img bs=1M count=4000and thenmkswap /swap.img
- partition:
- Partition types (
parttype):- pt-mbr-partnames.h from util-linux package (lsblk) (doesn’t always match output of
parted🤦♂️) - Wikipedia: MBR partition types | GPT GUIDs
fdisk: choselorLto print partition types (depending on partition table type MBR or GPT)
- pt-mbr-partnames.h from util-linux package (lsblk) (doesn’t always match output of
- exFAT
- File systems:
EFI🔗
HowTo Create A GPT Disk With EFI System And exFAT Partitions Using Parted
File Systems🔗
- FUSE
- CVMFS: FUSE module which implements a HTTP read-only file system
- parallel and distributed
Labelling
1 2 3 4 5 6 7 8 | |
Mount🔗
1 2 | |
- Bind mount explained @StackExchange
-
Overlay filesystem: ArchWiki
1mount -t overlay overlay -o lowerdir=/lower1:/lower2:/lower3,upperdir=/upper,workdir=/work /mergedor in
/etc/fstab1overlay /merged overlay noauto,x-systemd.automount,lowerdir=/lower,upperdir=/upper,workdir=/work 0 0
Tools and Commands🔗
lsblkparted- only one to show free disk sectors:
# parted /dev/xxx print free - unit only works with specifying a disk 🤦♂️
- when letting parted align partitions for better performance (
-a optimal) specify start/end inM - can be used in scripts like
parted -s /dev/sda mklabel msdos mkpart primary ntfs 1M 100G mkpart primary ntfs 102400M 102912M mkpart primary 102912M
- only one to show free disk sectors:
fdisksgdisk: for example helpful to wipe partition tables viasgdisk --zap-all /dev/name- Allocate file of given size ^e79fc2
1 2 3 | |
- FSArchiver: save the contents of a file-system to a compressed archive file