On Wed, Apr 21, 2010 at 07:04, Robert Citek <[email protected]> wrote:
> On Wed, Apr 21, 2010 at 9:24 AM, Michael Rasmussen <[email protected]> wrote:
>> Do whatever to corrupt your disk so you need to run fsck in single user mode 
>> at boot.
>
> Here is what I did and was unsuccessful at creating a problem.  On my
> system, /dev/sda1 contains the root '/' filesystem, so I tried this:
>
> 1) booted with a LiveCD
> 2) typed this in a terminal:
>
> $ sudo dd if=/dev/zero count=200 bs=1 \
> of=/dev/sda1 seek=50000 conv=notrunc

yikes, that's dangerous!  you just overwrote 200 bytes in a random
place on your disk.  some file is corrupted somewhere--hope it's not
your magnum opus or a config file you changed.  if you notice a random
program crashing, you've won.

in all likelihood it will never bite you since i think most people
don't use most files on their system (tens of thousands of files on a
typical modern system are documentation or bits of development
environment that will never be touched by someone who isn't
reading/trying new things a lot), but it also was unlikely (or maybe
impossible?  i'm guessing that mount time checks are limited to
looking to see if you requested an fsck or if something marked the
filesystem dirty, not actually walking inode tables.  someone correct
me if you know otherwise, please!)

the best way to force an fsck is to make a temporary filesystem, add
it to fstab, and intentionally screw *it* up--then you won't lose
stuff that you might someday need.  it can be a tiny filesystem and
your dd methodology is sound, just start 512 bytes in and write for
awhile to make sure you hit the inode table.
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to