Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
DUMP/PASS Setting to Force fsck and Recovery on Startup
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
wswartzendruber
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1196
Location: Jefferson, USA

PostPosted: Sat Jan 28, 2012 1:03 am    Post subject: DUMP/PASS Setting to Force fsck and Recovery on Startup Reply with quote

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
View user's profile Send private message
overkll
Veteran
Veteran


Joined: 21 Sep 2004
Posts: 1239
Location: Austin, Texas

PostPosted: Sat Jan 28, 2012 1:40 am    Post subject: Reply with quote

what fs are you using?
Back to top
View user's profile Send private message
wswartzendruber
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1196
Location: Jefferson, USA

PostPosted: Sat Jan 28, 2012 2:24 am    Post subject: Reply with quote

ext3
Back to top
View user's profile Send private message
overkll
Veteran
Veteran


Joined: 21 Sep 2004
Posts: 1239
Location: Austin, Texas

PostPosted: Sat Jan 28, 2012 2:37 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum