我有一个 1TB 硬盘,我想用它来存储游戏。使用 steam 的 .deb 版本和 Flatpack 版本,我可以添加硬盘并使用它,但使用 Snap 版本则不行(当我在设置中选择磁盘时什么都没有发生)。有没有人想出解决这个问题的办法,还是这只是一个无法修复的 Snap 问题?
我使用的是 Ubuntu 22.04.4 LTS。我有以下磁盘:
Disk /dev/sdb: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: WDC WD40EZRZ-22G
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: gpt
Disk identifier: EE5CF412-6F1B-43EC-8F1D-13F09FBABB93
Device Start End Sectors Size Type
/dev/sdb1 2048 1050623 1048576 512M EFI System
/dev/sdb2 1050624 7814035455 7812984832 3.6T Linux filesystem
磁盘上没有我需要恢复的数据,但我希望能够使用该磁盘存储新文件。
fsck 给出以下输出:
lynx@lynx-MS-7A69:/$ sudo fsck /dev/sdb
fsck from util-linux 2.37.2
e2fsck 1.46.5 (30-Dec-2021)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdb
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
Found a gpt partition table in /dev/sdb
尝试使用备用超级块会产生以下输出:
lynx@lynx-MS-7A69:/$ sudo e2fsck -b 32768 /dev/sdb
e2fsck 1.46.5 (30-Dec-2021)
e2fsck: Bad magic number in super-block while trying to open /dev/sdb
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
Found a gpt partition table in /dev/sdb
fsck.ext4 产生类似的输出。如何修复该磁盘以便可以在其上存储新文件?
我有两个分区,我删除了第一个分区 (NTFS) 以扩展第二个分区并仅保留一个分区 (EXT4)。然而,在 GParted 中执行此操作时,我的计算机关闭了,重新连接 HDD 后,分区不再存在。谁能告诉我是否有办法恢复这个分区?我知道 Photorec,但它检索没有名称的文件,这是一个巨大的混乱......我很想恢复我的文件及其各自的名称。
我尝试使用“gpart”,但它显示 4 个分区显示为“未知”,我不太确定这是最好的方法。
22.04。
我想实现像我在 Mac 中使用的那样的功能:Neofinder 是一个程序,它可以构建一个数据库,其中包含我要求编目的任何硬盘的所有目录和文件(及其一些属性)。它有一个更新程序,可以定期更新所连接硬盘的数据。
它非常有用,因为我还可以搜索未连接但已编目的磁盘。
我安装了Catfish,但它仅在选定的硬盘上进行实时搜索(它有一个错误:无法“在文件管理器中显示”选项)。
还尝试了目录。这是一种更好的方法,但速度很慢(我知道第一次对磁盘进行编目会很慢)。它创建一个 csv 文件。
我扫描了磁盘,创建目录很长一段时间都进入“目录没有响应”,然后强制退出(这是在它获取高清文件/目录树之后)。
我不是在这里寻求有关目录的帮助,只是寻求另一个程序选项。
几个月来我每天都会收到以下错误消息,并且我不知道如何停止接收这些消息。
CurrentPendingSector
This message was generated by the smartd daemon running on:
host name: myhost
DNS domain: [Empty]
The following warning/error was logged by the smartd daemon:
Device: /dev/sda [SAT], 6 Currently unreadable (pending) sectors
Device info:
KingFast, S/N:03112222C0002, FW:U0803A0, 256 GB
For details see host's SYSLOG.
You can also use the smartctl utility for further investigation.
The original message about this issue was sent at Fri Feb 3 19:41:29 2023 PST
Another message will be sent in 24 hours if the problem persists.
OfflineUncorrectableSector
This message was generated by the smartd daemon running on:
host name: myhost
DNS domain: [Empty]
The following warning/error was logged by the smartd daemon:
Device: /dev/sda [SAT], 3 Offline uncorrectable sectors
Device info:
KingFast, S/N:03112222C0002, FW:U0803A0, 256 GB
For details see host's SYSLOG.
You can also use the smartctl utility for further investigation.
The original message about this issue was sent at Fri Feb 3 19:41:29 2023 PST
Another message will be sent in 24 hours if the problem persists.
smartctl -a /dev/sda
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.19.0-46-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: KingFast
Serial Number: 03112222C0002
Firmware Version: U0803A0
User Capacity: 256,060,514,304 bytes [256 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
TRIM Command: Available
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 T13/2015-D revision 3
SATA Version is: SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Sat Jul 8 15:44:59 2023 PDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x02) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 120) seconds.
Offline data collection
capabilities: (0x11) SMART execute Offline immediate.
No Auto Offline data collection support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
No Selective Self-test supported.
SMART capabilities: (0x0002) Does not save SMART data before
entering power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 10) minutes.
SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x0032 100 100 050 Old_age Always - 0
5 Reallocated_Sector_Ct 0x0032 100 100 050 Old_age Always - 6
9 Power_On_Hours 0x0032 100 100 050 Old_age Always - 3335
12 Power_Cycle_Count 0x0032 100 100 050 Old_age Always - 440
160 Unknown_Attribute 0x0032 100 100 050 Old_age Always - 3
161 Unknown_Attribute 0x0033 100 100 050 Pre-fail Always - 86
163 Unknown_Attribute 0x0032 100 100 050 Old_age Always - 26
164 Unknown_Attribute 0x0032 100 100 050 Old_age Always - 79004
165 Unknown_Attribute 0x0032 100 100 050 Old_age Always - 481
166 Unknown_Attribute 0x0032 100 100 050 Old_age Always - 6
167 Unknown_Attribute 0x0032 100 100 050 Old_age Always - 114
168 Unknown_Attribute 0x0032 100 100 050 Old_age Always - 5050
169 Unknown_Attribute 0x0032 100 100 050 Old_age Always - 98
175 Program_Fail_Count_Chip 0x0032 100 100 050 Old_age Always - 0
176 Erase_Fail_Count_Chip 0x0032 100 100 050 Old_age Always - 0
177 Wear_Leveling_Count 0x0032 100 100 050 Old_age Always - 0
178 Used_Rsvd_Blk_Cnt_Chip 0x0032 100 100 050 Old_age Always - 6
181 Program_Fail_Cnt_Total 0x0032 100 100 050 Old_age Always - 0
182 Erase_Fail_Count_Total 0x0032 100 100 050 Old_age Always - 0
192 Power-Off_Retract_Count 0x0032 100 100 050 Old_age Always - 88
194 Temperature_Celsius 0x0022 100 100 050 Old_age Always - 35
195 Hardware_ECC_Recovered 0x0032 100 100 050 Old_age Always - 0
196 Reallocated_Event_Count 0x0032 100 100 050 Old_age Always - 3
197 Current_Pending_Sector 0x0032 100 100 050 Old_age Always - 6
198 Offline_Uncorrectable 0x0032 100 100 050 Old_age Always - 3
199 UDMA_CRC_Error_Count 0x0032 100 100 050 Old_age Always - 0
232 Available_Reservd_Space 0x0032 100 100 050 Old_age Always - 86
241 Total_LBAs_Written 0x0030 100 100 050 Old_age Offline - 168900
242 Total_LBAs_Read 0x0030 100 100 050 Old_age Offline - 815543
245 Unknown_Attribute 0x0032 100 100 050 Old_age Always - 191939
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 3329 -
# 2 Short offline Completed without error 00% 3325 -
# 3 Short offline Completed without error 00% 3321 -
# 4 Short offline Completed without error 00% 3313 -
# 5 Short offline Completed without error 00% 3309 -
# 6 Short offline Completed without error 00% 3306 -
# 7 Extended offline Completed without error 00% 3250 -
# 8 Extended offline Completed without error 00% 3232 -
# 9 Extended offline Completed without error 00% 3229 -
#10 Extended offline Completed without error 00% 976 -
#11 Extended offline Completed without error 00% 968 -
Selective Self-tests/Logging not supported
我试图忽略with中的197
和198
错误/etc/smartd.conf
/dev/sda -d removable -n standby -H -l error -l selftest -f -t -I 197 -I 198 -s (S/../.././(01|09|17)|L/../../3/11) -m root -M exec /usr/share/smartmontools/smartd-runner
无济于事。
LBA_of_first_error
我在自检部分也没有看到任何内容。
对我来说,这似乎SMART overall-health self-assessment test result: PASSED
是健康的,并且自检没有返回任何错误。我目前的理解是磁盘看起来很健康,但仍然错误地发送这些消息。
我缺少什么吗?
该/dev/sda
驱动器是 KingFast 256 GB SSD,我不确定这是否相关,因为我在网上找不到该特定驱动器或制造商的任何信息。
我怎样才能停止接收这些消息,但仍然对驱动器上的其他真正问题进行智能监控?如果此错误消息确实表明驱动器存在问题,我将如何解决该问题?
谢谢!
编辑:
我还运行了以下命令,我相信这表明驱动器没有错误:
badblocks -sv /dev/sda
Checking blocks 0 to 250059095
Checking for bad blocks (read-only test): done
Pass completed, 0 bad blocks found. (0/0/0 errors)
dd if=/dev/sda of=/dev/null bs=64K conv=noerror
3907173+1 records in
3907173+1 records out
256060514304 bytes (256 GB, 238 GiB) copied, 485.648 s, 527 MB/s
症状:
我无法再启动到我的 Xubuntu 22.04 Linux 机器,发生的情况如下:
在某些时候,我的主目录文件系统进入只读状态(据我所知,很可能是作为一种保护措施)。然后我重新启动,认为这是一个一次性故障,但事实并非如此:它无法启动,并在我的 /dev/sdb 磁盘上出现日志错误(这是我存储主目录的位置,与操作系统分开)位于 /dev/sda 上)。
我可以重新启动到安装 USB,并挂载 /dev/sda 和 /dev/sdb。运行 fsck 时,出现错误:
# fsck /dev/sdb
fsck from util-linux 2.37.2
e2fsck 1.46.5 (30-Dec-2021)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/sdb
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
Found a gpt partition table in /dev/sdb
此后,我将该驱动器上的主目录备份回 /dev/sda ,这似乎可以正常工作,尽管在传输一些我可以重新创建的文件时出现错误。
问题:
我正在考虑尝试使用以下说明修复 /dev/sdb 驱动器:
https://askubuntu.com/a/1335193/340383
但这句话却把我吓跑了,而且没有解释为什么:
Note: do NOT bad block a SSD
因此,在那个答案中,他们提到了跑步:
sudo e2fsck -fccky /dev/sdXX # non-destructive read/write test (recommended)
就我而言,我推测需要是:
sudo e2fsck -fccky /dev/sdb1
这是否会损害我使用 /dev/sdb 修复此问题的能力,或者它是无害的并且是真正的非破坏性测试?
在此给出答案:
https://askubuntu.com/a/1233241/340383
以及OP的问题,他们暗示他们成功使用了e2fsck,我的结论是可以安全地继续。是吗?
子问题:
另外,我不知道这部分输出fsck
试图传达什么:
Found a gpt partition table in /dev/sdb
这是在告诉我我跑fsck
错了吗?我不想通过尝试不同的超级块来遵循输出中的建议,直到我确认这不仅仅是我自己的用户错误。
2023-07-02 09:08:57:运行 sudo e2fsck -C0 -p -f -v /dev/sdb1
在评论中,我遵循了Ubuntu 14.04 在手动硬启动后无法正常启动的建议(这是在卸载 /dev/sda* 和 /dev/sdb* 驱动器之后):
sudo e2fsck -C0 -p -f -v /dev/sdb1
并得到:
Inode898044343 extent tree (at level 2) could be narrower. IGNORED.0.1%
DRIVE8: Inode 103942010 extent tree (at level 2) could be narrower. IGNORED.
DRIVE8: Inode 103942011 extent tree (at level 2) could be narrower. IGNORED.
... <snip mostly duplicate types of output lines here> ...
DRIVE8: Inode 103942324 extent tree (at level 1) could be narrower. IGNORED.
Inodes:that=were=part=of=a=corrupted=orphan linked list found. / 59.7%
DRIVE8: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)
我有一个多年来一直有效的外部硬盘驱动器。突然有一天,我打开了我的 libre 办公室,里面有多个在崩溃后打开的文件,而 libre 无法恢复它们,因为它看不到我的外部驱动器。
我已经广泛研究了如何让程序查看外部驱动器,但没有任何效果。
如果我单击 nautilus 中的书签,我的外部驱动器上的书签文件夹也将停止访问。因此,如果我单击我的书签,它会显示“您没有查看 xyz 文件夹内容所需的权限”。但是,如果我单击外部硬盘驱动器本身,然后向下导航到所述带有书签的子目录,它就会显示正常。
有人可以帮我弄清楚为什么我的程序在工作多年后再也看不到我的外部硬盘驱动器了吗?我有一些重要的文件未保存而崩溃,因此无法恢复,而且我的所有其他程序都无法再保存到我的外部驱动器中,所以我必须将它们保存到文件中,这对组织来说是一场噩梦,当你的工作和工作参与了这个过程。
谢谢你!
我试图从 Kubuntu 22.04 升级到 22.10,但很无聊。在终端窗口处于活动状态时不小心按下了 Ctrl-C。我认为我能够解决所有问题,但不想冒险。
我有一个 LVM 快照,所以我试图从实时 USB 恢复它,这似乎破坏了硬盘驱动器。我完全迷惑了。
为了创建快照,我做了以下操作(这是来自记忆):
sudo lvcreate --snaphot --name Kubutu-snap --size 20G /dev/vg1/Kubuntu
要恢复快照:
sudo lvconvert --merge /dev/vg1/Kubuntu-snap
在我看到“Merge 100%”并且命令终止后,我重新启动了计算机。重新启动后,我收到一条关于我的硬盘驱动器丢失的消息。
更多信息:
- 重新启动后,我有点仓促地从计算机中拔出闪存驱动器。但我不明白这会如何杀死内部驱动器。
- 我不知道快照是否过满。我本以为如果是这种情况会有警告。除了所讨论的逻辑卷之外,我也看不出这会如何伤害任何东西。
- 该驱动器是 SATA SSD。
- 我一直连接着电源。
sda
曾经是我的SSD。sdb
是现场USB。
调试。重新启动到我的实时 USB 后,尚不清楚 SSD 发生了什么。
df
什么都不给。
lsblk
没有帮助。
$ sudo lsblk
...
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
(loop devices)
sda 8:0 1 0B 0 disk
sdb 8:16 0 29.2G 0 disk
├─sdb1 8:17 0 3.4G 0 part /cdrom
├─sdb2 8:18 0 4.1M 0 part
├─sdb3 8:19 0 300K 0 part
└─sdb4 8:20 0 25.8G 0 part /var/crash
/var/log
...
$ sudo lsblk -o UUID,NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL,MODEL
...
UUID NAME FSTYPE SIZE MOUNTPOINT LABEL MODEL
(loop devices)
sda 0B SD/MMC
2022-04-19-10-22-47-00 sdb iso9660 29.2G Kubuntu 22.04 LTS amd64 Extreme
2022-04-19-10-22-47-00 ├─sdb1 iso9660 3.4G /cdrom Kubuntu 22.04 LTS amd64
8D6C-A9F8 ├─sdb2 vfat 4.1M ESP
├─sdb3 300K
783b59ea-3cd8-4ef9-95e1-0d7cc906e5e6 └─sdb4 ext4 25.8G /var/crash writable
...
smartctl
没有帮助。
$ sudo smartctl -d scsi -a /dev/sda
...
=== START OF INFORMATION SECTION ===
Vendor: Generic-
Product: SD/MMC
Revision: 1.00
Compliance: SPC-4
Logical Unit id: 0x00e04c2020202000error: designator length
Serial number: 2012090114345300
Device type: disk
Local Time is: Fri Dec 23 23:39:16 2022 UTC
NO MEDIUM present in device
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.
显然,“SD/MMC”是不正确的。
所以,问题:
- 到底发生了什么?
- 我可以解决这个问题吗?