Welcome! Log In Create A New Profile

Advanced

Unclean I tell you, unclean...

Posted by glalonde 
Unclean I tell you, unclean...
August 22, 2011 06:40PM
About once every six months the power goes off long enough that even my UPS gives up, which causes the DebianDock(dockstar with debian) to just get cut off. Problem is, the last few times this has happened, it will not reboot. The only way I can fix this is boot my main PC in debian mount the USB key an do a fsck to fix the filesystem. I think it said something about unclean prior to the fsck. I try to login about once a week and just do a sync, but I guess that is not enough. Is this normal? What can I do to help a good reboot after power lose?

It's just a bit more important now since I host my website itself of my pogoplug vs just using it for fun like I was a few months before.

Glen Lalonde
www.binarysearchtree.com

(Just noticed another thread on this issue, but I don't see a way to delete this one...sorry)



Edited 1 time(s). Last edit at 08/22/2011 06:45PM by glalonde.
Re: Unclean I tell you, unclean...
August 23, 2011 08:11AM
glalonde Wrote:
-------------------------------------------------------
> About once every six months the power goes off
> long enough that even my UPS gives up, which
> causes the DebianDock(dockstar with debian) to
> just get cut off. Problem is, the last few times
> this has happened, it will not reboot. The only
> way I can fix this is boot my main PC in debian
> mount the USB key an do a fsck to fix the
> filesystem. I think it said something about
> unclean prior to the fsck. I try to login about
> once a week and just do a sync, but I guess that
> is not enough. Is this normal? What can I do to
> help a good reboot after power lose?
>
> It's just a bit more important now since I host my
> website itself of my pogoplug vs just using it for
> fun like I was a few months before.


I've had the same experience - have a power outage and then sometimes the Dockstar won't boot.

My solution: once I have a boot software load that works, I clone it to a hard disk with Clonezilla. See http://clonezilla.org/

Then I can restore that image to two different boot drives, say A and B. Then boot the Dockstar from A. If there's a power outage and A won't boot anymore, boot the Dockstar from B, use Clonezilla to reload the bootable image from the hard disk to A, and wait for the next power outage.

If your boot software load changes frequently this may be too time-consuming, though.
Re: Unclean I tell you, unclean...
August 24, 2011 10:36PM
hanker Wrote:
-------------------------------------------------------
> glalonde Wrote:
> --------------------------------------------------
> -----
> > About once every six months the power goes off
> > long enough that even my UPS gives up, which
> > causes the DebianDock(dockstar with debian) to
> > just get cut off. Problem is, the last few
> times
> > this has happened, it will not reboot. The only
> > way I can fix this is boot my main PC in debian
> > mount the USB key an do a fsck to fix the
> > filesystem. I think it said something about
> > unclean prior to the fsck. I try to login about
> > once a week and just do a sync, but I guess
> that
> > is not enough. Is this normal? What can I do to
> > help a good reboot after power lose?
> >
> > It's just a bit more important now since I host
> my
> > website itself of my pogoplug vs just using it
> for
> > fun like I was a few months before.
>
>
> I've had the same experience - have a power outage
> and then sometimes the Dockstar won't boot.
>
> My solution: once I have a boot software load that
> works, I clone it to a hard disk with Clonezilla.
> See http://clonezilla.org/
>
> Then I can restore that image to two different
> boot drives, say A and B. Then boot the Dockstar
> from A. If there's a power outage and A won't boot
> anymore, boot the Dockstar from B, use Clonezilla
> to reload the bootable image from the hard disk to
> A, and wait for the next power outage.
>
> If your boot software load changes frequently this
> may be too time-consuming, though.

I do the same thing using multiple USB keys. I guess a better questions is how to switch to ext3 or 4 from ext2?

Glen.
Re: Unclean I tell you, unclean...
August 25, 2011 06:31AM
Yes, just switch to ext3 and all these problems will be automatically solved.

To convert to ext3, connect the hard disk to another linux system or the rescue system. Then

Quote

tune2fs -j /dev/sda1

After that edit the fstab file to mount it as ext3. One additional step you need to do is

Quote

fw_setenv usb_rootfstype ext3
Re: Unclean I tell you, unclean...
August 25, 2011 07:59AM
> I do the same thing using multiple USB keys. I
> guess a better questions is how to switch to ext3
> or 4 from ext2?

I can't really help you there. Sorry.
Re: Unclean I tell you, unclean...
August 25, 2011 10:29AM
Switching an ext2 fs to ext3 is fairly straightforward:

1. Make sure the fs is unmounted and fscked
2. As root, add a journal: tune2fs -j /dev/whatever
3. If the fs is automounted from /etc/fstab, change its entry from ext2 to ext3 there

Technically, you can run the "tune2fs -j" command on a mounted fs, and this is necessary if you want to convert the root file system in place. In this case, the journal file will be visible (as .journal) until the fs is next fscked, or in the case of the root file system, fscked externally.

BTW, after rolling the journal, an ext3 fs may be safely mounted as ext2 just by explicitly specifying this in the mount command.

YMMV
bas
Re: Unclean I tell you, unclean...
August 29, 2011 04:10PM
Also edit the fstab not just from ext2 to ext3 and use the defaults but add barrier=1 to the defaults,
e.g. defaults,relatime,barrier=1
slows down metawrites (delete) but makes power failure way safer. it's disabled by default for some strange reason in ext3. ext4 has it enabled.
man page:
barrier=0 / barrier=1
This enables/disables barriers. barrier=0 disables it, bar‐
rier=1 enables it. Write barriers enforce proper on-disk order‐
ing of journal commits, making volatile disk write caches safe
to use, at some performance penalty. The ext3 filesystem does
not enable write barriers by default. Be sure to enable barri‐
ers unless your disks are battery-backed one way or another.
Otherwise you risk filesystem corruption in case of power fail‐
ure.
Re: Unclean I tell you, unclean...
September 26, 2011 02:59AM
Hi,
what does this mean: "type ext3 sec type ext2" if I type blkid ???

Is the fs mounted as ext2 or ext3 ???

Normaly I don't use an entry for the rootfs in fstab. The rootfs is mounted automatically without such an entry. Is this right?

Greetings
Thomas
Re: Unclean I tell you, unclean...
September 26, 2011 12:59PM
What does mount report? Mount will tell you if it was mounted as ext2 or ext3. I've experienced this funniness with (lib)blkid. Some partitions report a secondary type (SEC_TYPE="ext2") in addition to the primary type (TYPE="ext3"), but not all. I've never found a reasonable explanation of why only some report this. I just ignore it as it seems mount ignores it.
Re: Unclean I tell you, unclean...
September 26, 2011 03:22PM
I'm confused!
One stick shows this:

/dev/sda1: LABEL="rootfs" UUID="58360b8f-8a39-4a4b-96c3-562ba5d15c55" SEC_TYPE="ext2" TYPE="ext3"

root@squeezeplug:~# mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
rootfs on / type rootfs (rw)
tmpfs on /tmp type tmpfs (rw)

an the other stick showes this:

/dev/sda1: LABEL="rootfs" UUID="58360b8f-8a39-4a4b-96c3-562ba5d15c55" TYPE="ext3"

root@squeezeplug:~# mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
rootfs on / type rootfs (rw)
tmpfs on /tmp type tmpfs (rw)

In both cases I have no entry to mount /dev/sda1 in the /etc/fstab. The file system is mounted automatically.

???

Greetings,
Thomas
Re: Unclean I tell you, unclean...
September 26, 2011 11:30PM
My guess is that it's mounted as ext3. An ext3 file system can be explicitly mounted as ext2. It just means that logging will not be used. But normally, if you just execute a "mount", it will defer to the primary type specified in the fs.

What does /proc/commandline show ("cat /proc/commandline"). Is rootfstype set to anything?

Does /etc/fstab not have an explicit mount type for the root filesystem? If not, I'd add one. My entry for that fs on my Dockstar is:
# <device> <mnt pt> <type>  <options>                             <dump> <pass>
/dev/root   /        ext3    relatime,errors=remount-ro               0      1
And it's a good idea to specify the fstype. I had problems under ubuntu 9.04 with root fs corruption until I specified the fs type explicitly in fstab.

YMMV. Good luck.
Re: Unclean I tell you, unclean...
October 04, 2011 04:18PM
I'm fairly certain is mounted using the TYPE and not the SEC_TYPE from blkid.

Sorry about that. I could've sworn the "/dev/root" line in the mount output displayed the actual file system type. I forgot about the virtual rootfs type. What does "df -T" report? I believe that will tell you the real type for /dev/root. And ls -l /dev/root should show you what device it's symlinked to. (I'm not in a place now where I can check myself.)
Re: Unclean I tell you, unclean...
November 09, 2011 10:28PM
varkey Wrote:
-------------------------------------------------------
> Yes, just switch to ext3 and all these problems
> will be automatically solved.
>
> To convert to ext3, connect the hard disk to
> another linux system or the rescue system. Then
>
> tune2fs -j /dev/sda1
>
> After that edit the fstab file to mount it as
> ext3. One additional step you need to do is
>
> fw_setenv usb_rootfstype ext3

big thanks at varkey - the uboot env variable passed to kernel was the thing I had missed... I had /dev/sda1 declared as ext3 in my /etc/fstab, but for the life of me I couldn't get it to mount as ext3 (only as ext2).

fw_setenv usb_rootfstype ext3

fixed it ... :)

=====================================================
Re: Unclean I tell you, unclean...
November 10, 2011 06:24PM
davygravy Wrote:

> fw_setenv usb_rootfstype ext3
>
>
> fixed it ... :)


When I try to use this command (fw_setenv), it says command not found. Can you tell me which package have this command? I tried to use "aptitude search fw_setenv", but nothing come out. Thanks.

UPDATE: found out that fw_setenv is in package uboot-envtools. BTW, from this thread, is it true that the ext3 flash drive will not have the same problem ext2 drive have (unclean after power failure)? Thanks.



Edited 1 time(s). Last edit at 11/11/2011 08:22AM by davidnewton.
Re: Unclean I tell you, unclean...
November 11, 2011 10:17PM
I'm thinking that ext2 is better to use on a USB flash drive... I have an SATA drive attached via USB ... so that's why I chose ext3 .... ext3 has journaling enabled... but the way writes are done, it can wear a USB flash drive out more quickly... YMMV

=====================================================
Re: Unclean I tell you, unclean...
November 12, 2011 01:17AM
It's not only the wear issue, but writes are generally slow to flash media, so using journaling can also slow down the 'o' in i/o. On the other hand, the downside of ext2 is that this file system is more fragile.



Edited 1 time(s). Last edit at 11/12/2011 01:19AM by restamp.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: