Check the parted -l partition
Model: VMware Virtual disk (scsi) Disk /dev/sda: 537GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 768MB 767MB primary ext2 boot 2 769MB 537GB 536GB extended 5 769MB 537GB 536GB logical lvm Model: VMware Virtual disk (scsi) Disk /dev/sdb: 4398GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 4398GB 4398GB ext4 primary Model: Linux device-mapper (linear) (dm) Disk /dev/mapper/Ubuntu16–vg-swap_1: 1028MB Sector size (logical/physical): 512B/512B Partition Table: loop Disk Flags:
Number Start End Size File system Flags 1 0.00B 1028MB 1028MB Linux - Swap (v1) Model: Linux device-mapper (linear) (dm) Disk /dev/mapper/Ubuntu16--vg-root: 535GB Sector size (logical/physical): 512B/512B Partition Table: loop Disk Flags: Number Start End Size File System Flags 1 0.00B 535GB 535GB ext4Copy the code
/dev/sdb GNU parted 3.2 Using /dev/sdb Welcome to GNU parted! Type ‘help’ to view a list of commands. (parted) # Enter the required parameters
Format partitions (parted only for disks in GPT format) (parted) mkLabel GPT partition (parted) mkPart Primary 0% 100% or (parted) mkPart Primary 1 800 Ext4 /dev/sdb1 Create a directory to mount mkdir /database mount mount /dev/sdb1/database Other commands related to parted
Viewing Information (parted)) p Delete a partition (parted) rm 1 (parted) rm 2 mount Related
Check whether an error message is displayed. Mount -a Check the mount. Mount Delete umount /database Automatically mounts upon startup
sudo vi /etc/fstab
End of file add
/dev/sdb1/database ext4 default 0 0 1 2 3 Or run the echo “/dev/sdb1/database ext4 defaults 0 0” command >> /etc/fstab — — — — — — — —
Original link: blog.csdn.net/weixin_4388…