[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mount external usb drive at boot (PROBLEM SOLVED)



I finally got the drive to mount at startup. I couldn't get /etc/fstab to mount the hd, but I was able to get the /etc/init.d/backuppc script to handle mounting and umounting at boot. Thanks everyone for your suggestions. I've included my notes below in case it can help someone else.

Thanks,

Hannuman



Debian Sarge
Seagate External HD 400GB (firewire/usb)

I decided to use the firewire cable instead of usb.

Used udev to create dynamic dev link. Added the following line to /etc/udev/rules.d/udev.rules :

# Firewire devices (IEEE 1394)
BUS="ieee1394",SYSFS{vendor_name_kv}="Seagate ", KERNEL="sd?1", NAME="%k", SYMLINK="ext-hd_sg400"

I read a good intro on udev at http://www.reactivated.net/udevrules.php

Next I mounted the HD:

# mount -t ext3 /dev/ext-hd_sg400 /var/lib/backuppc;


Then I installed the "backuppc" debian package which installed the data (backup) directories in /var/lib/backuppc.

I was not able to get /etc/fstab to mount the drive when I rebooted the pc, so I added mount and umount lines to the /etc/init.d/backuppc file:


#! /bin/sh
# /etc/init.d/backuppc
#
# BackupPC Debian init script
#

set -e

# Do not change the values below ! Read /usr/share/doc/backuppc/README.Debian !
BINDIR=/usr/share/backuppc/bin
DATADIR=/var/lib/backuppc
USER=backuppc
#
NAME=backuppc
DAEMON=BackupPC

test -x $BINDIR/$DAEMON || exit 0

case "$1" in
   start)
       mount -t ext3 /dev/ext-hd_sg400 /var/lib/backuppc;

       echo -n "Starting $NAME: "
       start-stop-daemon --start --pidfile $DATADIR/log/BackupPC.pid \
           -c $USER --exec $BINDIR/$DAEMON -- -d
       echo "ok."
       ;;
   stop)
       umount /var/lib/backuppc;

       echo -n "Stopping $NAME: "
start-stop-daemon --stop --pidfile $DATADIR/log/BackupPC.pid -u $USER \
           --oknodo --retry 30
       echo "ok."
       ;;
   restart)
       mount -t ext3 /dev/ext-hd_sg400 /var/lib/backuppc;

       echo -n "Restarting $NAME: "

start-stop-daemon --stop --pidfile $DATADIR/log/BackupPC.pid -u $USER \
           --oknodo --retry 30
       start-stop-daemon --start --pidfile $DATADIR/log/BackupPC.pid \
           -c $USER --exec $BINDIR/$DAEMON -- -d
       echo "ok."
       ;;
   reload|force-reload)
       echo "Reloading $NAME configuration files"
       start-stop-daemon --stop --pidfile $DATADIR/log/BackupPC.pid \
           --signal 1
       ;;
   *)
       echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload}"
       exit 1
       ;;
esac

exit 0




Reply to: