root@ecs-27f7:/home/www# /sbin/fdisk -l Disk /dev/vda: 40 GiB, 42949672960 bytes, 83886080 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x68619eae Device Boot Start End Sectors Size Id Type /dev/vda1 * 2048 83884031 83881984 40G 83 Linux Disk /dev/vdb: 20 GiB, 21474836480 bytes, 41943040 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes root@ecs-27f7:/home/www# 我如何挂载20G这个硬盘,我要开机自动挂载。

root@ecs-27f7:/home/www# /sbin/fdisk -l Disk /dev/vda: 40 GiB, 42949672960 bytes, 83886080 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x68619eae Device Boot Start End Sectors Size Id Type /dev/vda1 * 2048 83884031 83881984 40G 83 Linux Disk /dev/vdb: 20 GiB, 21474836480 bytes, 41943040 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes root@ecs-27f7:/home/www# 我如何挂载20G这个硬盘,我要开机自动挂载。
用户500598139
06月17日
|
浏览 20

答案是:你需要编辑 /etc/fstab 文件,并添加一行来实现开机自动挂载。首先,找到硬盘的UUID或者设备名字,可以通过 sudo blkid 命令来查看。然后,在 /etc/fstab 文件中添加类似以下格式的一行:

复制代码
UUID=your_UUID_or_device_name  /mount/point  ext4  defaults  0  2

请将 your_UUID_or_device_name 替换为硬盘的UUID或设备名字,/mount/point 替换为你想要挂载的目标文件夹路径。最后,保存文件并重启系统以使更改生效。

我要提问
复制内容
分享给好友
AI编程问答网 免责声明:
以上内容除特别注明外均来源于网友提问,AI编程问答网回答,权益归原著者所有;