解决sd 只读问题 fsck.auto not found

本文讲述了在嵌入式设备上遇到fsck工具无法使用的问题,通过查找发现FAT/VFAT来自dosfstools包,需进行cross-compile。作者详细指导了如何从GitHub下载dosfstools源码,配置编译并安装的过程,包括`autogen.sh`和`sudo make install`步骤。

我们的是嵌入式设备,一开始想借助busybox的 fsck工具去修复 busybox版本V1.34.1和 V1.31版本都不行 一直显示fsck.auto 未找到

在这里插入图片描述

一开始感觉是busybox缺少fsck包的问题,把两个版本的都重新编译了一遍, 编译的时候menuconfig一直不成功,只能用deconfig,编译完搜索了下,确实有fsck的包,但是问题依旧。
后来又去google查到
https://support.xilinx.com/s/question/0D52E00006hpXdt/fsck-fsckauto-no-such-file-or-directory?language=en_US
FAT/VFAT 来自 dosfstools 包…出于某种原因,它似乎不在 Petalinux 中(也许我错过了它,或者它的名称不同)
因为sd卡格式为fat32 所以只能去交叉编译dosfstools
dosfstools 的代码在github上可以找到 网址为https://github.com/dosfstools/dosfstools/
通过git clone 下载下来的代码 需要执行
./autogen.sh
才会出现 ./configure 后续操作 就是按照git页面的帮助操作就可以了 如果是用的有交叉编译链 可以参考我的操作
./configure CC="$CC" host=arm

make CC="$CC" host=arm
sudo make install 这块需要sudo权限,
install后的文件在 src目录 需要哪个 复制到开发板即可

