20G disk space is not mounted!

今天打算在阿里云上安装eve-ng,感觉磁盘空间可能不足,打开控制台,发现还有一个20G的数据盘,觉得勉强够用,就直接在终端上通过lsblk查看

[MDaliyun ~]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0    7:0    0 63.5M  1 loop /snap/core20/2015
loop2    7:2    0 40.4M  1 loop /snap/snapd/20671
loop3    7:3    0 11.9M  1 loop /snap/kubectl/3164
loop4    7:4    0 63.9M  1 loop /snap/core20/2105
loop5    7:5    0 40.9M  1 loop /snap/snapd/20290
loop6    7:6    0 11.9M  1 loop /snap/kubectl/3149
vda    252:0    0   40G  0 disk 
└─vda1 252:1    0   40G  0 part /
vdb    252:16   0   20G  0 disk 

好家伙,这一看不要紧,发现vdb这块盘虽然启动2年了,但是一直没有挂载,就这么白白浪费了2年!
马上格式化,挂载,把它用起来,为了省事,直接让chatgpt出马:

The output /dev/vdb: data from the file -s /dev/vdb command indicates that the /dev/vdb block device does not have a recognizable filesystem or partition table. This typically means that the disk is either unformatted or contains raw data that is not structured in a manner recognized by the file command.

Given this situation, if you intend to use /dev/vdb for storage, the next steps would involve creating a filesystem on it. Here's how you can do it:

Create a Filesystem on /dev/vdb
Choose a Filesystem Type: Decide on the type of filesystem you want to create. Common choices include ext4 for general use, xfs for high-performance environments, and btrfs for systems requiring advanced features like snapshotting.
Create the Filesystem: Use the mkfs command to create a filesystem. For example, to create an ext4 filesystem on /dev/vdb, you would use:
bash
Copy code
mkfs.ext4 /dev/vdb
Replace ext4 with your filesystem of choice if different.
Mount the Filesystem
After creating the filesystem, you can mount it to make the storage available for use:

Create a Mount Point: This is the directory where the disk's contents will be accessible. For example, to create a mount point at /mnt/data, use:
bash
Copy code
mkdir /mnt/data
Mount the Disk: Mount the newly formatted disk to the mount point:
bash
Copy code
mount /dev/vdb /mnt/data
Ensure Persistent Mounting Across Reboots
To automatically mount the disk after a reboot, you'll need to add an entry to the /etc/fstab file:

Find the UUID of /dev/vdb: The UUID is a unique identifier for the disk, which is preferable to use in the /etc/fstab file instead of the device name (/dev/vdb) since it won't change between reboots.
bash
Copy code
blkid /dev/vdb
Edit /etc/fstab: Add a line to this file with the disk's UUID and mount information. Open the file in a text editor (like nano or vi), and add a line similar to:
plaintext
Copy code
UUID=<your-uuid> /mnt/data ext4 defaults 0 2
Replace <your-uuid> with the actual UUID you obtained from the blkid command.

使用mkfs.ext4这个命令,作为通用存储,结果如下:

[MDaliyun ~]# mkfs.ext4 /dev/vdb
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 5242880 4k blocks and 1310720 inodes
Filesystem UUID: 811e4057-5c8b-45e2-8fb9-40e023ec72cc
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done   

然后挂在在data下面:

[MDaliyun /]# mkdir /mnt/data
/
[MDaliyun /]# file -s /dev/vdb  
/dev/vdb: Linux rev 1.0 ext4 filesystem data, UUID=811e4057-5c8b-45e2-8fb9-40e023ec72cc (extents) (64bit) (large files) (huge files)
[MDaliyun /]# mount /dev/vdb /mnt/data
[MDaliyun /]# blkid /dev/vdb
/dev/vdb: UUID="811e4057-5c8b-45e2-8fb9-40e023ec72cc" TYPE="ext4"

再使用lsblk看看,成功了

不过正事还没有完,eve-ng是虚拟机,没法在已经虚拟化的机器上安装(阿里云不支持vmx,也就是硬件已经使用了一次kvm的vmx,虚拟机里就无法支持二次的vmx了),但是我的本地电脑也没有空间继续安装vmware,如何是好?

https://zhuanlan.zhihu.com/p/548997684
我们知道,在Intel处理器上,KVM使用Intel的vmx(virtul machine eXtensions)来提高虚拟机性能, 即硬件辅助虚拟化技术, 现在如果我们需要测试一个openstack集群,又或者单纯的需要多台具备"vmx"支持的主机, 但是又没有太多物理服务器可使用, 如果我们的虚拟机能够和物理机一样支持"vmx",那么问题就解决了,而正常情况下,一台虚拟机无法使自己成为一个hypervisors并在其上再次安装虚拟机,因为这些虚拟机并不支持"vmx"

嵌套式虚拟nested是一个可通过内核参数来启用的功能。它能够使一台虚拟机具有物理机CPU特性,支持vmx或者svm(AMD)硬件虚拟化。