pi: pi 2 os: respberrian jessie sd: sandisk 64gb

when i tried to install xvfb on my pi i started getting strange errors from the os, tried apt-get install -f and apt-get upgrade``` and ``apt-get clean autoclean` so clean worked install -f didn't do anything and autoclean and upgrade both get me back to the same strange situation.

i suspected sd card issue. it's a 64bg sdcard from sandisk (class 10). but unlike a PC i can't unmount the root file system and can't reload it as readonly as it's always "busy" so i tried to fsck on the next boot but could not find a method that works (boot was booting too fast).

below u can see the output of the command when trying to install lsof to see which files or seevices i need to stop in order to remount ro so i can use fsck.

Fetched 365 kB in 1s (318 kB/s) Selecting previously unselected package libperl4-corelibs-perl. dpkg: unrecoverable fatal error, aborting: reading files list for package 'javascript-common': Input/output error E: Sub-process /usr/bin/dpkg returned an error code (2) E: Failed to write temporary StateFile /var/lib/apt/extended_states.tmp pi@gal-pi:~ $ ls -bash: /bin/ls: No such file or directory pi@gal-pi:~ $ df -bash: /bin/df: No such file or directory pi@gal-pi:~ $ mount -bash: mount: command not found pi@gal-pi:~ $ bash -bash: /bin/bash: No such file or directory pi@gal-pi:~ $ cd -bash: sed: command not found pi@gal-pi:~ $ cd / -bash: sed: command not found -bash: printf: write error: Broken pipe pi@gal-pi:~ $

  1. anyone experienced it with his pi ?
  2. anyone has a good advise how to make forced test with raspberian jessie ? i'm pretty sure it works on systemd but debian made sure systemd will still call old initd scripts at least for some of them... so anyway to force fsck ?
  3. last possibility : should i cehck the sd using fsck on a linux system ( i have mint 17.4)


  • 1
    It looks like your SD card filesystem is corrupt. Are you sure you have an adequate Pi power supply? You can fsck the filesystem with another Linux by putting the card in an accessible SD card reader.
    – joan
    Commented Sep 26, 2016 at 18:58
  • #3 Shouldn't really be the "last possibility" unless you are afraid of linux -- I think that is what Mint is about? ;) ;) (if so the Pi may give you nightmares). Anyway, WRT to forcing fsck, try adding fsck.mode=force to /boot/cmdline.txt, but remember that file should be all one line, spaces between fields.
    – goldilocks
    Commented Sep 26, 2016 at 19:27
  • mint is my laptop and i was trying to avoid the external test since i need now to buy the damn adapter... :-/ will do the external test. Commented Sep 26, 2016 at 19:33
  • Ok. Used babblocks on the root partition device. Many were found. Could b it. Never buy sdcard on ebay... Commented Sep 27, 2016 at 5:14
  • small update, seems like it's not the SDcard after all, tested it on my linux mint 17.4 with card adapter and fsck.ext found no errors, badblocks found 0 bad blocks, i started fearing it may be the RSPI, but seems like the new ubuntu server for iot i've installed on another sd card works flawlessly... maybe the kenrel got defective in one of my installations. Commented Oct 10, 2016 at 12:07

1 Answer 1


You can check the filesystem of your SD card by booting the Pi from USB.

Once booted from USB, you can insert the microSD card and run fsck on it.

  • 1
    i wrote i use pi 2, this post is for 3 and specifically states that u wont be able to boot from usb this was from pi 2. one way i might be able to boot from usb is to hack cmdline.txt, not sure it will actually work though. Commented Sep 26, 2016 at 20:22
  • 1
    I updated link to point to a blog post about booting Pi 2 from USB. Commented Sep 26, 2016 at 20:51
  • 10x. tried to test your theorm, but then i discovered my usb flash contains mint x86_64.... need to burn rasberian instead. I have also discovered that id i connect the screen and keyboard and not using ssh i'm passed strait to emergency shell, so i could remount the system ro and run fsck on it. Commented Sep 27, 2016 at 10:59
  • put the SD card in any other PC, and check the FS and disk integrity with the disks utility. (I'll assume all your machines are linux). fsck wont do jack to tell you about physical disk integrity, it only checks the file-system.
    – j0h
    Commented Sep 27, 2016 at 12:19
  • j0h can u recommend one ? AFAIK badblocks does physical test to see for bad blocks and it found many, i mean many it really does seem like the sd is a gonner, probably since i saved many torrents using transmission daemon to sd before moving to external hard drive, could be what killed it. Commented Sep 28, 2016 at 8:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.