search

Backup to USB Drive (External Storage)

If you have a disk drive connected to the GoFlex Home USB port you can backup the GoFlex Home main SATA drive to it. But if you do that from a remote PC using File Explorer it is very slow especially over a wireless network, because the data is travelling from the GoFlex Home to your PC and back again.

Is there a way to transfer files directly from the SATA drive to the attached USB drive?


USB Backup
Yes there is. In fact Axentra who built the firmware even made a utility to do just that.
But apparently Seagate doesn't want their customers have it.

So you have do it for yourself.

I have a Seagate expansion drive connected to my Goflex Home USB port and use a simple crontab task to back up my Public folder to the External Storage using cp commands.
Every 2:30am daily it updates my External Storage/Seagate folder with the contents of my GFH Public folder. The -u switch makes sure that it is only updating any changes not recopying the whole Public folder. I don't even need to turn on my PC for the backup to happen, the GoFlex Home does it all itself.

You can also use the cp command to backup manually.

First connect with SSH and become root with sudo -s

Example cp instruction:

cp -u -r --preserve=all /home/username/"GoFlex Home Public"/* /home/username/"External Storage"/SEAGATE/
(replace username with an actual user name on your GoFlex Home and the actual drive name as it shows in file explorer/finder)

I suggest you try out the cp command line first in SSH with the -v (verbose) switch to make sure you have it right - don't miss the quote marks around "GoFlex Home Public" and "External Storage" and the drive name if it contains spaces. 

Note that different external drives might show up differently, a WD drive might show as "External Storage"/WD/ .  Look in Windows file explorer (or Mac Finder) to see how the drive appears under \\GOFLEX_HOME\External Storage\ and that's the name you should use in the cp command.
For example;

cp -u -r --preserve=all /home/username/"GoFlex Home Public"/* /home/username/"External Storage/Seagate Backup Plus Drive"

And for locales other than English "External Storage" is probably going to be different.

examples from other locales

          DK = Eksternt lager
          ES = Almacenamiento externo
          FR = Stockage externe
          IT = Archiviazione esterna
          NL = Externe Opslag

To schedule the backup 
When cp works for you edit /etc/crontab and add your custom crontab line at the end of the existing crontab. You should probably set your task to run at a different time to the other jobs already in the list (4:02, 4:22 and 4:42am)

Edit with vi, the inbuilt text editor : vi /etc/crontab

vi opens command mode so use the arrow keys to position the cursor at the end of the text file and then press  i  to start insert mode then add a line (for example)
30 02 * * * username cp -u -r --preserve=all /home/username/"GoFlex Home Public"/* /home/username/"External Storage"/SEAGATE/

Esc > Shift ZZ (note capitals) to save.

The crontab task survives rebooting the GFH.


Additional note: I've had no trouble with cp, but other users reported that when cp tried to copy a corrupted file it filled up the whole drive so they suggest using rsync instead.

Seagate forum user fMoose created a shell script to do this backup function for all users on the system. I haven't used his script and stuck with my simple cp crontab, but it is available for download on an as-is where-is basis gfh-backup-to-usb.sh

If you create a scripts sub-folder in the Public folder then you can create a crontab to run fMoose's script
1 0 * * * root /bin/bash /home/0common/scripts/gfh-backup-to-usb.sh


12 comments:

  1. Does this still work??? I'm trying to backup my GoFlex Home NAS to another external drive (WD) plugged directly into the NAS. I have no problem seeing the WD drive as an external drive. I've tried this command in VI on the NAS several times and it never copies files. Please help !!

    ReplyDelete
    Replies
    1. Did you note the part about "Note that a different external drive might show up differently, a WD drive will show as "External Storage"/WD/" when you entered the commmand?
      Have a look in Windows file explorer to see how the external drive shows up and use the name you see there.

      And you are replacing the username with an actual username on your GFH?


      Try it just as a command line cp -u -r --preserve=all /home/username/"GoFlex Home Public"/* /home/username/"External Storage"/WD/ to check that the command works before editing the crontab file with VI.

      Delete
  2. Hello, Thanks for the quick response and posting this type of information. I've been looking for a way to backup this NAS since it now contains all of our files.

    I did verify that the external storage shows up as WD in the Seagate dashboard. I can also get into the extended storage with no problem. Everywhere that it says username, I'm replacing it with a true username on the GFH (in fact it's the one I use to sign into to get to vi). I did notice that when I open the external storage drive from Windows file explorer it first goes to a folder called MyBook, do I need to add that to the equation?

    I did not think about trying it from the command line, but will try also. Thanks again for all of your help !!! Ron

    ReplyDelete
    Replies
    1. Yep, if it shows as ExternalStorage\MyBook in Windows file explorer then that's what you should put in the command line.
      Run the cp command manually first to make sure that it is working before setting it up on a schedule.
      cp -u -r --preserve=all /home/username/"GoFlex Home Public"/* /home/username/"External Storage"/MyBook/

      Delete
  3. THANKS !!!!!!

    I was able to run it from the command prompt and it worked using "My Book". I will try to get the cronjob running tomorrow. I appreciate your quick response and help getting this working. Thanks again !!!!! Ron

    ReplyDelete
  4. Thanks again for all of your help, I do successfully have this command working and backing up my GoGlex NAS. I have a question though regarding space. Is there a more efficient way I should be doing this???? My GoGlex NAS has about 500G of data to be backed up. When I run the cp command above it does successfully back it up, but it uses over 3TB on the drive to backup 500G of data. Any suggestions??? Thanks !! Ron

    ReplyDelete
    Replies
    1. There is something wrong if 500GB of data is taking up 3TB of space. The copy (cp) command is just like copying files from your Windows PC. The destination files should match the source files.
      Take a look at the files in your MyBook drive and see if you can work out where the additional capacity is being used up.

      Delete
  5. Hi there, I just chanced upon this thread and need some advice:

    I've tried connecting the external drive via USB to the GFH and copy folders using the web utility, but it took a long time to copy a few folders. If I copy larger amount of data and wait over night, the process would drop/ fail when I check back the following morning. I know it failed because the destination folder is significantly smaller than the source drive.

    at the moment, I've connected the external drive via usb to my mac and copying via network to the GFH. It hasn't dropped for the last 2 days but I have 2 TB of data and it takes too long. So would appreciate if someone could show me a better way! :)

    Here's a couple of question on the original post:

    "Yes there is. In fact Axentra who built the firmware even made a utility to do just that.
    But apparently Seagate doesn't want their customers have it."

    Are you saying this utility can't be found / can't be used?

    "I have a Seagate expansion drive connected to my Goflex Home USB port and use a simple crontab task to back up my Public folder to the External Storage using cp commands.
    Every 2:30am daily it updates my External Storage/Seagate folder with the contents of my GFH Public folder. The -u switch makes sure that it is only updating any changes not recopying the whole Public folder. I don't even need to turn on my PC for the backup to happen, the GoFlex Home does it all itself."

    Can this be done from a mac? Did you do it with the utility or with the command line? Does those command line apply to the mac?

    Thanks!

    ReplyDelete
    Replies
    1. Hi, copying from the GoFlex Home main drive to an external drive connected to the GoFlex Home USB port is very slow as explained in my post.

      I'm saying that the Axentra utility can't be found
      I'm guessing it was available with other products that used the same Axentra Hipserv firmware, like the Netgear Stora but I've never gone looking for it because the Linux commands work fine.

      Yes it can be done from a Mac. The Mac or PC is only used to send commands to the GoFlex Home.
      As I explained elsewhere in the blog, the GoFlex Home is actually a mini computer with it's own operating system on Nand storage, RAM and I/O ports but since it is missing a screen and keyboard you need enter commands from another computer. With a Mac it's in fact easier as you don't need to install any additional software on your Mac you can use the Terminal program built into Mac OS.

      Delete
  6. Thanks very much for this tutorial; I've just followed the instructions to cp manually, and it works a treat. I think GFH creates a folder, within the "External Storage" folder, named according to the drive found, in my case "Seagate Backup Plus Drive". This can be found in Windows File Explorer, giving the name required on the copy destination.

    ReplyDelete
    Replies
    1. Thanks for the feedback.
      I think Seagate used to set USB device string descriptors on all their drives just to SEAGATE. I tried a couple of different Seagate drives and that's how they showed under External Storage and I don't have any newer drives to test so I appreciate your tip.
      I'll update my blog. Cheers

      Delete
  7. Wow, this tutorial is very helpful. I was looking for a replacement to Crashplan (free home version) since it's been abandoned. I was using Crashplan to automate backups from my GFH to a usb drive connected to my mac mini. I am now connecting my usb HDD to the GFH directly. cp command is working right now (I can hear both hard drives working and looking copied data appearing on the usb drive). I will try automating the backup with vi after is has finished backup up. Thanks a lot!

    ReplyDelete