如何退出只读文件系统?

如何退出只读文件系统?

我尝试了很多方法,但到了周末,我又会遇到这种情况。我是双启动用户(Windows 10 Pro 和 Ubuntu 19.04)。我让这两个操作系统都保持最新状态。与速度很慢但很稳定的 Windows 不同,这个发行版速度很快但不太稳定,经常崩溃。

为了摆脱这种情况,我采取的措施是:

  • 使用实时 Ubuntu 19.04 可启动 U 盘,打开 Gparted 并检查
    sda6 和 sda8 上的错误。保留交换分区 (sda7) 独自的。

  • 有时我会在 live ubuntu 中使用这两个命令:

    sudo fsck.ext4 -f /dev/sda6

    sudo fsck.ext4 -f /dev/sda8

在哪里sda6我的分区和sda5我的分割。

  • 我也从 Grub > 恢复模式 > Root shell 执行了此操作
   mount -n -o remount, rw /
   touch /forcefsck
   shutdown -r now

所有答案都是在观察以下人员的建议后做出的问库本图ubuntuforms.org。帮我解决这个问题。我试过很多方法。如果有其他方法请告诉我。

笔记需要明确的是,Windows 操作系统中已禁用快速启动。

用户在评论中询问的一些信息可以帮助我:

pranav@Inspi5548:~$ sudo blkid
[sudo] password for pranav: 
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: TYPE="squashfs"
/dev/loop6: TYPE="squashfs"
/dev/loop7: TYPE="squashfs"
/dev/sda1: LABEL="Recovery" UUID="EAD20314D202E4A3" TYPE="ntfs" PARTLABEL="Ba" PARTUUID="aa5a9347-3807-406c-8a85-df356eb9be93"
/dev/sda2: UUID="8A05-F7D6" TYPE="vfat" PARTUUID="ee306771-48e7-4deb-9c8b-a23c5f0a9dc2"
/dev/sda3: LABEL="New Volume" UUID="E0E07C6CE07C4B34" TYPE="ntfs" PARTUUID="f933de5f-d72a-48c0-918c-b1915e9700f2"
/dev/sda4: UUID="D8FA2AC3FA2A9DAE" TYPE="ntfs" PARTUUID="33885b82-b903-4ee7-9d91-8192f00f2209"
/dev/sda5: UUID="B4D0303ED030095E" TYPE="ntfs" PARTUUID="2d245ea3-510c-41af-825a-4f2f1608275b"
/dev/sda6: UUID="c8e65428-6dea-4e9d-b3b0-370820a1a210" TYPE="ext4" PARTUUID="978bac65-22b0-429b-8bb9-36e97e0754a1"
/dev/sda8: UUID="a54711ee-4373-4a1b-8d06-d0f29aca9a6b" TYPE="ext4" PARTUUID="3f5e0e3c-1884-4597-bdf2-6496941b4fd1"
/dev/loop8: TYPE="squashfs"
/dev/loop9: TYPE="squashfs"
/dev/loop10: TYPE="squashfs"

pranav@Inspi5548:~$ cat /etc/fstab
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda6 during installation
UUID=c8e65428-6dea-4e9d-b3b0-370820a1a210 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
#UUID=8A05-F7D6  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/sda8 during installation
UUID=a54711ee-4373-4a1b-8d06-d0f29aca9a6b /home           ext4    defaults        0       2
# swap was on /dev/sda7 during installation
UUID=1ad69fff-0367-4131-b0a2-839fd5b3846f none            swap    sw              0       0
#UUID=a54711ee-4373-4a1b-8d06-d0f29aca9a6b  /boot   ext4defaults    0   2
UUID=8A05-F7D6  /boot/efi   vfat    defaults    0   1

pranav@Inspi5548:~$ ls -al ~/.local/share/gnome-shell/extensions
total 36
drwxrwxr-x 9 pranav pranav 4096 Aug 22 12:54 .
drwx------ 3 pranav pranav 4096 Aug 29 16:02 ..
drwxrwxr-x 5 pranav pranav 4096 Jul 29 16:39 [email protected]
drwxrwxr-x 5 pranav pranav 4096 Aug  4 22:56 [email protected]
drwxrwxr-x 4 pranav pranav 4096 Jul 29 16:24 desktop-icons@csoriano
drwxrwxr-x 6 pranav pranav 4096 Aug 11 15:26 [email protected]
drwxrwxr-x 2 pranav pranav 4096 Jul 29 21:33 [email protected]
drwxrwxr-x 2 pranav pranav 4096 Aug 22 12:54 [email protected]
drwxrwxr-x 4 pranav pranav 4096 Jul 29 16:46 [email protected]

此截图Disks“SMART 数据和自我检测”窗口,此截图来自gparted应用程序。两者均取自 Live Ubuntu 19.04。

笔记,我在多个地方使用#进行注释以/etc/fstab解决问题,这是该事件发生后的输出。

