Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to add a disk to Vmware

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to add disks in Vmware, the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

When creating a Linux, the utilization of disk space increases as the usage increases, so you need to add or expand the disk at this time.

For example, the disk of this Linux (CentOS 7.3) is 20 gigabytes, and it has been used to nearly 80%.

[root@mail ~] # cat / etc/redhat-release CentOS Linux release 7.3.1611 (Core) [root@mail ~] # dfFilesystem 1K-blocks Used Available Use% Mounted on/dev/mapper/cl_angular-root 17811456 13985948 3825508 79% / devtmpfs 1521180 01521180% / devtmpfs 1532160 01532160 0% / dev/shmtmpfs 1532160 877615233841% / runtmpfs 1532160 0 1532160 / sys/fs/cgroup/dev/sda1 1038336 123500 914836 12% / boottmpfs 306432 0 306432% / run/user/0 [root@mail ~] #

Expand disk or add disk

There are two ways under Vmware:

Add disk

Extended disk

Note: the expansion disk needs to be in a stopped state of this virtual machine, and the number of the expansion is the expected size after the expansion, such as 20g in advance, if you want to expand 10G, you should enter 30. This article uses extended disks.

Confirm statu

After expansion, restart linux and find that the state of df has not changed

[root@mail ~] # dfFilesystem 1K-blocks Used Available Use% Mounted on/dev/mapper/cl_angular-root 17811456 13985948 3825508 79% / devtmpfs 1521180 01521180% / devtmpfs 1532160 01532160 0% / dev/shmtmpfs 1532160 8776 15233841% / runtmpfs 1532160 01532160 0% / sys/fs/cgroup/dev/sda1 1038336 123500 914836 12% / boottmpfs 306432 0 306432 / run/user/0 [root@mail ~] #

Use fdisk to confirm that the disk space has been expanded

[root@mail] # fdisk-lDisk / dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x0005ba89 Device Boot Start End Blocks Id System/dev/sda1 * 2048 2099199 1048576 83 Linux/dev/sda2 2099200 41943039 1992 1920 8e Linux LVMDisk / dev/mapper/cl_angular-root: 18.2 GB, 18249416704 bytes 35643392 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk / dev/mapper/cl_angular-swap: 2147 MB, 2147483648 bytes, 4194304 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes [root@mail]

You can see "Disk / dev/sda: 32.2 GB", which has expanded 10G space.

Extended partition

[root@mail] # fdisk / dev/sdaWelcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them.Be careful before using the write command.Command (m for help): nPartition type: P primary (2 primary, 0 extended, 2 free) e extendedSelect (default p): pPartition number (3free 4, default 3): First sector (41943040-62914559, default 41943040): Using default value 41943040Last sector, + sectors or + size {Kje Magi G} (41943040-62914559) Default 62914559): Using default value 62914559Partition 3 of type Linux and of size 10 GiB is setCommand (m for help): tPartition number (1-3, default 3): 3Hex code (type L to list all codes): l 0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris 1 FAT12 27 Hidden NTFS Win 82 Linux swap / So C1 DRDOS/sec (FAT- 2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT- 3 XENIX usr 3c PartitionMagic 84 OS/2 hidden C: C6 DRDOS/sec (FAT- 4 FAT16)

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report