#!/bin/bash

MODE=$1

umount -l /dev/sda3
umount -l /dev/sda4

if [ "$MODE" = "" ]; then
  reiserfsck -f -y --fix-fixable /dev/sda3
  reiserfsck -f -y --fix-fixable /dev/sda4
elif [ "$MODE" = "1" ]; then
  reiserfsck -f -y --rebuild-sb /dev/sda3
  reiserfsck -f -y --rebuild-sb /dev/sda4
elif [ "$MODE" = "2" ]; then
  reiserfsck -f -y --rebuild-tree /dev/sda3
  reiserfsck -f -y --rebuild-tree /dev/sda4
fi

#mount /dev/sda3
#mount /dev/sda4

