什么原因导致文件系统损坏?

什么原因导致文件系统损坏?

最近我的一个驱动器拒绝安装,显示以下错误消息:

在此处输入图片描述

现在幸运的是我能够解决这个问题,这要感谢 Ask Ubuntu 上的另一个问题,您可以在这里找到:“结构需要清理”错误 - 无法挂载分区

基本上我只需要修复系统,我输入了命令:

sudo fsck.ext4 /dev/sda[NUMBER]

正如该帖子的回答中所述。这有效,我的驱动器中的所有内容都恢复了。

然而,我的问题是:这样的事情到底是怎么发生的?我想知道,这样我就可以尝试防止这种情况在未来再次发生。

我将给出我的设置作为我可能做错的指南。我使用的是 Ubuntu Studio 19.10。这个硬盘不是我的启动驱动器,也不包含我的主分区。我已将其设置为在启动时安装。我通过在 GNOME 磁盘中启用它来实现这一点。该驱动器也格式化为 ext4。

尽管我使用 Xfce,但我主要使用 Nemo 作为文件管理器,而不是 Thunar。

我已将其状态设置为显示在我的 Conky 中,但除此之外,它仅在我专门运行、打开或保存其中的内容时才会使用。我从不卸载它。当我关闭系统时,我只需点击关机,通常一切都很好。

那么什么会导致这样的错误呢?只是运气不好吗?还是我正在做的事情?

如果我说的不够具体,请随时提问。

先感谢您 :)

编辑:添加下面所请求的信息。

$ cat /etc/fstab
# / was on /dev/sda1 during installation
UUID=346ba1d4-efe5-4435-87cc-178b90845c65 /               ext4    errors=remount-ro 0       1
/swapfile                                 none            swap    sw              0       0
/dev/sdb        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
LABEL=LinuxHDD /mnt/LinuxHDD auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=LinuxHDD 0 0
$ sudo blkid
/dev/sdc1: UUID="346ba1d4-efe5-4435-87cc-178b90845c65" TYPE="ext4" PARTUUID="e437d520-01"
/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="HDD 2" UUID="46A4A2A1A4A2934B" TYPE="ntfs" PARTUUID="50e732f7-01"
/dev/sdb1: LABEL="LinuxHDD" UUID="44417cbc-3321-43b1-9487-119740d01959" TYPE="ext4" PARTUUID="00033300-01"
/dev/sdd1: LABEL="System Reserved" UUID="5612B79912B77D15" TYPE="ntfs" PARTUUID="f0c3841b-01"
/dev/sdd2: UUID="86E6B86DE6B85EDD" TYPE="ntfs" PARTUUID="f0c3841b-02"
/dev/sdd3: UUID="AAD2DEECD2DEBBAF" TYPE="ntfs" PARTUUID="f0c3841b-03"
/dev/sde1: LABEL="HDD" UUID="865243EE5243E193" TYPE="ntfs" PARTUUID="37ab496d-01"
/dev/loop8: TYPE="squashfs"
/dev/loop9: TYPE="squashfs"
/dev/loop10: TYPE="squashfs"
$ sudo fdisk -l
Disk /dev/loop0: 140.8 MiB, 146882560 bytes, 286880 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


Disk /dev/loop1: 44.18 MiB, 46325760 bytes, 90480 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


Disk /dev/loop2: 168.46 MiB, 176631808 bytes, 344984 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


Disk /dev/loop3: 140.32 MiB, 147128320 bytes, 287360 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


Disk /dev/loop4: 89.9 MiB, 93417472 bytes, 182456 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


Disk /dev/loop5: 146.5 MiB, 153600000 bytes, 300000 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


Disk /dev/loop6: 89.1 MiB, 93429760 bytes, 182480 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


Disk /dev/loop7: 146.54 MiB, 153649152 bytes, 300096 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




Disk /dev/sda: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10EZEX-00B
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x50e732f7

Device     Boot Start        End    Sectors   Size Id Type
/dev/sda1        2048 1953521663 1953519616 931.5G  7 HPFS/NTFS/exFAT


Disk /dev/sdb: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: SAMSUNG HD502HJ 
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: 0x00033300

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdb1  *     2048 976773119 976771072 465.8G 83 Linux


Disk /dev/sdc: 55.92 GiB, 60022480896 bytes, 117231408 sectors
Disk model: Corsair Force LS
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: 0xe437d520

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdc1  *     2048 117229567 117227520 55.9G 83 Linux


Disk /dev/sdd: 232.91 GiB, 250059350016 bytes, 488397168 sectors
Disk model: Samsung SSD 850 
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: 0xf0c3841b

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sdd1  *         2048    718847    716800   350M  7 HPFS/NTFS/exFAT
/dev/sdd2          718848 487473151 486754304 232.1G  7 HPFS/NTFS/exFAT
/dev/sdd3       487473152 488394751    921600   450M 27 Hidden NTFS WinRE


Disk /dev/sde: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10EZEX-08M
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x37ab496d

Device     Boot Start        End    Sectors   Size Id Type
/dev/sde1        2048 1953521663 1953519616 931.5G  7 HPFS/NTFS/exFAT


Disk /dev/loop8: 167.62 MiB, 175751168 bytes, 343264 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


Disk /dev/loop9: 54.64 MiB, 57274368 bytes, 111864 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


Disk /dev/loop10: 54.64 MiB, 57274368 bytes, 111864 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

我希望这有帮助!

答案1

什么原因导致文件系统损坏?

  • 不当下马

  • 来自外部操作系统的访问(即:Windows 驱动程序

  • 磁盘(预)故障

  • 主存储器故障

  • 事情就这样发生了(我希望

解决损坏的文件系统的最常用方法?

对于 18.04 或更新版本...

  • 启动至 Ubuntu Live DVD/USB
  • terminalCtrl+ Alt+打开窗口T
  • 类型sudo fdisk -l
  • 识别“Linux 文件系统”的 /dev/sdXX 设备名称
  • 输入sudo fsck -f /dev/sdXX,替换sdXX为您之前找到的数字
  • fsck如果有错误则重复命令
  • 类型reboot

笔记:或卸载活动的 HDD/SSD 并sudo fsck -f /dev/sdXX

/etc/fstab会推荐...

改变:

/dev/sdb        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
LABEL=LinuxHDD /mnt/LinuxHDD auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=LinuxHDD 0 0

到:

# sdb used by HDD/SSD, floppy disks probably auto mount on insertion
# /dev/sdb        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
#
# added boot time fsck (see 2 at the end of line)
# prefer UUID=44417cbc-3321-43b1-9487-119740d01959 over LABEL=LinuxHDD
UUID=44417cbc-3321-43b1-9487-119740d01959 /mnt/LinuxHDD auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=LinuxHDD 0 2
  • 并添加其他两个 ext4 磁盘的挂载,并以“0 2”结尾

更新 #1

以“0 2”结尾的磁盘实际上起什么作用?

man fstab...

  The fifth field (fs_freq).
          This field is used by dump(8)  to  determine  which  filesystems
          need  to  be  dumped.   Defaults  to  zero  (don't  dump) if not
          present.

   The sixth field (fs_passno).
          This field is used by fsck(8) to determine the  order  in  which
          filesystem  checks  are  done at boot time.  The root filesystem
          should be specified with a fs_passno of  1.   Other  filesystems
          should  have  a fs_passno of 2.  Filesystems within a drive will
          be checked sequentially, but  filesystems  on  different  drives
          will  be  checked at the same time to utilize parallelism avail‐
          able in the hardware.  Defaults to  zero  (don't  fsck)  if  not
          present.

相关内容