Add hard disk space to the Linux virtual machine __linux

Source: Internet
Author: User
Preface: We just started installing Ubuntu on the virtual machine, always reluctant to allocate too much hard disk space. But with a long time to use the hard drive is not enough. 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 a hard drive without reloading the system. Here's how to implement it.


Two.


1. First of all, the Ubuntu shutdown.


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


3. Click the Add button at the bottom of the hardware and select hard Disk-->next-->next-->disk size (GB) to be the new hard drive sizes-->next-->finish--> Ok. This way, in VMware's devices, a hard Disk 2 is a lot more.


Third, the next step is to enter Ubuntu, the new hard drive in the mount.


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


You can see one more/dev/sdb.


2.


The following 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//format the entire new hardware without partitioning.


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


The Data block=0


Maximum filesystem blocks=2147483648


Groups block


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


180 days, whichever comes. Use Tune2fs-c or-i to override.


root@sparkle-desktop:~#


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.


Use the DF command to view the mount condition


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


root@sparkle-desktop:~# Gedit/etc/fstab


Depending on the format below


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


We add ourselves:


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


Reboot, which completes all the steps to increase the hard drive.

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.