VMware adds a new hard disk to Ubuntu

Source: Internet
Author: User
VMWare does not have enough space to add a new hard disk (to) Virtual Machine Ubuntu to Ubuntu. Therefore, we need to increase the hard disk space and use VMware to add a new hard disk to Ubuntu.

The procedure is as follows:

1. Disable the Ubuntu Virtual Machine in VMware. In settings, add a new hardware device and select hard disk. (If you do not disable Ubuntu, you cannot add new hardware devices.) Click Next and select the hard disk type. You can select ide or SCSI. Select SCSI here and click Next, select the location of the new virtual disk and name it ubuntu2.vmdk. Next, set the hard disk size. I will set it to 5 GB and select allocate all disk space now. If this is not selected, at the beginning, the hard disk was relatively small, but with the read/write access to the hard disk, the virtual hard disk file will become larger and larger. After this option is selected, the virtual hard disk is fixed to the selected 5g space and will not increase. Click
Finish to start creating a new hard disk.

2. Start Ubuntu and log on as the root user.
Enter fdisk-L on the terminal.
----------------------------------------------------------------------------
Disk/dev/SDA: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk identifier: 0x000af383

Device boot start end blocks ID system
/Dev/sda1*1 1244 9992398 + 83 Linux
/Dev/sda2 1245 1305 489982 + 5 extended
/Dev/sda5 1245 1305 489951 82 Linux swap/Solaris

Disk/dev/SDB: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk identifier: 0x00000000

Disk/dev/SDB doesn' t contain a valid Partition Table
----------------------------------------------------------------------------

Here we can see that/dev/SDB is the newly added hard disk, and we need to partition the new hard disk.
Enter fdisk/dev/SDB on the terminal
Enter m to view the help information,
Type: n to add a new partition.
Type: P and select add primary partition.
Type: L and select the primary Partition Number as 1. In this way, the primary partition created is sdb1.
Then, fdisk will let you select the start value and end value of the partition and press Enter.
Finally, type w to save all and exit to complete the partition of the new hard disk.

3. format the disk.
Enter mkfs-T ext3/dev/sdb1 on the terminal
Format/dev/sdb1 in ext3 format

4. Mount the partition:
Manual mounting:
Enter mkdir/data on the terminal to create a mount point for the new hard disk.
Type Mount/dev/sdb1/data on the terminal and mount the new partition to the/data/directory.
Modify the/etc/fstab file and add the following lines:
/Dev/sdb1/Data ext3 defaults, 0 1

Everything is OK !!!

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.