New Hard Disks added to Ubuntu

Source: Internet
Author: User

From http://blog.csdn.net/ymj7150697/article/details/5810683

1. Disable Ubuntu In the VM, add a new hardware device in "Settings", select hard disk, and click Next.

2. Select hard disk type. You can select ide or SCSI. Select SCSI here.

3. Select the location of the new virtual disk and name it ubuntu2.vmdk.

4. Set the hard disk size. Select allocate all disk space now. If this option is not selected, the hard disk is relatively small at the beginning. However, as the hard disk reads and writes access, the virtual hard disk files 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 create a new hard disk.

5. 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

From http://blog.csdn.net/ymj7150697/article/details/5810683

1. Disable Ubuntu In the VM, add a new hardware device in "Settings", select hard disk, and click Next.

2. Select hard disk type. You can select ide or SCSI. Select SCSI here.

3. Select the location of the new virtual disk and name it ubuntu2.vmdk.

4. Set the hard disk size. Select allocate all disk space now. If this option is not selected, the hard disk is relatively small at the beginning. However, as the hard disk reads and writes access, the virtual hard disk files 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 create a new hard disk.

5. 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

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.