Gae*_*sci 6 updates development mount cryptsetup
序言: 几年前,我的笔记本电脑掉了下来,后来无法挂载 sda1 磁盘。我用实时的 USB ubuntu 发行版恢复了它。从那以后,我的笔记本电脑从未像现在这样流畅。
问:我在更新期间收到此警告消息:
cryptsetup: WARNING: failed to detect canonical device of /dev/sda1
Run Code Online (Sandbox Code Playgroud)
/etc/fstab 和 /etc/crypttab 中的视图显示:
$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' 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>
proc /proc proc nodev,noexec,nosuid 0 0
/dev/sda1 / ext4 errors=remount-ro,user_xattr 0 1
/dev/sda5 none swap sw 0 0
Run Code Online (Sandbox Code Playgroud)
和
$ cat /etc/crypttab
# <target name> <source device> <key file> <options>
Run Code Online (Sandbox Code Playgroud)
我在 ubuntu 14.04 LTS, uname -a 显示
$ uname -a
Linux alessio-laptop 3.13.0-77-generic #121-Ubuntu SMP Wed Jan 20 10:50:59 UTC 2016 i686 i686 i686 GNU/Linux
Run Code Online (Sandbox Code Playgroud)
我一直在查看其他帖子,但我担心fstab 文件中的errors=remount-ro和none标签。我也很确定我的磁盘没有加密。
这是否会影响我的系统的性能,甚至导致更大的错误?我怎么能修好呢?
error-remount-ro意味着如果遇到错误,分区将以只读方式安装以避免损坏,以便您有机会修复问题。当硬盘出现问题时通常会发生这种情况。不要更改此设置。我曾经这样做过一次,结果证明这是一个非常糟糕的主意。
none表示在您的情况下“没有安装点”。因此,“类型”列中所示的交换文件 /dev/sda5 根本没有安装,系统也没有使用它。如果您的系统内存不足,这可能会影响性能,否则您可能不会注意到它。
MAC*_*rha -1
最近我的 Ubuntu 启动速度很慢。为了解决这个问题,我研究并找到了该命令update-initramfs -u
并尝试运行它,但它显示了以下错误:
cryptsetup: WARNING: failed to detect canonical device of /dev/sda7
Run Code Online (Sandbox Code Playgroud)
感谢 Predato 的回答,我已经解决了这个问题。
注意:这是显而易见的,但是在下面描述的步骤中,您必须执行与您的问题相关的操作,例如考虑您自己的错误消息。我的意思是下面的 /dev/sdax 是出现该错误的分区,例如 /dev/sda7。
从他的回答来看:
错误的主要来源是交换分区链接损坏。首先,您需要获取交换分区的 UUID。只需运行
blkid
命令即可。
考虑到发生了错误,运行命令并复制/dev/sda7的UUID。它的格式如下:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,其中 x 是十六进制数字。
首先进行备份:
sudo cp /etc/crypttab /etc/crypttab.back
Run Code Online (Sandbox Code Playgroud)
在这里,打开文件进行编辑:
sudo nano /etc/crypttab
Run Code Online (Sandbox Code Playgroud)
然后,删除与/dev/sda7相关的行。对我来说,我没有找到任何包含或与 /dev/sda7 相关的行,所以我跳过了。
然后,运行sudo nano /etc/fstab
并使用以下语法添加新行:
UUID=your_copied_uuid none swap sw 0 0
Run Code Online (Sandbox Code Playgroud)
注意(重要):如果存在具有精确复制的 UUID 的行,则不要执行任何操作,也不要编辑任何内容。例如,我通过将 ext4 更改为 swap 来编辑与 /dev/sda7 相关的行;然后,在下次重新启动时,启动失败(问题现已解决)。
作为最后一步,也是我认为最重要的一步,运行sudo nano /etc/uswsusp.conf
并更改以下行:
resume device = /dev/sda1
Run Code Online (Sandbox Code Playgroud)
到:
resume device = UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Run Code Online (Sandbox Code Playgroud)
通过执行这些步骤,您的问题可能会得到解决。对我来说,问题已解决,运行时没有发生错误update-initramfs -u
。再次特别感谢 Predato 的回答。
希望这对某人有帮助!