IPL g9154ea4 D-27 HW Reset MCP1866_4X miupll_468MHz 1024MB BIST0_0001-OK GIC Init Load IPL_CUST from EMMC Checksum OK IPL_CUST g9154ea4 Load UBOOT from EMMC u32RunAddr = 0x23e00000 laodaddr = 0x23d00000 U-Boot 2015.01 (Feb 07 2025 - 17:26:20) Version: M6##g4bf9b3f I2C: ready DRAM: WARNING: Caches not enabled MMC: board_emmc_init [ eMMC_pads_switch() ] 1X/4X-MOD [ eMMC_Identify() ] CMD1 try: 02h Cost:7 [ eMMC_pads_switch() ] 1X/4X-MOD [ eMMC_SetBusWidth() ] set 4 bus width au8_CID: 3F EC 1 0 53 4A 54 31 42 30 eMMC 29655MB part_type: 6(0:Unknw 6:eMMC) has_init: 1 Mstar-eMMC: 0 In: serial Out: serial Err: serial Net: MAC Address 00:30:1B:BA:02:DB Auto-Negotiation... Link Status Speed:100 Full-duplex:1 sstar_emac MMC read: dev # 0, block # 1536, count 6144 ... 6144 blocks read: OK ## Booting kernel from Legacy Image at 21000000 ... Image Name: MVX4##M6##g6e5fcacKL_LX409##[BR: Image Type: ARM Linux Kernel Image (lzma compressed) Data Size: 2124964 Bytes = 2 MiB Load Address: 20008000 Entry Point: 20008000 Verifying Checksum ... OK Uncompressing Kernel Image ... [XZ] !!!reserved 0x21000000 length=0x 1000000 for xz!! XZ: uncompressed size=0x438000, ret=7 OK atags:0x20000000 Starting kernel ... Booting Linux on physical CPU 0x0 Linux version 4.9.227 (causer@szjk6401) (gcc version 9.1.0 (GCC) ) #2 SMP PREEMPT Tue Nov 16 18:13:04 CST 2021 CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=70c5383d CPU: div instructions available: patching division code CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache early_atags_to_fdt() success OF: fdt:Machine model: MERCURY6 SSC016A-S01A-S LXmem is 0x3ffe0000 PHYS_OFFSET is 0x20000000 Add mem start 0x20000000 size 0x3ffe0000!!!! LX_MEM = 0x20000000, 0x3ffe0000 LX_MEM2 = 0x0, 0x0 LX_MEM3 = 0x0, 0x0 EMAC_LEN= 0x0 DRAM_LEN= 0x0 deal_with_reserved_mmap memblock_reserve success mmap_reserved_config[0].reserved_start= 0x5f000000 deal_with_reserve_mma_heap memblock_reserve success mma_config[0].reserved_start= 0x40000000 cma: Reserved 2 MiB at 0x0000000023800000 Memory policy: Data cache writealloc [mercury6_smp_init_cpus] [mercury6_smp_init_cpus] percpu: Embedded 13 pages/cpu s21016 r8192 d24040 u53248 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 134112 Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p2 aidev=/dev/mmcblk0p3 ringdev=/dev/mmcblk0p4 rwdev=/dev/mmcblk0p9 rootfstype=squashfs virtual_mtdnum=0 ro init=/linuxrc LX_MEM=0x3ffe0000 mma_heap=mma_heap_name0,miu=0,sz=0x1F000000 mma_memblock_remove=1 cma=2M@0x23800000 mmap_reserved=fb,miu=0,sz=0x800000,max_start_off=0x3F000000,max_end_off=0x3F800000 fast=0 test_mode=y os_size=2125028 PID hash table entries: 2048 (order: 1, 8192 bytes) Dentry cache hash table entries: 65536 (order: 6, 262144 bytes) Inode-cache hash table entries: 32768 (order: 5, 131072 bytes) Memory: 520900K/540544K available (2498K kernel code, 193K rwdata, 1308K rodata, 176K init, 157K bss, 17596K reserved, 2048K cma-reserved, 8064K highmem) Virtual kernel memory layout: vector : 0xffff0000 - 0xffff1000 ( 4 kB) fixmap : 0xffc00000 - 0xfff00000 (3072 kB) vmalloc : 0xe0800000 - 0xff800000 ( 496 MB) lowmem : 0xc0000000 - 0xe0000000 ( 512 MB) pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB) modules : 0xbf000000 - 0xbfe00000 ( 14 MB) .text : 0xc0008000 - 0xc0278e18 (2500 kB) .init : 0xc03e2000 - 0xc040e000 ( 176 kB) .data : 0xc040e000 - 0xc043e7a8 ( 194 kB) .bss : 0xc0440000 - 0xc0467474 ( 158 kB) SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 Preemptible hierarchical RCU implementation. Build-time adjustment of leaf fanout to 32. RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2. RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2 NR_IRQS:16 nr_irqs:16 16 GICv3: CPU0: found redistributor 0 region 0:0x0000000016040000 ms_init_main_intc: np->name=ms_main_intc, parent=gic ms_init_pm_intc: np->name=ms_pm_intc, parent=ms_main_intc ss_init_gpi_intc: np->name=ms_gpi_intc, parent=ms_main_intc Find CLK_ven_pll, hook ms_venpll_ops Find CLK_cpupll_clk, hook ms_cpuclk_ops arm_arch_timer: Architected cp15 timer(s) running at 6.00MHz (virt). clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1623fa770, max_idle_ns: 440795202238 ns sched_clock: 56 bits at 6MHz, resolution 166ns, wraps every 4398046511055ns Switching to timer-based delay loop, resolution 166ns console [ttyS0] enabled Calibrating delay loop (skipped), value calculated using timer frequency.. 12.00 BogoMIPS (lpj=60000) pid_max: default: 4096 minimum: 301 Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) CPU: Testing write buffer coherency: ok CPU0: thread -1, cpu 0, socket 0, mpidr 80000000 [mercury6_smp_prepare_cpus] Setting up static identity map for 0x20008280 - 0x200082b0 [mercury6_boot_secondary] [mercury6_secondary_init] GICv3: CPU1: found redistributor 1 region 0:0x0000000016060000 CPU1: thread -1, cpu 1, socket 0, mpidr 80000001 Brought up 2 CPUs SMP: Total of 2 processors activated (24.00 BogoMIPS). CPU: All CPU(s) started in SVC mode. devtmpfs: initialized VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4 clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns futex hash table entries: 16 (order: -2, 1024 bytes) NET: Registered protocol family 16 DMA: preallocated 256 KiB pool for atomic coherent allocations Version : MVX4##M6##g6e5fcacKL_LX409##[BR:HEAD]#XVM GPIO: probe end[Padmux]reset PAD149(reg 0x103c00:61; mask0xc0) t0 SD1_MODE_1 (org: EMMC1_4B_MODE_1) [Padmux]reset PAD148(reg 0x103c00:61; mask0x7000) t0 SD1_CDZ_MODE_1 (org: EMMC1_RST_MODE_4) [Padmux]reset PAD6(reg 0x3f00:0; mask0x8) t0 UART1_MODE_1 (org: GPIO_MODE) [Padmux]reset PAD7(reg 0x3f00:1; mask0x8) t0 UART1_MODE_1 (org: GPIO_MODE) hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers. hw-breakpoint: maximum watchpoint size is 8 bytes. SCSI subsystem initialized clocksource: Switched to clocksource arch_sys_counter NET: Registered protocol family 2 TCP established hash table entries: 4096 (order: 2, 16384 bytes) TCP bind hash table entries: 4096 (order: 4, 81920 bytes) TCP: Hash tables configured (established 4096 bind 4096) UDP hash table entries: 256 (order: 1, 12288 bytes) UDP-Lite hash table entries: 256 (order: 1, 12288 bytes) NET: Registered protocol family 1 hw perfevents: enabled with armv7_cortex_a53 PMU driver, 7 counters available workingset: timestamp_bits=30 max_order=17 bucket_order=0 squashfs: version 4.0 (2009/01/31) Phillip Lougher jffs2: version 2.2. © 2001-2006 Red Hat, Inc. bounce: pool size: 64 pages io scheduler noop registered io scheduler deadline registered (default) SStar USB3 PHY probe, base:fd2a4600 libphy: Fixed MDIO Bus: probed mousedev: PS/2 mouse device common for all mice i2c /dev entries driver 1f221000.uart: ttyS0 at MMIO 0x0 (irq = 58, base_baud = 10800000) is a unknown 1f221200.uart1: ttyS1 at MMIO 0x0 (irq = 59, base_baud = 10800000) is a unknown 1f220400.fuart: ttyS2 at MMIO 0x0 (irq = 60, base_baud = 10800000) is a unknown 1f221400.uart2: ttyS3 at MMIO 0x0 (irq = 62, base_baud = 10800000) is a unknown 1f221600.uart3: ttyS4 at MMIO 0x0 (irq = 63, base_baud = 10800000) is a unknown [MS_PM_INTC] hw:6 -> v:92 [MS_PM_INTC] hw:7 -> v:93 MSYS: DMEM request: [emac0_buff]:0x00000812 MSYS: DMEM request: [emac0_buff]:0x00000812 success, CPU phy:@0x23846000, virt:@0xC3846000 libphy: mdio: probed mdio_bus mdio-bus@emac0: /soc/emac0/mdio-bus@emac0/ethernet-phy@0 has invalid PHY address mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 0 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 1 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 2 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 3 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 4 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 5 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 6 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 7 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 8 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 9 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 10 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 11 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 12 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 13 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 14 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 15 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 16 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 17 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 18 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 19 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 20 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 21 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 22 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 23 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 24 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 25 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 26 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 27 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 28 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 29 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 30 mdio_bus mdio-bus@emac0: scan phy ethernet-phy at address 31 [emac_phy_connect][3592] connected mac emac0 to PHY at mdio-bus@emac0:00 [uid=11112222, driver=SStar 10/100 Ethernet Phy] MSYS: DMEM request: [emac1_buff]:0x00060812 MSYS: DMEM request: [emac1_buff]:0x00060812 success, CPU phy:@0x23850000, virt:@0xC3850000 libphy: mdio: probed mdio_bus mdio-bus@emac1: /soc/emac1/mdio-bus@emac1/ethernet-phy@1 has invalid PHY address mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 0 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 1 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 2 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 3 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 4 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 5 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 6 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 7 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 8 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 9 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 10 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 11 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 12 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 13 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 14 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 15 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 16 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 17 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 18 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 19 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 20 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 21 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 22 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 23 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 24 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 25 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 26 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 27 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 28 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 29 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 30 mdio_bus mdio-bus@emac1: scan phy ethernet-phy at address 31 [emac_phy_connect][3592] connected mac emac1 to PHY at mdio-bus@emac1:00 [uid=00000000, driver=Generic PHY] MSYS: DMEM request: [AESDMA_ENG]:0x00001000 MSYS: DMEM request: [AESDMA_ENG]:0x00001000 success, CPU phy:@0x23847000, virt:@0xC3847000 MSYS: DMEM request: [AESDMA_ENG1]:0x00001000 MSYS: DMEM request: [AESDMA_ENG1]:0x00001000 success, CPU phy:@0x23848000, virt:@0xC3848000 [ms_cpufreq_init] Current clk=799999872 mstar_spinand_probe: mstar_spinand enableClock MSYS: DMEM request: [BDMA]:0x00000840 MSYS: DMEM request: [BDMA]:0x00000840 success, CPU phy:@0x23849000, virt:@0xC3849000 [emac_phy_link_adjust] EMAC Link Down [emac_phy_link_adjust] EMAC Link Down [emac_phy_link_adjust] EMAC Link Up 分析下固件升级失败的原因以及解决方法。
最新发布
10-28
### 关于 `fsck.fvat` 未找到的错误分析 在 Linux 系统中,`fsck` 是一个用于检查和修复文件系统错误的工具。然而,用户提到的 `fsck.fvat` 并不存在于标准的 Linux 文件系统工具集中[^1]。可能的情况是拼写错误或者是对文件系统类型的理解有误。通常,`fsck` 工具会根据文件系统类型(如 ext4、xfs、ntfs 等)调用相应的子工具进行操作。 如果确实需要修复文件系统,可以尝试以下方法: 1. **确认文件系统类型** 使用 `lsblk -f` 或 `blkid` 命令来查看设备的文件系统类型。例如: ```bash lsblk -f ``` 或者 ```bash blkid /dev/sdX ``` 2. **使用正确的 fsck 工具** 根据文件系统类型选择合适的 `fsck` 子工具。例如,对于 ext4 文件系统,可以运行: ```bash sudo fsck.ext4 /dev/sdX ``` 3. **检查环境变量或路径问题** 如果系统提示 `fsck.fvat` 未找到,可能是由于环境变量配置错误或路径缺失导致的。可以通过以下命令检查 `fsck` 的安装位置: ```bash which fsck ``` 或者 ```bash whereis fsck ``` 4. **重新安装相关工具** 如果确认 `fsck` 工具缺失,可以尝试重新安装文件系统工具包。例如,在基于 Debian 的系统上,可以运行: ```bash sudo apt-get install --reinstall e2fsprogs ``` 5. **排查拼写错误** 如果 `fvat` 是用户自定义的文件系统类型,需确保相关工具已正确安装并配置到系统中。否则,请检查是否存在拼写错误。 ### 示例代码 以下是一个简单的脚本,用于检查并尝试修复指定设备的文件系统: ```bash #!/bin/bash DEVICE="/dev/sdX" # 替换为实际设备名称 FILESYSTEM_TYPE=$(lsblk -f | grep "$DEVICE" | awk '{print $2}') if [ -z "$FILESYSTEM_TYPE" ]; then echo "无法识别设备 $DEVICE 的文件系统类型" exit 1 fi echo "检测到文件系统类型: $FILESYSTEM_TYPE" # 构造 fsck 命令 FSCK_CMD="sudo fsck.$FILESYSTEM_TYPE $DEVICE" echo "正在执行: $FSCK_CMD" $FSCK_CMD ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值