ubuntu挂载硬盘后重启硬盘丢失解决方案

Posted 每日learning

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ubuntu挂载硬盘后重启硬盘丢失解决方案相关的知识,希望对你有一定的参考价值。

执行命令


$ sudo blkid

/dev/sda1: UUID="2DD7-FB29" TYPE="vfat" PARTUUID="92f51aa7-276e-4b8c-a360-2542f0574b00"

/dev/sda3: UUID="978dffe7-52a2-4a32-a2ed-2136829d6240" TYPE="ext4" PARTUUID="06f7dda3-a521-427d-81c2-4b16bb8aa33e"

/dev/sda4: UUID="237573e4-4bfc-4fbe-bb9a-c26c87b8a494" TYPE="ext4" PARTUUID="967b2c24-55b7-4c89-81cd-4bcdf137ef29"

/dev/sda5: UUID="f33040da-3a00-460f-b721-212e50964626" TYPE="ext4" PARTUUID="ec53a3dc-790d-47a5-8be6-b49f543de9b3"

/dev/sda6: UUID="6647c018-c89c-4641-b04b-740e4042bb17" TYPE="swap" PARTUUID="e1686689-4d32-49ee-a2a7-020b835cdcd2"

/dev/sdb1: UUID="092fc25b-3baf-4a9f-bf83-0481833571e2" TYPE="ext3" PARTUUID="07fb746a-01"

/dev/sda2: PARTUUID="44c05b25-56bd-4108-b651-c12bc843fee3"

找到第二块硬盘的UUID标红部分

复制UUID



执行命令

$ sudo vim /etc/fstab 

# /etc/fstab: static file system information.

#

# Use 'blkid' to print the universally unique identifier for a

# device; this may be used with UUID= as a more robust way to name devices

# that works even if disks are added and removed. See fstab(5).

#

# <file system> <mount point>   <type>  <options>       <dump>  <pass>

# / was on /dev/sda4 during installation

UUID=237573e4-4bfc-4fbe-bb9a-c26c87b8a494 /               ext4    errors=remount-ro 0       1

# /boot was on /dev/sda3 during installation

UUID=978dffe7-52a2-4a32-a2ed-2136829d6240 /boot           ext4    defaults        0       2

# /boot/efi was on /dev/sda1 during installation

UUID=2DD7-FB29  /boot/efi       vfat    umask=0077      0       1

# /home was on /dev/sda5 during installation

UUID=f33040da-3a00-460f-b721-212e50964626 /home           ext4    defaults        0       2

# swap was on /dev/sda6 during installation

UUID=6647c018-c89c-4641-b04b-740e4042bb17 none            swap    sw              0       0

UUID=092fc25b-3baf-4a9f-bf83-0481833571e2  /home/smbfile        ext3    defaults  0       0 

把复制的内容按照上面的格式添加到最后

一定不能写错,注意去掉双引号,写错了会导致服务器无法开机


重启OK

以上是关于ubuntu挂载硬盘后重启硬盘丢失解决方案的主要内容,如果未能解决你的问题,请参考以下文章

Ubuntu16.04.06 LTS自动挂载硬盘重启后进入Emergency mode 的问题

《Linux运维总结:服务器重启后无法识别挂载硬盘》

centOS挂载不上硬盘怎么解决

在win7下硬盘安装ubuntu10.10后,重启进windows7出现蓝屏

ubuntu修复linux和windows双系统下挂载ntfs硬盘出错问题

macOS下移动硬盘无法挂载且硬盘灯一直闪烁的解决方法