external storage mount point

external storage mount point

Post by Haines Brow » Sat, 18 May 2002 18:27:48



I have a USB external mass storage drive on which I intend to mirror two
drives as a backup by using a command such as dd.

To do this, I need to see the external device as a whole, and so need a
common mount point. I've divided the external drive into partitions
corresponding to those on my primary drives (sdc1, sdc2...), but where do
I mount them.

For example, can I create a /mnt directory in the external drive's /sdc5
partition and then mount each of its directories (sdc1, sdc2...) to it
(including sdc5) and then direct the backup to the external /mnt
directory?

Haines Brown

 
 
 

external storage mount point

Post by Kirth Gerse » Sat, 18 May 2002 23:50:24


Suppose you mount that USB device as follows:
/mirror/sdc1
/mirror/sdc2
I assume that these are Linux type filesystems (ext2, ext3, jfs, .....)

In essence:

/sbin/mount -n -o remount,ro /dev/sdc1          # remount readonly
rm -fr /mirror/scd1/*                                           # remove previous stuff
tar -l -cpf - /mount_point_of_dev_scd1 | tar -C /mirror/scd1 -pxf -

And after a while you've got a nice copy of that FS.
The rm -fr ... may be substituted by something like this:

#fuser -m /mirror/sdc1
umount /dev/<usb_storage_1>
mke2fs -v -c -m 1 -N 500000 -b 4096 /dev/<usb_storage_1>

otherwise you'll loose the Lost+Found directory.

This is the bare essence, you'll probably need to script this with many
checks to make sure nothing is going wrong and all necessary prec-conditions
are met.

This way I usually clone my rootfs (/), but without mount it read-only,
of course.

Do not use dd, major catastrophes might occur.

Hope this helps a bit

Kirth


> I have a USB external mass storage drive on which I intend to mirror two
> drives as a backup by using a command such as dd.

> To do this, I need to see the external device as a whole, and so need a
> common mount point. I've divided the external drive into partitions
> corresponding to those on my primary drives (sdc1, sdc2...), but where do
> I mount them.

> For example, can I create a /mnt directory in the external drive's /sdc5
> partition and then mount each of its directories (sdc1, sdc2...) to it
> (including sdc5) and then direct the backup to the external /mnt
> directory?

> Haines Brown


 
 
 

external storage mount point

Post by Haines Brow » Sun, 19 May 2002 02:44:52


Kirth,

Thanks for the suggestions, but I'm still unclear about the starting
point.

Quote:> Suppose you mount that USB device as follows:
> /mirror/sdc1
> /mirror/sdc2

Where does this "/mirror" directory go? I seems you are saying that I
should create a /mirror mount point in my sdc5 partition (where the root
directory would be located), but how then can I mount a file system on
itself?

Quote:

> /sbin/mount -n -o remount,ro /dev/sdc1             # remount readonly
> rm -fr /mirror/scd1/*              # remove previous stuff tar -l -cpf -
> /mount_point_of_dev_scd1 | tar -C /mirror/scd1 -pxf -

> And after a while you've got a nice copy of that FS.

If I understand correctly, it is a matter here of creating a script for
each partition I'm trying to mirror.

Quote:> This way I usually clone my rootfs (/), but without mount it read-only,
> of course.

Sorry, you loose me.Where is "mount_point_of_dev_sdc1" located? What do
you mean by "cloning?" Sorry to be dense about this.

Haines