Manage your hard drive.
/dev/xxyn
SD SCSI SATA USB
HD IDE
Primary partition
Extended Partition 1-4
After logical partition 5
Fdisk-l hard disk name/partition name
Fdisk-l/DEV/SDA
How to partition a hard disk?
Divide the 500G hdd into 100G ext4 64G ext4
64G VFAT 120G Ext4
Fdisk-l/dev/sdb (hard disk to partition)
Fdisk/dev/sdb
n Create a partition
+100g
To format a partition:
Mkfs-t EXT4/DEV/SDB1
Mkswap
Mount
MOUNT-T partition type partition name mount point
Mount-t Ext4/dev/sdb1/project/fileone
Mount
Mount-o Mount post behavior partition name mount point
Ex
Mount-t Ext4-o Ro/dev/sdb5/project1/fileone
-O ro (indicates read only)
-O rw (readable and writable)
Unloading
Umount Partition Name
Umount mount point
Note: Try to mount the partition to an empty directory, and do not mount the partition frequently to
On different directories
How to boot automatically mount?
Modify/etc/fstab
For example add:
/dev/sdb1/project/finished EXT4 Defaults 0 0
What happens when there is a name coincidence when multiple hard disks are hot-swappable?
Processing method: Adding tags
Modify Label UUID
E2label partition device name label signature
E2LABEL/DEV/SDB5 Material_disk
Modify Add:
For example add:
/dev/sdb1/project/finished EXT4 Defaults 0 0
Label=material_disk/project_mooc/material EXT4 Defaults 0 0
The label will also appear coincident, how to handle?
Blkid list the UUID of all devices in the system
Modify the device in the/etc/fstab file to replace it with its corresponding UUID
For example:
uuid=d84d-883a/project/finished EXT4 Defaults 0 0
Linux HDD Management