Add a hard drive to a Linux virtual machine in VMware

Source: Internet
Author: User

Add a hard disk to a VMware Linux virtual machine

1, first the virtual machine power OFF, click on the "Add" in the bottom left corner of the VM Setting dialog box, select "Hard Disk", then select "Create a new Virtual disk", allocate capacity, other default configuration is OK.

2, start the virtual machine system, log on with the root, using the # ls/dev/sd* command can see the last one SDB or SDC (if the third hard drive added is SDC), it does not have SDB1 and sdb2 or SDC1 and SDC2 and other device files, Description The system checked out the hard drive but has not yet formatted the partition. This is the hard drive that you added in the previous step.
On the command line with Fdisk-l to see if the new hard disk is recognized, if you add an IDE hard disk, you should see the HDB, if it is a SCSI hard disk, see should be SDB. Www.2cto.com

disk/dev/sdc:1073 MB, 1073741824 bytes
255 heads, Sectors/track, cylinders
Units = Cylinders of 16065 * 8225280 bytes
Disk identifier:0x00000000

DISK/DEV/SDC doesn ' t contain a valid partition table

Because I've added a hard drive before, this shows SDC.

3, using FDISK/DEV/SDC, (for the following parameter is to make one of the input)
Then enter a parameter similar to the following: N (add a new partition) P (establish primary partition) 1 (First partition) 1 (first cylinder) 1024 (last cylinder) W (save)
Select "W" in these options, the partition table will be written to the hard disk and exit, then use FDISK-L to see:

disk/dev/sdc:1073 MB, 1073741824 bytes
255 heads, Sectors/track, cylinders
Units = Cylinders of 16065 * 8225280 bytes
Disk identifier:0x5404b953

Device Boot Start End Blocks Id System
Www.2cto.com
4, the MKFS command to format it, MKFS.EXT3/DEV/SDC1 (ext3 refers to the type of disk)

5. Create a directory to mount the new hard drive, such as creating a/work (mkdir/work)
Then mount it with the Mount command, Mount-t ext3/dev/sdc1/work

6. Finally, modify the/etc/fstab file to append the new hard drive to mount to the back, as follows:
Vi/etc/fstab
/dev/sdb1/work ext3 rw,user,auto,exec 1 2
/dev/sdc1/work Defaults 1 2
Defaults = = rw, suid, dev, exec, auto, Nouser, and async.

Add a hard drive to a Linux virtual machine in VMware

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.