Storages
Storages
Storages
BIOS -> MBR -> 4 Partitions -> logical partitions numbering starts with 5
parted /dev/sdb
print will show if there is a current partition table
mklabel msdos | gpt
mkpart part-type name fs-type start end
part-type: applies to MBR only and sets primary, logical, or extended partition
name: arbitrary name, required for GPT
fs-type: does NOT modify the filesystem, but sets some irrelevant file system
dependent medadata
start end: specify start and end, counting from the beginning of the disk
Example: mkpart primary 1024MiB 2048MiB
Alternatively, use mkpart in interactive mode
Limitations of MBR
Limited to 4 primary partitions
Single byte partition code
32 bit address limits disk size to 2TB
Extended partition uses linked logical partitions but one lost link can
lose all
making File Systems
cp /usr/lib/systemd/system/tmp.mount /etc/systemd/system/sales.mount
Name of the mount unit should be same as that of the directory. If it is a sub-
directory then the naming of the mount unit will be sales-mydir.mount
vim /etc/sales.mount
[Mount]
What=LABEL=sales
where=/sales
Type=ext4
Options=defaults
systemctl daemon-reload
Systemctl --enable now sales.mount
Xfs File Systems
The xfsdump utility can be used for creating backups of XFS formatted
devices and considers specific XFS attributes
xfsdump only works on a complete XFS device
xfsdump can make full backups(-l 0) or different levels of incremental
backups
xfsdump -l 0 -f /backupfiles/data.xfsdump /data creates a full backup of the
contents of the /data directory
The xfsrestore command is used to restore a backup that was made with
xfsdump using xfsrestore -f /backupfiles/data.xfsdump /data
xfsrepair command can be manually started to repair broken XFS file
systems
GUID Partition Table
Advantages of GUID Partition Table
Volume Group
Device mapper is the system that the kernel uses to interface storage devices
Device mapper generates meaning less names e.g. /dev/dm-0 /dev/dm-1
Meaningful names are provided as symbolic links through /dev/mapper
e.g. /dev/mapper/vgdata-lvdata
Alternatively use LVM generated symbolic links /dev/vgdata/lvdata
LVM Resize
Note:- While extending use lvextend and then resize2fs for resizing file
system size and while reducing first reduce file system size and then use
lvreduce
LVM Resize Reduce
umount /mnt/directory
e2fsck -f /dev/vgdata/lvdata
resize2fs /dev/vgdata/lvdata 500M
lvreduce /dev/vgdata/lvdata -L 500M
mount -a
LVM Snapshots