How to increase the virtual machine Ubuntu HDD in VirtualBox

Source: Internet
Author: User
Tags file system

Setting up--〉 Storage

Click to select Controller--〉 Create a new virtual disk

Allocate size allocation size to your own needs

Then attribute that column to set "virtual hard disk (D)" as the first IDE controller from the channel; Click OK


A preface: We just started to install Ubuntu on the virtual machine, always reluctant to allocate too much hard disk space. But it's not enough to use the hard drive for a long time. One of the stupidest ways to do this is to reload the system, but it's time-consuming. It would be nice if you could add the hard drive without reloading the system. Here's how to implement it.

  two.

1. First put Ubuntu shutdown.

2. Click on the menu in VMware vm-->settings

3. In hardware, click the Add button below and choose hard disk-->next-->next-->disk size (GB) is the size of the new drive-->next-->finish--> Ok. This will have a hard Disk 2 in VMware's devices.

  third, the next step is to go into Ubuntu and mount the new hard drive in.

1.

root@sparkle-desktop:~# fdisk-l

disk/dev/sda:17.1 GB, 17179869184 bytes

255 heads, Sectors/track, 2088 cylinders

Units = Cylinders of 16065 * 8225280 bytes

Disk IDENTIFIER:0X000AF2A2

Device Boot Start End Blocks Id System

/DEV/SDA1 * 1 993 7976241 Linux

/dev/sda2 994 1044 409657+ 5 Extended

/dev/sda5 994 1044 409626, Linux Swap/solaris

disk/dev/sdb:8589 MB, 8589934592 bytes

255 heads, Sectors/track, 1044 cylinders

Units = Cylinders of 16065 * 8225280 bytes

Disk identifier:0x00000000

Disk/dev/sdb doesn ' t contain a valid partition table

2.

Here is the format of the Ext3 file system

root@sparkle-desktop:~# mkfs-t Ext3/dev/sdb

MKE2FS 1.40.8 (13-mar-2008)

/dev/sdb is entire device, not just one partition!

Proceed anyway? (y,n) Y//The whole new hardware is formatted, not partitioned.

Filesystem label=

OS Type:linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

524288 inodes, 2097152 blocks

104857 blocks (5.00%) reserved for the Super user

First Data block=0

Maximum filesystem blocks=2147483648

Block groups

32768 blocks per group, 32768 fragments per group

8192 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing Inode Tables:done

Creating Journal (32768 blocks): Done

Writing superblocks and filesystem accounting Information:done

This filesystem would be automatically checked every mounts or

Whichever comes first. Use Tune2fs-c or-i to override.

3.

root@sparkle-desktop:~# Cd/home

root@sparkle-desktop:/home# mkdir Work

root@sparkle-desktop:/home# mount/dev/sdb Work//mount the hard drive to the work directory.

root@sparkle-desktop:/home# CD Work

root@sparkle-desktop:/home/work# ls

Lost+found

4.

Check the Mount status with the DF command

root@sparkle-desktop:~# DF

Filesystem 1k-blocks used Available use% mounted on

/DEV/SDA1 7913216 7803524 0 100%/

Varrun 257788 257548 1%/var/run

Varlock 257788 0 257788 0%/var/lock

Udev 257788 257740 1%/dev

Devshm 257788 257744 1%/DEV/SHM

LRM 257788 39760 218028 16%/lib/modules/2.6.24-19-generic/volatile

/dev/sdb 8322488 149632 7753428 2%/home/work

Gvfs-fuse-daemon 7913216 7803524 0 100%/root/.gvfs

See/dev/sdb 8322488 149632 7753428 2%/home/work

One, visible success.

5. Implement automatic mount on startup.

root@sparkle-desktop:~# sudo gnome-open/etc/fstab

According to the following format

# <file system> <mount point> <type> <options> <dump> <pass>

We add by ourselves:

/dev/sdb/home/work ext3 defaults 0 0

Reboot so you can complete all the steps to add the hard drive.

Source: http://www.examda.com/linux/fudao/20091221/091033318-3.html

6. The owner of the work folder loaded by the above steps is root, there are many permissions restrictions, I use sudo chmod 777 xxx (folder name) to modify permissions and sudo chown ubuntu (my username) work to modify the folder owner, Then you can copy and paste the file to the folder.

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.