During the development process, we often find that the virtual machine's hard disk is not enough. In this case, we need to expand the hard disk for the virtual machine. You can use the following method.
(1) In VM -- settings -- hard disk -- add, you can choose to create a new hard disk or add an existing hard disk.
(2) After the system is started, you can use fdisk-L/dev/SD * in the terminal to list newly added hard disks, such as SDB. Assume that the SCSI hard disk is used.
(3) fdisk/dev/SDB, enter the fdisk operation interface "command (M for help ):". Type "N" to create a new partition, and "p" to create the primary partition. Then, select the primary Partition Number, select "1", and press ENTER for two consecutive times, set the start range of the cylindrical partition by default, that is, all the storage space is allocated to the previously created partition, and enter "W" to write the partition information.
(4) format and format is relatively simple, and mkfs can be done with one command. ext4/dev/sdb1. Here we format the hard disk as an ext4 file system. Note that there is an additional "1" behind the SDB ", this indicates the primary partition we created in the previous step.
(5) use the sudo blkid/dev/sdb1 command to list the uuid information of the partition, for example:
/Dev/sdb1: UUID = "abd75825-233b-4719-b216-60fed7baa40d" type = "ext4"
(6) Add the Mount list to/etc/fstab. After the system is started, it will be automatically mounted.
UUID = e9718dc1-d675-4b7b-a3c3-755248d03d39/home/share/vmdisk1 ext4 errors = remount-ro 0
UUID = 0cb5c487-8e06-4df4-941a-4fa043cac813/home/share/vmdisk2 ext4 errors = remount-ro 0
Both disks are mounted to the/home/share/vmdisk1 vmdisk2 File System Using the ext4 file system.