The following operation will divide the data disk into a partition to use. 1, view the data disk before partitioning and formatting the data disk, using the "df–h" command, you cannot see the data disk, you can use the "fdisk-l" command to view. such as: [[email protected]/]# fdisk-ldisk/dev/xvda:21.5 GB, 21474836480 bytes255 heads, Sectors/track, 2610 cylinder Sunits = Cylinders of 16065 * 8225280 bytessector size (logical/physical): bytes/512 bytesi/o Size (minimum/op Timal): bytes/512 bytesdisk identifier:0x00078f9c Device Boot Start End Blocks Id system/dev/xvda1 * 1 2611 2097049 6 linuxdisk/dev/xvdb:536.9 GB, 536870912000 bytes255 heads, sectors/track, 65270 cylindersunits = cylinders of 160 * 8225280 bytessector size (logical/physical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 b Ytesdisk identifier:0x000000002, partition the data disk to perform "fdisk-s 56/dev/xvdb" command, partition the data disk, according to the prompt, enter "n", "P" "1", two times the carriage return, "Wq", the partition began, It will be finished soon. Help can be viewed via M: Command action A toggle a bootable flag B edit BSD Disklabel c toggle the DOS compatibility flag D Delete a part ition l list known partition types m print this menu n add A new partition o create a new empty DOS partition table p print the partition table Q quit without saving changes s CREA Te a new empty Sun Disklabel t change a partition ' s system ID u change display/entry units v Verify the partition table W Write table to disk and exit X extra functionality (experts only) N: Add a new partition P: Create a primary partition 1: Partition number 1, section partition: 1~4 first carriage return: primary cylind ER (1-73429, default 1): Family (cylinder) Start position second return: last cylinder, +cylinders or +size{k,m,g} (1-73429, default 73429): Wq: Save the settings you just made and exit 3. To see the new partition using the "fdisk-l" command you can see that the new partition XVDB1 has been established. 4. Format the new partition using the "MKFS.EXT4/DEV/XVDB1" command to format the new partition, the time to format varies depending on the size of the hard disk. 5. Add partition information Use "Echo '/dev/xvdb1/mnt ext3 defaults 0 0 ' >>/etc/fstab" (without quotation marks) command to write new partition information. Then using the "cat/etc/fstab" command to view, the following message indicates that the write was successful. Note: ubuntu12.04 does not support barrier, so the correct wording is: Echo '/dev/xvdb1/mnt ext3 barrier=0 0 0 ' >>/etc/fstab* if you need to mount the data disk to a folder separately, For example, to store the page alone, you can modify the above commands in the/mnt part of the command, directly mounted on the line Mount/dev/xvdb1/data 6, mount a new partition after viewing the "df-h" command to see, the following information appears to indicate the success of the Mount, You are ready to start using the new partition. [[email protected]/]# Df-hfilesystemSize used Avail use% mounted on/dev/xvda1 20G 1.6G 18G 9%/tmpfs 3.9G 0 3.9G 0%/dev/shm/dev/xvdb1 493G 198M 467G 1%/data
Linux system Mount data disk