oninoshiko
Posts: 76
Joined: Sun Jan 29, 2012 9:16 pm

Re: How to protect the filesystem without a save shutdown button?

Mon Feb 20, 2012 6:03 pm

rrolsbe said:


When/if the Puppy Linux developers get it working on the Pi, I hope to run the SDHC card write-locked most of the time.  Let me explain:  I currently boot most of the time into x86 Puppy Linux on my Netbook with the SDHC card write locked and with my Kanguru USB stick write locked on my notebook.  This serves two purposes, even if I did pick up some nasty while browsing/reading Web based Gmail, nothing persistent can be written to any files on these flash devices and I can just turn them off with their power buttons (handy when browsing on a non-encrypted wifi and when traveling by air).  PS-- Before anyone brings it up, I am aware that the write lock on an SDHC card is not a true hardware write-lock as it is on the USB Kanguru stick.  I need to trust SDCH reader is correctly honoring the SDHC write lock tab (which it appears to be doing).  The only time I unlock either of these devices is when I initially create the bootable flash media or when I want to modify something and have it available for future use.


This is a really good point. I was thinking about this the other day. If you have a static setup you are doing (say, some of us decide to make downloadable "cartradges") setting the write-lock tab is a really good idea, I think.

How does that tab work?

It has to be honored by the OS (or just the reader?)?

It doesn't lock it at the card level (ie, the card just returns "no" on a write)?

I thought I read on one of the other posts that SD cards care most of the controller with them, wouldn't that imply that it's up to the card to honor it?

User avatar
Vindicator
Posts: 314
Joined: Sat Sep 17, 2011 11:10 pm
Location: Susanville Ca USA
Contact: Website

Re: How to protect the filesystem without a save shutdown button?

Mon Feb 20, 2012 6:33 pm

My server runs windows server 2003 (approximately 4 years) and I have also ran for some time Ubuntu server 10.04.(Ubuntu server was set up just to learn how to setup Samba shares ftp etc. have not been using it recently)

In the mountains in California were I live we loose power very often(at least once a month) and with every other storm during the winter as well as in the summer from brownouts etc.

I have never had either system corrupted by power failure and that is not including how often the wife powers it off by holding the power button in since it is headless or unplugs it for her vacuum cleaner or other device.

I prefer to do a proper shutdown on any system but they all seem to be robust enough to survive the event.

I do not run systems off of the SD cards but would only envision a problem if the card was being written too and only the files involved should get corrupted with most modern file systems.

Since an image is available it would be easy enough to fix a catastrophic failure as long as it is the primary image, and backups of other data could be stored on a separate device in classrooms.
If you are more worried about ,spelling, punctuation or grammar you have probably already missed the point so please just move on.

TonyHoyle
Posts: 25
Joined: Thu Nov 24, 2011 3:34 pm

Re: How to protect the filesystem without a save shutdown button?

Mon Feb 20, 2012 7:55 pm

I'll probably see if I can port iPXE then just run the entire thing over iscsi.  That way there's zero risk (unless someone switches the server off, but if that ever happens loads of stuff goes titsup anyway).

error404
Posts: 351
Joined: Wed Dec 21, 2011 11:49 pm

Re: How to protect the filesystem without a save shutdown button?

Mon Feb 20, 2012 9:28 pm

@Vindicator: Your sample size is too small.

User avatar
Vindicator
Posts: 314
Joined: Sat Sep 17, 2011 11:10 pm
Location: Susanville Ca USA
Contact: Website

Re: How to protect the filesystem without a save shutdown button?

Mon Feb 20, 2012 11:10 pm

Was posted as a fact not a theoretical sample size.

Server is still running after 100+ power outages with no ill effects.

I worked for 15 years in a mill here in CA and power problems were an issue with thousands of motor starts a day and even then the hard drives died not the file systems, Most of the drives would survive about 11 months from this kind of punishment.(and the same power outages)( corporate required intense records of hard drives as our pricing was on most of them, install date/ uninstall date /destruction date as all drives had to be destroyed and sent to corporate as proof of destruction)

Workstations (19) ran win 95 and the servers (2) ran win NT 4.0

Workstation were for bar-code and quality control, managers etc.

I performed the maintenance and repairs for the plant systems so I have a little knowledge in this area, How many PC's have you seen buried in an inch or more of saw dust and wood chips LOL hence lots of cleaning and regular maintenance.
If you are more worried about ,spelling, punctuation or grammar you have probably already missed the point so please just move on.

error404
Posts: 351
Joined: Wed Dec 21, 2011 11:49 pm

Re: How to protect the filesystem without a save shutdown button?

Tue Feb 21, 2012 1:02 am

It is not a fact, that is the point. Unclean shutdowns will cause filesystem corruption. Period. If you're lucky you can recover from it without data loss. Most modern filesystems are fairly robust against it (though NTFS breaks far more than most IME), but throw in the flash storage layer complications and multiply by a couple of hundred unclean shutdowns per day at school and you're bound to run into issues.

It's just not good practice and should be avoided if possible. Shutting down safely is trivial.

