How to mount and detach a new hard disk in a vmwarevm in a Linux System

Source: Internet
Author: User

In a vmwarevm, mount or detach a new hard disk in a Linux system: 1. Start the vm, choose vm> Settings, and add a SCSI disk in the Wizard. Go to the Linux system. 2. fdisk-l will see a new setting. If you have a hard disk (sda1, sda3. ..), the newly added disk should be (/dev/sdb ). [Root @ localhost ~] # Fdisk-l Disk/dev/sda: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065*512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sda1 * 1 13 104391 83 Linux/dev/sda3 14 1044 8281507 + 83 Linux Disks /dev/sdb: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065*512 = 8225280 bytes Disk/dev/sdb Doesn't contain a valid partition table 3. partition: [root @ localhost ~] # Fdisk/dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. changes will remain in memory only, until you decide to write them. after that, of course, the previous content won't be recoverable. the number of cylinders for this disk is set to 1044. there is nothing wrong with that, but this is larger than 1024, and cocould in certai N setups cause problems with: 1) software that runs at boot time (e.g ., old versions of LILO) 2) booting and partitioning software from other OSs (e.g ., dos fdisk, OS/2 FDISK) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w (rite) Command (m for help ): m Command action a toggle a bootable flag B edit bsd disklabel c toggle the dos compatibility flag d delete a partition l Ist known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) command (m for help): n Command action e Extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-1044, default 1 ): using default value 1 Last cylinder or + size or + sizeM or + sizeK (1-1044, default 1044): Using default value 1044 Command (m for help ): w The partition table has been altered! Calling ioctl () to re-read partition table. Syncing disks. [root @ localhost ~] # Fdisk-l Disk/dev/sda: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065*512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sda1 * 1 13 104391 83 Linux/dev/sda3 14 1044 8281507 + 83 Linux Disks /dev/sdb: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065*512 = 8225280 bytes Device Boot St Art End Blocks Id System/dev/sdb1 1 1044 8385898 + 83 Linux 4. Format: [root @ localhost ~] # Mkfs-t ext3/dev/sdb1 mke2fs 1.39 (29-May-2006) Filesystem label = OS type: Linux Block size = 4096 (log = 2) fragment size = 4096 (log = 2) 1048576 inodes, 2096474 blocks 104823 blocks (5.00%) reserved for the super user First data block = 0 Maximum filesystem blocks = 2147483648 64 block groups 32768 blocks per group, 32768 fragments per group 16384 inodes per group Superblock backups stored on blocks: 327 68,983 04, 163840,229 376, 294912,819 200, 884736,160 5632 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 31 mounts or 180 days, whichever comes first. use tune2fs-c or-I to override. 5. Load: [root @ localhost ~] # Mount/dev/sdb1/u01/app/oracle [root @ localhost ~] # Df-h Filesystem Size Used Avail Use % Mounted on/dev/mapper/VolGroup00-LogVol00 6.7G 5.8G 576 M 92%/dev/sda1 99 M 12 M 82 M 13%/boot tmpfs 233 M 0 233 M 0%/dev/shm/dev/sdb1 7.9G 147 M 7.4G 2%/u01/app/oracle 6. Edit the fstab file (otherwise, the system will not be saved after the computer is restarted. previous mounting operations): [root @ localhost ~] # Vi/etc/fstab/dev/VolGroup00/LogVol00/ext3 defaults 1 1 LABEL =/boot ext3 defaults 1 2 devpts/dev/pts devpts gid = 5, mode = 620 0 0 tmpfs/dev/shm tmpfs defaults 0 0 proc/proc defaults 0 0 sysfs/sys sysfs defaults 0 0 0/dev/VolGroup00/LogVol01 swap defaults 0 0/ dev/sdc1/u03 ext3 defaults 1 1/dev/sdb1/u01/app/oracle ext3 defaults 1 1 # Beginning of the block added by the VMware Software. host: // mnt/hgfs vmhgfs ults, ttl = 5 0 0 # End of the block added by the VMware software Uninstall: [root @ localhost ~] # Umount/dev/sdb1 [root @ localhost ~] # Df-h Filesystem Size Used Avail Use % Mounted on/dev/mapper/VolGroup00-LogVol00 6.7G 5.8G 576 M 92%/dev/sda1 99 M 12 M 82 M 13%/boot tmpfs 233 M 0 233 M 0%/dev/shm author hongzhguan

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.