The normal mount disk under Linux is fdisk, but Fdisk does not support GPT partitioning (the MBR partition table supports only 2T disks), so the disks to be mounted larger than 2T have to use parted for GPT disk operations!
Parted is powerful and can be used for both command lines and interactivity, and entering parted at the prompt enters interactive mode, and if you have more than one disk, you need to run select SDX (x as disk) for disk selection, or you can directly use the parted/dev/ SDX specify the appropriate hard drive ~
Here are two kinds of mounting plan, do a finishing ~
First, use Fdisk to mount the disk
code is as follows |
copy code |
1. Switch to root; 2. Run the command "FDISK/DEV/XVDB"; 3. According to the prompts, enter "n", "P", "1" in turn; 4. Press ENTER two times; 5. Enter "W" when prompted syncing disks. Indicates that the partition was completed successfully; 6. Enter "MKFS.EXT4/DEV/XVDB1" format the partition; 7. Enter "Mkdir/myidata" to build the Mount directory 8. Use the Mount/dev/xvdb1/home command to mount the partition. 9. Vi/etc/fstab Press I last line write /dev/xvdb1/home ext4 Defaults 0 0 |
Ii. use parted to mount disks larger than 2T
The code is as follows |
Copy Code |
PARTED/DEV/VDC (partition of 3T hard disk with part command) Mklabel GPT (you can get 3TB in a partition in GPT format) Unit TB (set to TB) Mkpart Logical 0 2 (set to a primary partition, size 3TB, start is 0, end is 3) Print (show partition size for settings) Quit (Exit parted program)
MKFS.EXT4/DEV/VDC1 (after executing the above command, use Fdisk-l to view the disk that has already been divided) Mount/dev/vdc1/home
|
Ok.