User avatar
Vindicator
Posts: 314
Joined: Sat Sep 17, 2011 11:10 pm
Location: Susanville Ca USA
Contact: Website

Re: How to protect the filesystem without a save shutdown button?

Tue Feb 21, 2012 2:45 am

Agreed that safe shutdowns should be used as much as possible but to act as if every unclean shutdown may destroy the system is also unwarranted.

The sky is not falling.

The school children should be taught to use a clean shutdown but forgetting too is not going to make the planet collapse.

Flash storage may be less robust but every event is not going to be fatal.

As per the original topic I think we can at least agree that proper shutdown is advised.

Hence the shutdown menu in GUI's/

Or "shutdown now -h" should solve the problem.

I don't see smart power supplies with a shutdown button in the near future for the Raspi.(especially since there are no data lines in the power connector to communicate to the power supply.)
If you are more worried about ,spelling, punctuation or grammar you have probably already missed the point so please just move on.

plugwash
Forum Moderator
Forum Moderator
Posts: 3502
Joined: Wed Dec 28, 2011 11:45 pm

Re: How to protect the filesystem without a save shutdown button?

Tue Feb 21, 2012 3:17 am

JamesH said:


Well, I haven't trashed my SD card on my alpha board, and I was pressing the power button all the time on that at fairly random intervals. I don;t think I have ever issued the 'shutdown' command. I think the problem is being massively overstated.


Well i've been running debian on a few beagleboards (with a read-write root filesystem) for a while and i've seen

1: several instances of systems (with ext3 root filesystems) running into fsck errors that require manual interaction to fix (which is a pain when that means hooking up a serial console).

2: one instance of the sectors containing the ext3 superblock becoming unreadable (I was able to recover the filesystem after cloning the card, I did not try wiping the original card to see if that made all sectors readable again, maybe I should).

error404
Posts: 351
Joined: Wed Dec 21, 2011 11:49 pm

Re: How to protect the filesystem without a save shutdown button?

Tue Feb 21, 2012 5:35 am

Vindicator said:


The sky is not falling.


I never said it was, just that acting like it won't cause any problems is naive and would inevitably end in tears. It shouldn't be standard practice, is basically the point.

User avatar
Jongoleur
Posts: 1179
Joined: Thu Aug 11, 2011 12:47 pm
Location: O'erlooking the sea, and all those effin windfarms...

Re: How to protect the filesystem without a save shutdown button?

Tue Feb 21, 2012 8:53 am

Its all jolly interesting stuff, but remember you're talking about an inexpensive computer that doesn't warrant comprehensive power-cycling circuitry, especially in the environment for which it is intended.

Power control circuitry, like that for a real time clock, is expensive to add at a $25/$35 price point and isn't currently worth it. As has been discussed ad nauseam in other threads, there are lots of things that can be viewed as desirable (more memory, VGA output, WiFi, SATA, etc, etc)  but are not economically possible.

After the first one or two data-loss incidents resulting from abrupt power-down, even the most obtuse child will learn that THIS ISN'T THE THING TO DO!  Losing work is a powerful motivator and the ritual of saving work and selecting "shut down" will soon become second nature.

And mental discipline is a good trait to inculcate in the young.

Now, how many angels can dance on the head of a pin? 

Edit: for typos, etc, etc...
I'm just a bouncer, splatterers do it with more force.....

HansH
Posts: 214
Joined: Mon Sep 05, 2011 7:49 am

Re: How to protect the filesystem without a save shutdown button?

Tue Feb 21, 2012 1:01 pm

kme said:


Yes, the entire thing is a non-issue. The VFAT partition with the boot loader is essentially a RO file system. The core Linux system is on ext3/etx4 partitions which are journaled and very, very hard to break.


If you are wise, you are not going to use journaling on a flashdisk....

Most part of the filesystems can be mounted readonly (no journaling, no atime)

only some parts needs to be set to tmpfs  (/var/lock, /var/run)

See : http://twobit.us/blog/2010/01/.....e-disk-io/

User avatar
cnxsoft
Posts: 191
Joined: Sat Oct 15, 2011 2:33 pm
Location: Chiang Mai, Thailand
Contact: Website

Re: How to protect the filesystem without a save shutdown button?

Tue Feb 21, 2012 1:30 pm

HansH said:


kme said:


Yes, the entire thing is a non-issue. The VFAT partition with the boot loader is essentially a RO file system. The core Linux system is on ext3/etx4 partitions which are journaled and very, very hard to break.


If you are wise, you are not going to use journaling on a flashdisk....

Most part of the filesystems can be mounted readonly (no journaling, no atime)

only some parts needs to be set to tmpfs  (/var/lock, /var/run)

See : http://twobit.us/blog/2010/01/.....e-disk-io/



This is a safer way to proceed and if you need to write some extra data - for example, if you run a web browser and cache is enabled -, you can to store the data in another partition.

I used to work for a company doing digital signage player, and from time to time the file system crashed. In some case, this was a pain, since the customer had to take a ladder to access the monitor and open it to retrieve the CF card,  then reinitialize the CF card, finally go up the ladder again to insert the CF card back.

Return to “General discussion”