Re: Need help with backup shell script

[ Available lists | Index of freebsd-questions | Month of Jan 2008 | Week of 16 Jan 2008 | Raw email | View thread | Wrap long lines | Reply ]
From
Jim Bow <jimbow@darq.net>
Date
16 Jan 2008 16:42:50
Subject
Re: Need help with backup shell script
Message-ID
478E3403.6040609@darq.net


[ Hide this part ]
Andreas Widere Andersen wrote:
> #!/bin/sh
>
> MOUNT=/external
> DATE=`date +%Y%m%d%H%M`
>
> mount /dev/da0 $MOUNT #Change device name
> find $MOUNT -mtime +30 -delete
> mkdir $MOUNT/$DATE
> rsync -rlpgoD /backup/ $MOUNT/$DATE
> umount /external
>
> When I try to run my script I get this prompt back:
>
> mount: /dev/da0 on /external: incorrect super block

This fails because you are trying to mount the raw(?) drive and mount is
unable to detect what file system it is (by looking at the partition's
super block).

> Am I doing something wrong here or do I need to I need to use one of the
> other from /dev:

You want to use /dev/da0s1d - the main partition on slice 1 on the drive.

Sorry, I dont remember the explanation as to why you must use da0s1d
instead of da0s1c, but it goes something along the lines of c partition
being a shorthand notation for the entire slice, whereas letter d marks
the first partition on the slice.

Maybe someone here can clarify this?

Hope this helps.



Jim Bow



Elapsed time: 0.134 seconds