Vmware:ubuntu 12.04 Adding a new hard disk

Source: Internet
Author: User
Tags uuid

http://blog.csdn.net/hanpengyu/article/details/7475645
I. Setup steps for VMware new disks (recommended: When setting up the virtual, do not run the virtual machine system, or add a new virtual disk to restart the virtual machine) 1. Select "VM"----"setting" and open, position the cursor on hard disk, then click the Add button below

2. Click Next to perform the next step

3. Follow the prompts to create a virtual disk and click Next

4, according to the default, select the SCSI format of the disk, click Next to perform the next step

5, follow the default click Next to complete the virtual disk add

Second, the virtual machine in Windows to Virtual disk mount

method is simple compared to the actual computer, as long as the newly created Vdisk is formatted in Device Manager, it will be used normally

Settings based on Windows are simpler, so there is no

1. Right-click on "My Computer"-"Manage"-"Disk Management" and you will see that the newly allocated disk does not have a partition

2. Right-click on "New Volume" (unpartitioned disk), select "New", follow the wizard, select the hard disk partition mode, format the hard drive to use

Third, the virtual machine in Linux for virtual disk mount

1. Use the "fdisk-l" command to view the current system's partitions (if the system was run when the vmware--setting was set up, the situation would occur: No new disk is recognized as SDB), workaround, restart the virtual machine: Shutdown-r now

2, if the first step is to shut down the system in the virtual machine, then use the "fdisk-l command" when the new disk SDB (but the prompt is not partitioned)

3. Partition and format the new disk:

Input Fdisk/dev/sdb

Terminal will prompt: Command (m for help):

4, on the basis of the previous step input: M will appear the following prompt:

5. Then follow the prompts to enter: N

The following prompt appears, and then enter P and 1 to

The start and end addresses of the volume are then indicated, and the default is to press ENTER (meaning that only one zone is divided)

6. Enter "W" to Save and launch

7, re-use "fdisk-l" this command to see the/DEV/SDB1 (indicating that the partition work has been completed)

8, the new partition to format: Format the ext3 file system can be

9, the following is for the Sub-district of the/DEV/SDB1 this partition to mount and access

9, 1 manual mount: use MOUNT/DEV/SDB1/directories to mount (self-defined)

On Access: the CD/mount directory can be stored and accessed

9, 2 automatic mount: Modify/etc/fstab can

Use Vim/etc/fstab to open the configured file and add the following line of text

/dev/sdb1/media (You can set this mount directory yourself) ext3 defaults 0 1

Note:

Http://www.linuxidc.com/linux/2012-06/63076p3.htm

Mount the new partition to the ~/docs directory and modify the mount point owner so that permissions are easily written.

mkdir docs
sudo mount/dev/sdb5 docs
sudo chown-r yourname:yourname docs (attached to/home/yourname/docs in this case)

6. Finally, we have to find a way to get these two new partitions to be mounted automatically after booting. Using the Mount command only mounts the partition on this login, but once the computer restarts, it needs to be mounted again. /etc/fstab file records the computer boot need to automatically mount the partition information, to achieve automatic mount, only need to add a record to the/etc/fstab file can be. For more detailed information on Fstab, please refer to the/etc/fstab document brief description.

We first use the Blkid command to find the UUID of the new partition:

shell$ sudo blkid
/dev/sda1:uuid= "4c298c2c-2b21-417e-b7ab-4ba4a64c3e1e" type= "Ext4"
/dev/sda5:uuid= "ff694e58-0b7e-473e-9d02-c91404202b8d" type= "swap"
/dev/sdb5:uuid= "f23cd423-9a4d-4e4e-aa9d-4220f1383760" type= "Ext4"

Then open the/etc/fstab file and add the following two lines of content to the last:

Uuid=f23cd423-9a4d-4e4e-aa9d-4220f1383760/home/amonest/docs EXT4 Defaults 0 0

Restart your computer and check to see if two new partitions are automatically mounted.

Replace Home

Http://jingyan.baidu.com/article/7c6fb4287c853880652c9067.html

Ubuntu add a new hard drive and replace the home partition

Tools/Materials
    • HDD One, Ubuntu system one

Method/Step
  1. Connect the hard drive to the chassis, power on, and see if the existing drive information

    As you can see, there are two drives, SDA and SDB, respectively.

  2. Execute fdisk-l and make sure we're adding SDB.

    As can be seen, SDB this hard disk does not have the partition information, the size also conforms, the explanation is we to add the hard disk

  3. Hard disk partition:

    Since the Fdisk partition can be up to 2T, it is partitioned using parted.

    Execute Command parted/dev/sdb

    You can access Help by typing it.

  4. Because MBR partitioned tables do not support partitions larger than 2.2TB (2.2x1012 bytes), there are some BIOS systems that replace MBR partitioned tables with GPT partitioned tables in order to support large-capacity hard disks.

    So here's the GPT partition table.

  5. Perform fdisk–l view hard drive details

  6. As you can see, SDB1, that is, the partition is just divided, the following SDB1 partition operation

    Build Ext4 File System (customizable)

  7. Set up a temporary folder for this hard drive to mount temporarily, if you do not need to replace the home partition, this step can be omitted

    sudo mkdir/new_home

    Mount the hard drive under this folder.

  8. Synchronize the/home folder to this hard disk, and if you do not need to replace it, this step can omit

    If you have more files, it can take a long time.

    Plus the--exclude option prevents prompting for GVFS permissions issues.

    Note: The real command is sudo rsync–axs–-exclude= '/*/.gvfs '/home/. /new_home/.

    After syncing, you can see that the New_home folder already has everything under the/home folder, including the permissions of individual users.

  9. Re-mount the hard drive

    The following is the details of the/etc/fstab file, and the Fstab file is the configuration file that configures the boot mounted hard disk. UUID can be viewed with the command blkid/dev/sdb, If you do not need to replace the home partition, You can change home to the name of the folder you want to mount

    It is also recommended to mount using the UUID instead of the/DEV/SDB1, because the UUID is the unique identifier of the hard disk.

    Mount the original/home/on the hard disk mounted in the new folder/old_home/, you can start the purpose of the backup, to be sure that everything is normal after the partition can be formatted old_home for other purposes

Vmware:ubuntu 12.04 Adding a new hard disk

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.