– Hard disk partitioning and formatting:
1. Disk structure:
Spindle: The spindle is used to hold the disk. The disk will spin rapidly on the spindle, then contact discharge for data exchange. Track: We have platters and spindles and we need to store data, so we set up platters to store data. Sector: Because track access data is messy, we divide the sector.'Note:'
1.Sectors are not real, knowledge is a unit.2.The sector is the smallest unit. The unit is512Bytes.Copy the code
2. Linux disk creation process:
Hard disk identification -->> Partition -->> format -->> mount useCopy the code
We can see that we now have two hard drives, and we’re going to add disks.
Next all the way down to the figure below
complete
determine
Restart the host
lsblk
Copy the code
We have the hard drive and we partition it.
'Note:'We have two modes for partitioning, MBR and GPTCopy the code
The MBR.1.MBR also known as MSDOS partition mode, master boot record partition mode.2.MBR partitioning mode opens up one512The sector of bytes used to hold the boot program and partition table.3.The partition table size is64The partition table records the storage information of each partition. A partition16Bytes.4.The MBR is most4Two primary partitions. (If divided4Two primary partitions and the rest of our space is unusable.Copy the code
Partitions: primary, extended, logical
'Note:'
1.The extended partition cannot store data directly, but must be divided into logical partitions.2.In theory, extended partitions can be divided into an infinite number of logical partitions.Copy the code
Fdisk -lu /dev/sdcCopy the code
fdisk
1.N Creating a Partition2.P Viewing Partitions3.Wq Save the configuration and exit4.D Deleting a Partition5.M Displays the help manualCopy the code
Presentation:
lsblk
Copy the code
After we partition, we can’t store the data, we have to format it.
mkfs.ext4 /dev/sdc1
Copy the code
'Note:'
1.Format: ext3, ext4. XFS, VFAT and so on2.Ext4 works with C63.XFS works with C7Copy the code
After formatting, we mount it.
mount /dev/sdc1 ./dvd
Copy the code
So we can use the storage space we’ve built.
3. Unmount the hard disk:
Umount./ DVD (unmount)Copy the code
fdisk /dev/sdc
Copy the code