linux partitioning formatting mounting commands are described in detail
- 2020-05-13 04:22:11
- OfStack
Commands for partitioning, formatting, and mounting under linux
Although Linux 1 has been playing, but it is not very familiar with the operation of the hard disk, today is free, I sorted it out.
1, the partition
fdisk -l
You can see the hard drive information like /dev/sda, /dev/vda, /dev/hda. sd is the scsi port hard disk, sda is the first block, sdb is the second block. hd is the IDE port hard disk, vd is the virtual hard disk
fdisk /dev/vda
Use this command to partition. After partitioning, /dev/vda will become /dev/vda1, /dev/vdb2, etc
root#partprobe
This command gives effect to the partition
2. Formatting
mkfs.ext3 /dev/vda1
This command formats the partition as EXT3
3, mount
mount /dev/vda1 /opt
This command mounts /dev/vda1 to /opt
df -h
View the mount
4. Start up and mount automatically
Edit the /etc/fstab file and append the command from step 3 to the end of the file
Thank you for reading, I hope to help you, thank you for your support of this site!