How to add a hard disk when the disk space of Ubuntu is insufficient

Source: Internet
Author: User
Remount a hard disk in Ubuntu: 1. Disable the Ubuntu Virtual Machine in Vmware, add a new hardware device in settings, and select HardDisk. (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. Here, set it to 2 GB and select All

Remount a hard disk in Ubuntu: The method 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 2 GB and select Allocate all disk space now. If this option is not selected, the hard disk is 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 2 GB space and will not increase. Click Finish to create 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
Disk/dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Disk identifier: 0x00000000

Here we can see that/dev/sdb is the newly added hard disk, and you 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/media on the terminal to create a mount point for the new hard disk.

On the terminal, type mount/dev/sdb1/media.

If you want to enable automatic mounting

Modify the/etc/fstab file and add the following lines:

/Dev/sdb1/media ext3 defaults, 0 1

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.