# Network Drive and Backup Solution [SOLVED]

## fusion1275

Hi all,

Here is my situation...

My wife has an external 400GB Hardisk which I would like to use 50GB of to make a backup of my system and transfer it onto the drive. It will only exceed around 50GB but my issue is how the hell do I go about doing it?

1) Its an external drive most prob vfat. She has shared it from a windows perspective but I do not know how to connect to it from Gentoo.

2) I have samba installed on my Gentoo box, can this be a part of it? Does she need to install any samba programs to export her drive to me?

3) What is the best way of creating a full system backup file, compressing it and then sending it over to her H/D?

I hope someone can help

Many thanks in advance.

----------

## di1bert

Good evening

Probably the easiest way to do this without getting overly fancy and scary would be 

to mount the share she has created for you. You can check this by doing:

```

smbclient -L <her ip address>

```

To actually mount the share do something along the lines of this:

```

mount -t smbfs //heripaddress/sharename /local/mountpoint

```

There may be another couple of options you might need but that's a good start.

Once mounted I would simply create a tarball of your entire system and dump it 

into the mounted share. It's not the greatest way, but it's worked for me.

I assume you're happy with the syntax of tar to get this done ?

Another option would be rsync, although I'm still working on this one myself.

Hope this is enough to get you started.

-m

----------

## fusion1275

That is a real help, thank you

1 small question and possibly a real dumb one....

She has the network drive named "PLAY (K)" as seen below. What is the syntax for this in the smbclient line??

Sharename       Type      Comment

        ---------       ----      -------

        IPC$            IPC       Remote IPC

        SharedDocs      Disk

        PLAY (K)        Disk

I tried... 

 *Quote:*   

> 
> 
> mount -t smbfs //192.168.0.3/PLAY\(K) /mnt/Backup/
> 
> bash: syntax error near unexpected token `)'
> ...

 

----------

## nobspangle

Your nearly there just need some more \

```
mount -t smbfs //192.168.0.3/PLAY\ \(K\) /mnt/Backup/
```

----------

## deefster

Just FYI, you may run into a 2Gb filesize limitation depending on the windows filesystem.  If this is the case, consider a program like afio instead of tar (to split up the backup into a bunch of small files, but still get compression).

----------

## fusion1275

Thank you very much for all your help so far. I am slowly getting there to what I need.

1 other thing is whenever I do a "smbclient" or the "mount" commands it asks me for the root password. I am actually root when I do this but it still asks. Any ideas to make this automatically recognise the password for samba and just do what I need.

Cheers

----------

## deefster

do a man on smbmount.  

You want to do: credentials=/path/to/credentials/file with the username and password for the username/password on the windows machine.

I like to put mine in /etc/samba.

If you setup fstab properly with the credentials option, you can simply do

```
mount /mnt/your_backup_mountpoint
```

...and it will just work.

----------

## fusion1275

Thank you so much, I have now got the password issue sorted and also have written the script which will be put into a cron. The olny other thing now is what and which directories are the most important to add to my network backup?

This is my output of "df -ah":

 *Quote:*   

> 
> 
> Filesystem            Size  Used Avail Use% Mounted on
> 
> /dev/hdb3             962M  242M  672M  27% /
> ...

 

Any help on this would be superb.

----------

## Napalm Llama

I use rsync for my backup, but I have a local Firewire drive, with ext3fs,  that I can simply mount.

The trouble with rsyncing to your wife's vfat drive is that you'll lose all your file permissions and ownership data.  You could create a 50Gb empty file, format it ext3fs and then loop mount it (eg. mount -o loop /mnt/samba/bigfile /mnt/backup/ ) when you've mounted the underlying Samba share.

...but then there's this 2Gb limit to worry about.  If you run into that with this method, you might have to make lots of 2Gb files and then use Linux' software RAID to stick them back together again, in a block device which would probably end up at /dev/md1.

So you'd have a setup like this:

```

External HD                 /mnt/samba/                            /dev/md1

on wife's PC               (or whatever)             (format with ext3 and sync to this)

___________                 ___________                         ______________

| lots of |                 | lots of |                         |   single,  |

|   2GB   | <--- SAMBA ---> |   2GB   | <--- Software RAID ---> | 50Gb block |

|  files  |                 |  files  |                         |   device   |

```

...I think you might be better off with the tarball  :Razz: 

----------

## merlijn

 *fusion1275 wrote:*   

> Thank you so much, I have now got the password issue sorted and also have written the script which will be put into a cron. The olny other thing now is what and which directories are the most important to add to my network backup?
> 
> This is my output of "df -ah":
> 
>  *Quote:*   
> ...

 

Generally it would be a good idea to backup these directories:

/etc/ for all your custom config files.

/home/ for all home directories.

/root/ if you have anything important in there.

/usr/src/linux/.config current kernel config, always handy   :Very Happy: 

In most cases this should be enough to rebuild your entire system in case of hard drive failure. If you want to keep backups of your storage disks hda and hdd is entirely up to you.

cheers

----------

