In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to increase the virtual machine disk space of LINUX under VMware". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to increase the virtual machine disk space of LINUX under VMware".
There is a command line tool vmware-vdiskmanager.exe program under the VMware6.0 installation directory that can be used to modify the size of the virtual machine's hard disk. The methods are as follows:
1. Shut down the virtual machine; start the command prompt interface under Windows
two。 Enter the command into the installation directory of VMware (for example: d:\ VMware), enter "vmware-vdiskmanager" and press enter to display a description of the command.
3. Execute the following command: vmware-vdiskmanager-x 20Gb "J:\ VMware Space\ SUSE Linux 64-bit.vmdk" parameter-x indicates the virtual machine hard disk space to be expanded, followed by a number indicating the size to be expanded (for example, 20Gb, which represents the total disk capacity), and * * is the specific file of the virtual machine Linux to be operated. If there is a space in the path name, it must be enclosed in double quotation marks.
Wait about 20 minutes, finish execution, exit the command prompt window, restart VMware, and the virtual machine hard disk space has changed to 20GB. During this process, the installed Linux system will not be damaged.
If the original virtual machine hard disk has been divided into multiple partitions, then after expanding the hard disk space through vmware-vdiskmanager.exe, the additional partitions need to be partitioned and formatted in the virtual machine system.
4. Start the virtual machine system, log in with root (all subsequent steps should be logged in as root), and view it with fdisk-l on the command line. Since the original space size is directly modified here, you can see that the / dev/sda space has been changed to 21.4GB. If you add a virtual hard disk from the VMware menu, there will be one more / dev/sd?, here? Represents the hard disk number, * the hard disk number is a namely sda, the second is sdb, the third is sdc, and so on. Generally speaking, if the hard disk has not been added before, then the original hard disk is sda, and the virtual hard disk number added through the VMware menu is sdb. If the second hard drive you add is an IDE hard drive, you should see hdb. If it is a SCSI hard drive, you should see sdb.
Hawkzy:~ # fdisk-l
Disk / dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00067588
Device Boot Start End Blocks Id System
/ dev/sda1 1 95 763056 82 Linux swap / Solaris
/ dev/sda2 * 96 868 6209122 + 83 Linux
/ dev/sda3 869 1958 8755425 83 Linux
5. Use fdisk / dev/sda to enter menu items, m to list menus, p to list partition tables, n to add partitions, and w to save and launch. Since the system already has three primary partitions, the newly added space is divided into extended partitions, and then the extended partitions are re-partitioned. Since the extended partition here is only 5G, 5G is divided into one zone.
Hawkzy:~ # fdisk / dev/sda
Command (m for help): P
Disk / dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00067588
Device Boot Start End Blocks Id System
/ dev/sda1 1 95 763056 82 Linux swap / Solaris
/ dev/sda2 * 96 868 6209122 + 83 Linux
/ dev/sda3 869 1958 8755425 83 Linux
Command (m for help): n
Command action
E extended
P primary partition (1-4)
E
Selected partition 4
First cylinder (1959-2610, default 1959):
Using default value 1959
Last cylinder or + size or + sizeM or + sizeK (1959-2610, default 2610):
Using default value 2610
Command (m for help): P
Disk / dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00067588
Device Boot Start End Blocks Id System
/ dev/sda1 1 95 763056 82 Linux swap / Solaris
/ dev/sda2 * 96 868 6209122 + 83 Linux
/ dev/sda3 869 1958 8755425 83 Linux
/ dev/sda4 1959 2610 5237190 5 Extended
Command (m for help): n
First cylinder (1959-2610, default 1959):
Using default value 1959
Last cylinder or + size or + sizeM or + sizeK (1959-2610, default 2610):
Using default value 2610
Command (m for help): P
Disk / dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00067588
Device Boot Start End Blocks Id System
/ dev/sda1 1 95 763056 82 Linux swap / Solaris
/ dev/sda2 * 96 868 6209122 + 83 Linux
/ dev/sda3 869 1958 8755425 83 Linux
/ dev/sda4 1959 2610 5237190 5 Extended
/ dev/sda5 1959 2610 5237158 + 83 Linux
Command (m for help): W
6. Format it into ext3 format with the mkfs command.
Mkfs.ext3 / dev/sda5 7. Add folder / opt/sda5. The folder added here is to mount the newly added partition.
Mkdir-p / opt/sda5
8. Mount / dev/sda5 to / opt/sda5
Hawkzy:~ # mount / dev/sda5 / opt/sda5
View:
[email=hawkzy@hawkzy] hawkzy@ Hawkzy [/ email]: ~ > df-k
Filesystem 1K-blocks Used Available Use% Mounted on
/ dev/sda2 6111520 5433528 367536 94%
Udev 648032 60 647972 1% / dev
/ dev/sda3 8617868 7008780 1171320 86% / home
/ dev/sda5 5154852 141440 4751556 3% / opt/sda5
9. The files under the backup / usr folder are analyzed under / opt/sda5 / dev/sda2 / usr folder is very large, occupying 3.5 gigabytes of space. In order to free up system space, we will consider using the newly added partition as the image of / usr. The / dev/sda5 mounted by / opt/sda5 has 5G of space, which is enough to use.
Copy all files under / usr to / opt/sda5:
Cp-r / usr/* / opt/sda5/
10. Keep the / usr folder, but delete all files under / usr in preparation for mounting.
Cd / usr
Rm-rI *
11. Modify the / etc/fstab file, mount / dev/sda5 to the / usr directory, and add the following line
/ dev/sda5 / usr ext3 defaults 1 1
Restart after deletion
Init 6 .
After reboot, use the command to see whether the mount is successful or not. Under normal circumstances, it should be able to complete smoothly. If the mount fails, modify the file / etc/fstab and remount it with the command mount:
Mount / dev/sda5 / usr
[email=hawkzy@hawkzy] hawkzy@ Hawkzy [/ email]: ~ > df-k
Filesystem 1K-blocks Used Available Use% Mounted on
/ dev/sda2 6111520 2780952 3020112 48% /
Udev 648032 60 647972 1% / dev
/ dev/sda3 8617868 7011912 1168188 86% / home
/ dev/sda5 5154852 4675196 217800 96% / usr
Thank you for reading, the above is the content of "how to increase the virtual machine disk space of LINUX under VMware". After the study of this article, I believe you have a deeper understanding of how to increase the virtual machine disk space of LINUX under VMware. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.