NotRequired
Posts: 196
Joined: Sat Apr 29, 2017 10:36 am
Location: Denmark

Upgrade wrecked file system, sort of..

Sat Apr 29, 2017 10:51 am

So, I ventured into a "apt-get update && apt-get upgrade" to get up to date with my Pi 3 model B. I did it in the hope of some issues getting fixed. There where no errors during the upgrade, all looked perfect. After I rebooted the Pi, no access via SSH, Pi not responding, bummer :( I plugged it in to a monitor and found that there was a systemd message about some basic.target error, meaning file system was kaput :evil: I took out the memory card and plugged it into a card reader and issued a "fsck -y /dev/the_sdcard" and a troubeling amount of errors was found, all corrected though 8-) I tried to put the card back into the Pi and now it booted, but into some rescue mode (probably due to a missing drive mounted with fstab) :roll: I plugged the drive and the network cable into the Pi, and would you look.. It booted perfectly normal, everything apparantly is working flawlessly :shock:

Now my question is - should I be concerned, or should I just consider the issue corrected? And why would an upgrade mess up the file system like that?
Please do not ask questions in private messages, they will not help others.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6234
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Upgrade wrecked file system, sort of..

Sat Apr 29, 2017 11:17 am

I have never seen this myself, but it occasionally pops up on the forum. I don't know if some cards are susceptible to this or if it's a power issue.
NotRequired wrote:should I be concerned, or should I just consider the issue corrected?
I would be concerned if I was seeing random data loss.
NotRequired wrote: And why would an upgrade mess up the file system like that?
Because that's when most of the writes happen.

NotRequired
Posts: 196
Joined: Sat Apr 29, 2017 10:36 am
Location: Denmark

Re: Upgrade wrecked file system, sort of..

Sat Apr 29, 2017 11:38 am

Thank you for your reply. The card is a Kingston SDC10G2 16GB, listed as both red and green in this list: http://elinux.org/RPi_SD_cards Looking at this post: viewtopic.php?f=28&t=143588 it seems like this is a known issue with this card (and some other cards as well). I've been running the card 100% stable for some months, though, and it must have been wrecked by the upgrade procedure, and I would really like to know why? Is there a list of cards which are 100% verified as good?
Please do not ask questions in private messages, they will not help others.

fruitoftheloom
Posts: 23917
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Upgrade wrecked file system, sort of..

Sat Apr 29, 2017 12:01 pm

NotRequired wrote:Thank you for your reply. The card is a Kingston SDC10G2 16GB, listed as both red and green in this list: http://elinux.org/RPi_SD_cards Looking at this post: viewtopic.php?f=28&t=143588 it seems like this is a known issue with this card (and some other cards as well). I've been running the card 100% stable for some months, though, and it must have been wrecked by the upgrade procedure, and I would really like to know why? Is there a list of cards which are 100% verified as good?
All Flash Media has a read / write life, branded ones are generally more robust.

Using a USB Hard Drive is one solution, how to depends on RPi Model:

https://www.raspberrypi.org/documentati ... /README.md
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot) RaspiOS64 ARM64
Asus ChromeBox 3 Celeron is my other computer...

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6234
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Upgrade wrecked file system, sort of..

Sat Apr 29, 2017 1:38 pm

I use the official raspberry pi ones and have never had a problem.

NotRequired
Posts: 196
Joined: Sat Apr 29, 2017 10:36 am
Location: Denmark

Re: Upgrade wrecked file system, sort of..

Sat Apr 29, 2017 5:56 pm

@fruitoftheloom: I know that SD-cards are not the best type of storage, probably the worst, but it is a brand new SD-card bought for the Pi, so I hardly doubt that this issue is/was caused by a faulty SD-card. I would like to use a USB harddrive for boot but the reason for my upgrade venture was that the USB-drive attached to the Pi disconnects and then reconnects as read-only every now and then causing all sorts of problems. I do not think the system would like to be placed on a drive which drops out every now and then (not a power issue, drive takes power directly from a 2,5 amp genuine Raspberry power adapter) ;)

@ShiftPlusOne: My local Raspberry dealer ( raspberrypi.dk ) ships Transcend as Pi-cards and I do not think they are of better quality than the Kingston I use. I'm wondering if this issue could have been caused by the data written to the card not being "flushed" properly?
Please do not ask questions in private messages, they will not help others.

User avatar
jadro
Posts: 452
Joined: Sun Oct 02, 2016 1:20 pm
Location: Croatia

Re: Upgrade wrecked file system, sort of..

Sat Apr 29, 2017 8:16 pm

If you have problem as I had, please reboot Raspberry Pi twice, it helped me in this problem and now I can connect with my Raspberry Pi again..

viewtopic.php?f=63&t=181802

Jadro
Oracle backend database developer
SmartHome IoT & Microprocessor enthusiast and hobbyist

pcmanbob
Posts: 9773
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Upgrade wrecked file system, sort of..

Sun Apr 30, 2017 10:41 am

I always obey the golden rule now.

"Before installing new software or updating a working project always make an image of the SD card first"

it has save my bacon on several occasions including an SD card being corrupted.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

NotRequired
Posts: 196
Joined: Sat Apr 29, 2017 10:36 am
Location: Denmark

Re: Upgrade wrecked file system, sort of..

Sun Apr 30, 2017 6:25 pm

@jadro: I did reboot more than twice. The pi loaded normally until initialization of systemd basic.target which failed. Then a pause and then some other EXT4-fs errors showed up. After that the pi halted for 3-5 minutes and then the screen went dark: http://peecee.dk/upload/view/466653/full It seems like the fsck of the SD-card has solved the issue - but I'm going to reflash the card and start all over when time is. Next time I'm going to do as "pcmanbob" says and "dd" an image of the SD-card before doing any major modifications to it :)
Please do not ask questions in private messages, they will not help others.

NotRequired
Posts: 196
Joined: Sat Apr 29, 2017 10:36 am
Location: Denmark

Re: Upgrade wrecked file system, sort of..

Sat May 20, 2017 11:22 am

So.. I have been poking around a bit with this issue. I tried to re-do all the steps in order to see if the problem is a freak accident or reproducable. The steps done are (i know the used image is not recent!):

1) dd 2017-02-16-raspbian-jessie to Kingston SDC10G2 16GB && sync
2) Boot (RBP3B) and adjust the system (clock, locale, enable SSH and so on with raspi-config)
3) Re-boot
4) sudo apt-get update && sudo apt-get upgrade && sudo shutdown -r now

After the reboot the SD-card had file system errors. I tried twice and the errors seems to differ but both times the system was un-bootable, one time even beyond repair. Then I tried to modify step 4 to: "sudo apt-get update && sudo apt-get upgrade && sync && sudo shutdown -r now" and the issue was apparently not present. However, I have had issues with the Pi not always booting (red light on, no yellow activity flashing) at all with the SD-card, so the Kingston SDC10G2 may just be a bad pick for Pi.

Now I have switched to a SanDisk Ultra SD card (SDSQUNB-016G-GN3MN). I have had no issues with the above 4 steps, even if "sync" was not issued. I would, however, encourage anyone to do a sync after using apt-get, and it would be nice if apt-get itself would sync after it has done it's task. This may reduce problems with broken file systems and increase customer satisfaction with Pi :)
Please do not ask questions in private messages, they will not help others.

jahboater
Posts: 5963
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Upgrade wrecked file system, sort of..

Sat May 20, 2017 11:48 am

A commonly recommended card is the Samsung EVO+
I have many Samsung cards in Pi's over the years with never a problem and good performance.

Return to “General discussion”