Learn about Linux- about storage structure and disk partition
What the editor shares today is about the storage structure and disk partition. Maybe you are no stranger to the storage structure and disk partition, or you have never understood the storage structure and disk partition. But don't worry, today the editor will explain the principle of storage structure and disk partition with the simplest description.
Storage structure and disk Partition
Add a native hard disk
A / primary partition 1-4, extended partition 1-4, logical partition 5 ~
B / virtual machine shutdown, add hard disk by editing virtual machine settings
B / create a primary partition through the fdisk command: P "View partition information", n "add new partition", w "save and exit", Q "exit do not save" step is "add partition-format-mount" three steps
[important reminder] add a small bug for the system partition, and use the partprobe command "twice"
[format] because enter the mkfs name in the Shell terminal and then click the Tab key to complete the command twice
[Mount] you can create a directory or mount to an existing directory
C / create a swap partition through the fdisk command:
The difference from the ordinary primary partition is that the formatting and mounting commands are not the same.
Mkswap, a special format command for SWAP partitions. Use the free-m command to query the current swap partition size before mounting, and then mount it through swapon 'device name'.
two。 Mount network storage, take Nas as an example
A / Editor / etc/fstab vim/etc/fstab
B / mount operation, check operation, mount-t specify file system type, nfs network file system path mount directory
Mount network storage, take Windows as an example
Notice the file system type mount-t cifs-o username=*,password=** / / path / mount directory.
The above is about the storage structure and disk partition made a brief introduction, of course, the detailed use of the above differences have to be used by everyone to understand. If you want to know more, welcome to follow the industry information channel.