| View previous topic :: View next topic |
| Author |
Message |
wswartzendruber Veteran


Joined: 23 Mar 2004 Posts: 1196 Location: Jefferson, USA
|
Posted: Sat Jan 28, 2012 1:03 am Post subject: DUMP/PASS Setting to Force fsck and Recovery on Startup |
|
|
| This is the second time my VPS has gone down in flames because of FS corruption. Is there a way to force FS checks and automatic recovery on every boot? |
|
| Back to top |
|
 |
overkll Veteran

Joined: 21 Sep 2004 Posts: 1239 Location: Austin, Texas
|
Posted: Sat Jan 28, 2012 1:40 am Post subject: |
|
|
| what fs are you using? |
|
| Back to top |
|
 |
wswartzendruber Veteran


Joined: 23 Mar 2004 Posts: 1196 Location: Jefferson, USA
|
Posted: Sat Jan 28, 2012 2:24 am Post subject: |
|
|
| ext3 |
|
| Back to top |
|
 |
overkll Veteran

Joined: 21 Sep 2004 Posts: 1239 Location: Austin, Texas
|
Posted: Sat Jan 28, 2012 2:37 am Post subject: |
|
|
you can use tune2fs to set the boot count to 1 or zero. That should trigger fsck on every boot.
Read the man page. I believe that the partition must not be mounted when you make the modification.
If you want to look at all the settings you CAN do that while the partitions are mounted. Just do
| Code: | | # tune2fs -l /dev/sda2 |
or whichever partition you want to check.
Then you only need to set up the correct dump/pass settings in fstab. Here's mine:
| Code: |
# <fs> <mountpoint> <type> <opts> <dump/pass>
/dev/md0 /boot ext2 noauto,noatime 1 2
/dev/sda6 none swap sw 0 0
/dev/sdb6 none swap sw 0 0
/dev/md1 / ext4 noatime 0 1
/dev/md2 /home ext4 noatime 0 3
/dev/md3 /var/backup ext4 noauto,noatime 0 4
none /dev/shm tmpfs nodev,nosuid,noexec 0 0
|
If it were me, I'd be more concerned with WHY the fs is getting corrupted and address that. BAD DISK(S)? If the corruption is severe enough, fsck won't completely recover everything.
EDIT: I believe the parameter is mount-count, not boot-count. |
|
| Back to top |
|
 |
|