Corrupt SD - how to use fsck correctly?

Hi everyone, I’m suffering from corrupted SD cards and am in need of a file system check (fsck).

I note that it is available through the command line (built into Busybox). From the command line (via SSH) I’ve tried:

 fsck -ANV /dev/mmcblk0p1

I get:

fsck (busybox 1.27.2)
Checking all filesystems
root@swi-mdm9x28-wp:/mnt/userrw/sd#

As a response, but that’s it. Is there supposed to be more feedback?

Even just

fsck -V

Gives the same response.

I know for a fact that the SD card inserted has a bad file system and is marked read-only.

I figure I’m using it (fsck) incorrectly? Help please?
Cheers,
Terry

Suggest you trying fsck in Linux PC first.

Also are you using VFAT sytsem?

I will try in a Linux PC, thanks.
We are using FAT32. Do you recommend VFAT?

I saw that link you posted and unfortunately the link for the Yocto source for [http://downloads.sierrawireless.com/AirPrime/WP77xx/Release13/Legato-Dist-Source-mdm9x06-SWI9X06Y_02.35.02.00.tar.bz2 ] is dead. It has been reported to Sierra Wireless, but it has not been fixed.

Do you have an alternate way of updating busybox? I’m not sure how to do it via Leaf

Thanks!
Terry

you can try these binary first.
dosfstools.rar (551.9 KB)

mkdir /tmp/fsck.vfat
//now transfer those files in dosfstools.rar to /tmp/fsck.vfat folder via WINSCP
chmod -R 777 /tmp/fsck.vfat/*

root@swi-mdm9x28-wp:~# /tmp/fsck.vfat/fsck.vfat
CP437: Invalid argument
usage: /tmp/fsck.vfat/fsck.vfat [-aAbflrtvVwy] [-d path -d ...] [-u path -u ...]
               device
  -a       automatically repair the filesystem
  -A       toggle Atari filesystem format
  -b       make read-only boot sector check
  -c N     use DOS codepage N to decode short file names (default: 437)
  -d path  drop that file
  -f       salvage unused chains to files
  -l       list path names
  -n       no-op, check non-interactively without changing
  -p       same as -a, for compat with other *fsck
  -r       interactively repair the filesystem (default)
  -t       test for bad clusters
  -u path  try to undelete that (non-directory) file
  -v       verbose mode
  -V       perform a verification pass
  -w       write changes to disk immediately
  -y       same as -a, for compat with other *fsck
root@swi-mdm9x28-wp:~#

Hi,
We can also provide the yocto compilation we made sometime ago.
I will post it tomorrow, I don’t have the machine here with me.
@jyijyi the rar you are providing is dos or yocto?
regards

just some binary files:

Thank you! I will try this shortly and let you know how I go

Hi everyone, the SCP method worked and I was able to fix the issues. However, I would like to perform this check automatically and have it built in (rebuild Yocto), but as mentioned before, the links are dead from Sierra Wireless.

@epastor are you able to share your compilation please? I would appreciate it greatly

Kind regards,
Terry

you can save the binary tool in /home/root.
also you can modify startlegato.sh to run init script to check.

1 Like

Thank you, I will try that

@jyijyi Thanks for your help so far - I’m nearly there!
I have everything working, however I’m wondering if it is possible to write the output from fsck (-v verbose) to a text file in /tmp?

EDIT: I got it - append | tee /tmp/fsck.txt

Thanks again
TC

this is also ok to me:

/tmp/fsck.vfat/fsck.vfat &> /tmp/test.txt

1 Like