ubuntu@ubuntu:~$ sudo blkid
/dev/sda1: LABEL="Recovery" UUID="EAD20314D202E4A3" TYPE="ntfs" PARTLABEL="Ba" PARTUUID="aa5a9347-3807-406c-8a85-df356eb9be93"
/dev/sda2: UUID="8A05-F7D6" TYPE="vfat" PARTUUID="ee306771-48e7-4deb-9c8b-a23c5f0a9dc2"
/dev/sda3: LABEL="New Volume" UUID="E0E07C6CE07C4B34" TYPE="ntfs" PARTUUID="f933de5f-d72a-48c0-918c-b1915e9700f2"
/dev/sda4: UUID="D8FA2AC3FA2A9DAE" TYPE="ntfs" PARTUUID="33885b82-b903-4ee7-9d91-8192f00f2209"
/dev/sda5: UUID="B4D0303ED030095E" TYPE="ntfs" PARTUUID="2d245ea3-510c-41af-825a-4f2f1608275b"
/dev/sda6: UUID="c8e65428-6dea-4e9d-b3b0-370820a1a210" TYPE="ext4" PARTUUID="978bac65-22b0-429b-8bb9-36e97e0754a1"
/dev/sda8: UUID="a54711ee-4373-4a1b-8d06-d0f29aca9a6b" TYPE="ext4" PARTUUID="3f5e0e3c-1884-4597-bdf2-6496941b4fd1"
/dev/sdb1: LABEL="UBUNTU 19_0" UUID="15E4-2844" TYPE="vfat" PARTLABEL="Microsoft Basic Data" PARTUUID="5c3b9d59-eab7-47c5-85c0-55654f42445a"
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: TYPE="squashfs"
/dev/loop6: TYPE="squashfs"
/dev/loop7: TYPE="squashfs"
/dev/loop8: TYPE="squashfs"
ubuntu@ubuntu:~$ 

答案1

这里可能存在不止一个问题。

首先,你的交换分区丢失了。/etc/fstab显示:

# swap was on /dev/sda7 during installation
UUID=1ad69fff-0367-4131-b0a2-839fd5b3846f none            swap    sw              0       0

系统正在尝试挂载交换分区,但未找到它。您是否删除了/dev/sda7,或者将其更改为/swapfile

其次,您可能遇到了 GNOME 扩展问题。我发现有多个扩展可能会导致问题。您需要暂时禁用所有扩展,运行计算机一段时间,看看某些问题是否消失。然后一次重新启用一个,看看问题是否再次出现。可能的嫌疑人是Dash to DockGS ConnectStatus Area Horiz Spacing。请参阅https://extensions.gnome.org/local/禁用/启用它们。

更新#1:

您的问题出在/dev/sda7交换分区上,这就是您遇到问题的原因。

首先,让我们编辑/etc/fstab并更改它:

# swap was on /dev/sda7 during installation
UUID=1ad69fff-0367-4131-b0a2-839fd5b3846f none            swap    sw              0       0

更改为:

# swap was on /dev/sda7 during installation
# UUID=1ad69fff-0367-4131-b0a2-839fd5b3846f none            swap    sw              0       0

/dev/sda7然后你应该就可以启动了。我们将在下一次更新中开始修复。

在 中terminal输入:

reboot

更新 #2:

terminal类型中:

sudo swapoff -a

然后我们将坏块/dev/sda7。这可能会失败,因为 中的故障性质/dev/sda7。如果它确实有效,我们仍然必须重新创建此分区,然后编辑/etc/fstab

Note: do NOT abort a bad block scan!

Note: do NOT bad block a SSD

Note: backup your important files FIRST!

Note: this will take many hours

启动至 Ubuntu Live DVD/USB。

terminal...

sudo e2fsck -fcky /dev/sda7# 只读测试

或者

sudo e2fsck -fccky /dev/sda7# 非破坏性读写测试(受到推崇的)

-k 很重要,因为它会保存之前的坏块表,并将任何新的坏块添加到该表中。如果没有 -k,您将丢失所有之前的坏块信息。

-fccky 参数...

   -f     Force checking even if the file system seems clean.

   -c     This option causes e2fsck to use badblocks(8) program  to  do  a
          read-only  scan  of  the device in order to find any bad blocks.
          If any bad blocks are found, they are added  to  the  bad  block
          inode  to  prevent them from being allocated to a file or direc‐
          tory.  If this option is specified twice,  then  the  bad  block
          scan will be done using a non-destructive read-write test.

   -k     When combined with the -c option, any existing bad blocks in the
          bad blocks list are preserved, and any new bad blocks  found  by
          running  badblocks(8)  will  be added to the existing bad blocks
          list.

   -y     Assume  an answer of `yes' to all questions; allows e2fsck to be
          used non-interactively.  This option may not be specified at the
          same time as the -n or -p options.

更新 #3:

注意:您的硬盘可能出现故障...

  • 启动至 Ubuntu Live DVD/USB

    • sudo fsck -f /dev/sda6

    • sudo fsck -f /dev/sda8

  • 启动到硬盘,即使处于紧急模式

  • 再次执行更新 #1

  • 还要删除已添加到 /etc/fstab 的额外挂载

  • 使用gparted,swapoff /dev/sda7,删除/dev/sda7,并创建一个新的ext4/dev/sda7 上的分区

  • sudo fsck -f /dev/sda7

  • sudo blkid现在应该显示 /dev/sda7,如果不是, 然后停止并与我商量

  • 再次进行更新#2,但是这样......

    • 启动至 Ubuntu Live DVD/USB

    • sudo e2fsck -fccky /dev/sda7

    • sudo e2fsck -fccky /dev/sda6

    • sudo e2fsck -fccky /dev/sda8

  • 使用gparted,删除ext4对 /dev/sda7 进行分区,并创建一个新的Linux 交换在 /dev/sda7 上进行分区,并交换到 /dev/sda7...如果这一步失败, 然后停止并与我商量

  • reboot

  • sudo blkid | grep swap获取新的 UUID 并将其编辑到 /etc/fstab 中,同时取消注释同一行

  • reboot

更新 #4:

所有工作都已完成,系统现在正在运行...但是,硬盘出现故障,需要更换。

相关内容