我读过一个关于此的不同问题,答案是符号链接存储名称和目标 + 其他元数据的几个字节。
在 ext4 上使用“ls -l dir”,为什么符号链接的大小总是等于它链接到的文件的字符串路径的长度?
我试过多个不同的路径、不同的文件名、不同的文件等。
其符号链接的大小始终等于路径字符串的长度。
可能是因为文件太小了?
这是符号链接文件内容的实际长度吗?
我读过一个关于此的不同问题,答案是符号链接存储名称和目标 + 其他元数据的几个字节。
在 ext4 上使用“ls -l dir”,为什么符号链接的大小总是等于它链接到的文件的字符串路径的长度?
我试过多个不同的路径、不同的文件名、不同的文件等。
其符号链接的大小始终等于路径字符串的长度。
可能是因为文件太小了?
这是符号链接文件内容的实际长度吗?
所以说如果我mkfs.ext4
在一个 1 GB 的文件上做了一个 ext4 文件系统然后安装它并添加文件cat.ls
卸载它并将它发送到没有 sudo 的 B 计算机(注意我不会使用保险丝)这个人将如何阅读文件而不安装它。编辑您可以安装任何 ext4 解析器,只是不能安装它。
编辑以获取您现在将运行的 ext 4 文件,dd if=/dev/zero of=ext4 bs=MiB count=1024 ;mkfs.ext4 ext4 ; mkdir ext4dir ; sudo mount ./ext4 ./ext4dir ;sudo chown -R $USER:$USER ext4dir ;echo hel > ext4dir/cat.ls ; sudo umount ext4dir
计算机 b 将如何解析 ext4 文件或将文件转储到目录
我现在使用 shutdown -r (而不是菜单中的常用选项)从终端重新启动了我的系统,然后我在文件系统上运行 fsck 并得到如下错误:
Free blocks count wrong ...
Free inodes count wrong ...
Clearing orphaned inode ...
它修复了它们。
这些错误是否严重?我应该担心我的文件系统中可能存在挥之不去的损坏吗?
谢谢!
几年来,我一直使用 Ubuntu 作为我唯一的操作系统,但有时,由于与我想使用的某些软件(主要是游戏或绘图程序)的兼容性问题,我会同时安装 Windows。
我最终每次都删除 Windows 的一个重要原因是让我的文件在两个操作系统中保持最新是多么麻烦。艺术文件,文档,视频,我下载的东西......确保最新版本始终可用有点麻烦,如果您不擅长提前计划,需要重新启动几次才能从 ext4 移动到 ntfs 分区.
您将如何设置您的驱动器,以便您的 /home 中的文件可用于两个操作系统?只是将您的 /home 分区设置为 ntfs 分区?还有什么办法?
这是我第一次在我的机器上遇到 Ubuntu 的问题,最近我用全新的 SSD 更换了我的 PC 的 SSD,它在 Windows 中运行得非常好,并且固件是最新的。
硬件
软件
有时,我正在使用我的笔记本电脑并且 Kwin 停止工作,我无法打开应用程序启动器,但我可以通过 Alt + Tab 键更改窗口,但几秒钟后,屏幕完全冻结,我无法控制鼠标,温度开始升高,我无法切换到另一个控制台检查错误(Control + Alt + F2),我只能用 Magic SysRq 键 + REISUB 重新启动我的电脑。
我的系统的相关信息:
BIOS版本
sudo dmidecode -s bios-version
E5CN63WW
RAM 和 SWAP 数据:
free -h
total used free shared buff/cache available
Mem: 15Gi 3,9Gi 7,0Gi 1,3Gi 4,5Gi 10Gi
Swap: 3,8Gi 1,8Gi 2,0Gi
交换性
sysctl vm.swappiness
vm.swappiness = 60
系统日志journalctl -k -b -1
(对我而言)没有显示任何相关内容,但我在下面附上了带有警告或警报的消息,以防万一我忘记了什么
第一个日志
aug 11 20:49:22 josejacomeb-Lenovo-ideapad-700-15ISK kernel: IRQ 125: no longer affine to CPU1
aug 11 20:49:22 josejacomeb-Lenovo-ideapad-700-15ISK kernel: IRQ 140: no longer affine to CPU4
aug 11 20:49:22 josejacomeb-Lenovo-ideapad-700-15ISK kernel: IRQ 124: no longer affine to CPU6
aug 11 20:49:22 josejacomeb-Lenovo-ideapad-700-15ISK kernel: IRQ 128: no longer affine to CPU6
aug 11 20:49:22 josejacomeb-Lenovo-ideapad-700-15ISK kernel: IRQ 138: no longer affine to CPU7
aug 11 20:49:22 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI: button: The lid device is not compliant to SW_LID.
aug 11 20:49:22 josejacomeb-Lenovo-ideapad-700-15ISK kernel: iwlwifi 0000:02:00.0: FW already configured (0) - re-configuring
aug 11 20:49:23 josejacomeb-Lenovo-ideapad-700-15ISK kernel: Bluetooth: hci0: unexpected event for opcode 0xfc2f
aug 11 20:49:29 josejacomeb-Lenovo-ideapad-700-15ISK kernel: kauditd_printk_skb: 43 callbacks suppressed
aug 11 20:49:55 josejacomeb-Lenovo-ideapad-700-15ISK kernel: xfs filesystem being remounted at /run/systemd/unit-root/var/cache/private/fwupdmgr supports timestamps until 2038 (0x7fffffff)
第二个日志
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: [Firmware Bug]: TPM Final Events table missing or invalid
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: MDS CPU bug present and SMT on, data leak possible. See https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/mds.html for more details.
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: TAA CPU bug present and SMT on, data leak possible. See https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/tsx_async_abort.html for more details.
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: #5 #6 #7
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI BIOS Error (bug): Failure creating named object [\_PR.CPU0._PPC], AE_ALREADY_EXISTS (20190816/dswload2-326)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20190816/psobject-220)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI BIOS Error (bug): Failure creating named object [\_PR.CPU0._PCT], AE_ALREADY_EXISTS (20190816/dswload2-326)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20190816/psobject-220)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI BIOS Error (bug): Failure creating named object [\_PR.CPU0._PSS], AE_ALREADY_EXISTS (20190816/dswload2-326)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20190816/psobject-220)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI BIOS Error (bug): Failure creating named object [\_PR.CPU0.LPSS], AE_ALREADY_EXISTS (20190816/dswload2-326)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20190816/psobject-220)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI BIOS Error (bug): Failure creating named object [\_PR.CPU0.TPSS], AE_ALREADY_EXISTS (20190816/dswload2-326)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20190816/psobject-220)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI BIOS Error (bug): Failure creating named object [\_PR.CPU0.PSDF], AE_ALREADY_EXISTS (20190816/dswload2-326)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20190816/psobject-220)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI BIOS Error (bug): Failure creating named object [\_PR.CPU0._PSD], AE_ALREADY_EXISTS (20190816/dswload2-326)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20190816/psobject-220)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI BIOS Error (bug): Failure creating named object [\_PR.CPU0.HPSD], AE_ALREADY_EXISTS (20190816/dswload2-326)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20190816/psobject-220)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI BIOS Error (bug): Failure creating named object [\_PR.CPU0.SPSD], AE_ALREADY_EXISTS (20190816/dswload2-326)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20190816/psobject-220)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: platform MSFT0101:00: failed to claim resource 1: [mem 0xfed40000-0xfed40fff]
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: acpi MSFT0101:00: platform device creation failed: -16
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: usb: port power management may be unreliable
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: platform eisa.0: EISA: Cannot allocate resource for mainboard
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: platform eisa.0: Cannot allocate resource for EISA slot 1
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: platform eisa.0: Cannot allocate resource for EISA slot 2
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: platform eisa.0: Cannot allocate resource for EISA slot 3
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: platform eisa.0: Cannot allocate resource for EISA slot 4
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: platform eisa.0: Cannot allocate resource for EISA slot 5
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: platform eisa.0: Cannot allocate resource for EISA slot 6
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: platform eisa.0: Cannot allocate resource for EISA slot 7
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: platform eisa.0: Cannot allocate resource for EISA slot 8
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: acpi PNP0C14:02: duplicate WMI GUID 05901221-D566-11D1-B2F0-00A0C9062910 (first instance was on PNP0C14:01)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: r8169 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: nvme nvme0: missing or invalid SUBNQN field.
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: xfs filesystem being remounted at / supports timestamps until 2038 (0x7fffffff)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: asus_wmi: ASUS Management GUID not found
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: uvcvideo 1-5:1.0: Entity type for entity Realtek Extended Controls Unit was not initialized!
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: uvcvideo 1-5:1.0: Entity type for entity Extension 4 was not initialized!
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: uvcvideo 1-5:1.0: Entity type for entity Processing 2 was not initialized!
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: uvcvideo 1-5:1.0: Entity type for entity Camera 1 was not initialized!
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: nvidia: loading out-of-tree module taints kernel.
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: nvidia: module license 'NVIDIA' taints kernel.
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: Disabling lock debugging due to kernel taint
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: thermal thermal_zone3: failed to read out thermal zone (-61)
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module 440.100 Fri May 29 08:45:51 UTC 2020
aug 11 21:01:58 josejacomeb-Lenovo-ideapad-700-15ISK kernel: Bluetooth: hci0: unexpected event for opcode 0xfc2f
aug 11 21:02:01 josejacomeb-Lenovo-ideapad-700-15ISK kernel: iwlwifi 0000:02:00.0: FW already configured (0) - re-configuring
aug 11 21:02:01 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI Warning: \_SB.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20190816/nsarguments-59)
第三个日志
aug 11 21:44:10 josejacomeb-Lenovo-ideapad-700-15ISK kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module 440.100 Fri May 29 08:45:51 UTC 2020
aug 11 21:44:10 josejacomeb-Lenovo-ideapad-700-15ISK kernel: thermal thermal_zone3: failed to read out thermal zone (-61)
aug 11 21:44:10 josejacomeb-Lenovo-ideapad-700-15ISK kernel: Bluetooth: hci0: unexpected event for opcode 0xfc2f
aug 11 21:44:13 josejacomeb-Lenovo-ideapad-700-15ISK kernel: iwlwifi 0000:02:00.0: FW already configured (0) - re-configuring
aug 11 21:44:13 josejacomeb-Lenovo-ideapad-700-15ISK kernel: ACPI Warning: \_SB.PCI0.PEG0.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20190816/nsarguments-59)
aug 11 22:21:25 josejacomeb-Lenovo-ideapad-700-15ISK kernel: iwlwifi 0000:02:00.0: FW already configured (0) - re-configuring
aug 11 22:21:26 josejacomeb-Lenovo-ideapad-700-15ISK kernel: Bluetooth: hci0: unexpected event for opcode 0xfc2f
aug 11 22:22:31 josejacomeb-Lenovo-ideapad-700-15ISK kernel: kauditd_printk_skb: 37 callbacks suppressed
更新
我用EXT4分区硬重装了Kubuntu 20.04.1,似乎是SSD错误,新信息如下:
[ 3378.408344] systemd-journald (423): Failed to write entry (22 items, 780 bytes), ignoring: Read-only
[ 3378.408611] systemd-journald [423] : Failed to write entry (22 items, 769 bytes), ignoring: Read-only
冻结错误的另一个日志。
[ 827214225 EXT4-fs error (device nvme0n1p5): __ext4_find_entry:1531: inode #3407921: comm gmain: reading directory lblock 0
[ 827.214749] EXT4-fs error (device nvme0n1p5): __ext4_find_entry:1531: inode #3407921: conn gmain: reading directory lblock 0
[ 827.214764] EXT4-fs error (device nvme0n1p5): __ext4_find_entry:1531: inode #3407921: comm gmain: reading directory lblock 0
有时当我关闭笔记本电脑时,会发生此错误
[ 16918.166564] systemd-shutdown [1]: Remounting '/' timed out. issuing SIGKILL to PID 11240.
[ 16982.141788] nvme nvme0: Device not ready: aborting reset
[ 16982.143784] nvme : Removing after probe failure status: -19
更新 2
使用 Kubuntu Live ISO,我执行了 fsck 测试,没有发现任何问题。
root@kubuntu:/home/kubuntu# fsck /dev/nvme0n1p3
fsck from util-linux 2.34
e2fsck 1.45.5 (07-Jan-2020)
/dev/nvme0n1p3: clean, 257827/6111232 files, 8741020/24413952 blocks
root@kubuntu:/home/kubuntu# echo $?
0
root@kubuntu:/home/kubuntu# fsck /dev/nvme0n1p5
fsck from util-linux 2.34
e2fsck 1.45.5 (07-Jan-2020)
/dev/nvme0n1p5: clean, 754959/6447104 files, 10749435/25785856 blocks
root@kubuntu:/home/kubuntu# echo $?
0
重启时出现问题
nvme nvme0: Device not ready; aborting reset
nvme nvme0: Abort status: 0x371
nvme nvme0: Abort status: 0x371
nvme nvme0: Abort status: 0x371
Remounting '/' timed out, issuing SIGKILL to PID 7544.
SMART分析如下:
sudo smartctl -i /dev/nvme0
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-42-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Number: KINGSTON SA2000M8500G
Serial Number: 50026B7683BC98CE
Firmware Version: S5Z42105
PCI Vendor/Subsystem ID: 0x2646
IEEE OUI Identifier: 0x0026b7
Controller ID: 1
Number of Namespaces: 1
Namespace 1 Size/Capacity: 500.107.862.016 [500 GB]
Namespace 1 Utilization: 142.133.460.992 [142 GB]
Namespace 1 Formatted LBA Size: 512
Namespace 1 IEEE EUI-64: 0026b7 683bc98ce5
Local Time is: Wed Aug 26 23:49:45 2020 CEST
sudo smartctl -a /dev/nvme0
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-42-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Number: KINGSTON SA2000M8500G
Serial Number: 50026B7683BC98CE
Firmware Version: S5Z42105
PCI Vendor/Subsystem ID: 0x2646
IEEE OUI Identifier: 0x0026b7
Controller ID: 1
Number of Namespaces: 1
Namespace 1 Size/Capacity: 500.107.862.016 [500 GB]
Namespace 1 Utilization: 142.114.676.736 [142 GB]
Namespace 1 Formatted LBA Size: 512
Namespace 1 IEEE EUI-64: 0026b7 683bc98ce5
Local Time is: Wed Aug 26 23:51:50 2020 CEST
Firmware Updates (0x14): 2 Slots, no Reset required
Optional Admin Commands (0x0017): Security Format Frmw_DL Self_Test
Optional NVM Commands (0x005f): Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp
Maximum Data Transfer Size: 32 Pages
Warning Comp. Temp. Threshold: 75 Celsius
Critical Comp. Temp. Threshold: 80 Celsius
Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 9.00W - - 0 0 0 0 0 0
1 + 4.60W - - 1 1 1 1 0 0
2 + 3.80W - - 2 2 2 2 0 0
3 - 0.0450W - - 3 3 3 3 2000 2000
4 - 0.0040W - - 4 4 4 4 15000 15000
Supported LBA Sizes (NSID 0x1)
Id Fmt Data Metadt Rel_Perf
0 + 512 0 0
=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
SMART/Health Information (NVMe Log 0x02)
Critical Warning: 0x00
Temperature: 30 Celsius
Available Spare: 100%
Available Spare Threshold: 10%
Percentage Used: 0%
Data Units Read: 3.966.522 [2,03 TB]
Data Units Written: 6.036.943 [3,09 TB]
Host Read Commands: 38.899.250
Host Write Commands: 46.064.389
Controller Busy Time: 601
Power Cycles: 390
Power On Hours: 241
Unsafe Shutdowns: 160
Media and Data Integrity Errors: 0
Error Information Log Entries: 0
Warning Comp. Temperature Time: 0
Critical Comp. Temperature Time: 0
Thermal Temp. 1 Transition Count: 7
Thermal Temp. 1 Total Time: 24
Error Information (NVMe Log 0x01, max 256 entries)
No Errors Logged
谢谢阅读。我做错了什么?任何评论都非常感谢!
问候
我有一台装有新安装的 Ubuntu Budgie 20.04 的华硕笔记本电脑,安装在 dev/sdb2 上,这是一个 1TB Crucial M.2 SSD。
相当经常(大约 50% 的时间),在我登录并开始工作后不久,Ubuntu 会关闭所有打开的应用程序并冻结。这似乎是一个缓慢的过程,应用程序关闭,然后 Budgie DE 将停止,最后鼠标变得无响应。此时,我可以使用 CTRL + F2 访问登录屏幕,但是当我提供用户名时,它会抛出错误:
[ 844.940093] blk_update_request: I/O error, dev sdb, sector 1009020696 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
然后再次显示登录提示。如果我再次尝试登录,我会收到很多 systemd 警报:
[ 861.655386] systemd-journald[376]: Failed to write entry (22 items, 745 bytes), ignoring: Read-only file system
[ 861.655543] systemd-journald[376]: Failed to write entry (22 items, 756 bytes), ignoring: Read-only file system
[ 861.655835] systemd-journald[376]: Failed to write entry (22 items, 745 bytes), ignoring: Read-only file system
[ 861.656284] systemd-journald[376]: Failed to write entry (22 items, 756 bytes), ignoring: Read-only file system
[ 861.656532] systemd-journald[376]: Failed to write entry (22 items, 745 bytes), ignoring: Read-only file system
此时,我通过按住电源按钮强制关机,重新启动,系统通常可以正常工作以进行下次启动。
我一直在监视磁盘 SMART 测试,它始终显示 2 个坏块。我已经尝试完全格式化驱动器并重新安装操作系统,但没有成功。
我一直在搜索论坛并在谷歌上搜索错误消息,但没有成功。
这是硬件错误,我需要更换驱动器,还是可以修复一些软件?另外,我还在尝试学习 Ubuntu 系统,所以如果有人能解释错误的含义,那就太好了。提前致谢。
长话短说,我修改了文件/usr/share/gnome-shell/theme/Yaru/gnome-shell-theme
,该文件应该更改登录屏幕壁纸。但是我对 CSS 一无所知,现在我无法再启动 Ubuntu。
我让我的笔记本电脑在 Windows 10 和 Ubuntu 20.04 之间双启动。所以我期待从 Windows 修复该文件。如何获得 root 权限,然后访问 Windows 上的 ubuntu 分区?
这些是我的尝试:
Ext2Fsd:它可以看到我所有分区的内容,除了 root 和 home。当我安装它们时,根分区和主分区似乎是空的。
Ext2Explorer:它没有显示分区(即使以管理员身份运行)
Linux阅读器:我挂载了根分区,居然可以进入CSS文件所在的目录!但是当我尝试修复它时(首先将其复制到 Windows,将其键入回其原始内容,然后将其粘贴回其目录),它说:没有这样的文件或目录。我还尝试禁用只读挂载权限,但总是会出现一个错误,导致进程停止。
DiskGenius:与 Linux Reader 相同:我可以访问 CSS 文件位置,复制和粘贴,但再次出现“没有这样的文件或目录”。
适用于 Linux 的 Windows 子系统:我去/dev
了ls -l
sdb1 2 3 4,其中一个是我的根分区。但是只有一堆tty文件,没有sdb。还去了/mnt
,它向我展示了 3 个 CDE 文件,它们是我的 Windows 分区。我使用 Ext2Fsd 将我的根挂载为 F,然后转到/mnt/F
. 它是空的。
我猜这些尝试失败了,因为我没有在根分区上写的权限。
我目前正在 Ubuntu 20.04 LTS 中编写一个 bash 脚本,它会自动备份运行 ubuntu-server 18.04 LTS 的设备。我不认为这是特定于版本的,所以我没有那样标记它。为了不必花费数小时通过命令行进行手动备份,我希望有一个自动备份设备的脚本。我唯一剩下的(我认为)是调整图像文件的大小,以免占用“空白”空间。
通常,您可以为映像文件设置循环,以便您可以访问分区,使用 调整分区大小gparted
,然后truncate
是映像文件。但是,当您备份大量设备时,这需要时间,我更愿意自动执行此操作。
我用于缩小.img
文件的代码部分旨在.img
从远程机器上运行的文件中设置一个循环dd
,然后访问主 ext4 分区,将其大小调整到存储已经存在的文件所需的最低限度就可以了,和truncate
分区一样,这样分区的大小就一样了。整个过程完成后,我将删除循环并对所有其他.img
文件重复该过程。目前我在理论上唯一需要完成的事情(尚未测试这部分)是用于缩小分区的命令。我想我已经弄清楚如何做其他所有事情,包括截断。
在过去的几天里,我对此进行了广泛的研究,我发现的只是通过命令行的方法,这些方法要求您直观地查看已使用的空间量,将分区大小调整为该大小,然后truncate
. 这种直观地查看已用空间等的方法不适用于我研究过的所有文章中配置的 bash 脚本。本文展示了我正在努力实现的目标,只是通过 gparted 而不是在 bash 脚本中自动实现。如开头所述,我需要它以MINIMUM与 Ubuntu 18.04-20.04 LTS 兼容。如果我遗漏了一些明显的东西,请告诉我。