Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: How to synchronize a networked drive and an external drive (Ubuntu & OS X)?

  1. #11
    Join Date
    Feb 2008
    Beans
    124
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to synchronize a networked drive and an external drive (Ubuntu & OS X)?

    OK, it seems Ubuntu reads HFS+ partitions no problem. The external HDD has two HFS+ partitions. In order to write to the partition I need to disable journaling, which I have done for the partition in question. I've also installed hfsplus which allegedly allows me to write to that partition.

    I believe I need to fix up my /etc/fstab now so that one partition auto-mounts and one doesn't.

    I don't want to lose a bunch of valuable data here so sorry if I'm going a little slow.
    Ubuntu 12.04: E8200 // P35 // 4GB // HD4850
    OS X 10.7.x: iMac 12,2; MacBook 5,2

  2. #12
    Join Date
    Mar 2007
    Beans
    110
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to synchronize a networked drive and an external drive (Ubuntu & OS X)?

    Okay, if you want to use that filesystem, I suggest you first do some thorough testing read and writing files from the server. You want to rsyncs to be reliable.

    I suggest you take the time to do that and come back once you validate.

    Also, let me know if the drive auto mounts in Ubuntu or not. It should appear in /media on the server. Post the result of
    Code:
    ls -l /media
    on the server.

    We'll take it from there.
    Sandy Bridge i5-2500, Asus P8Z68-V Pro

  3. #13
    Join Date
    Feb 2008
    Beans
    124
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to synchronize a networked drive and an external drive (Ubuntu & OS X)?

    The partitions auto mount on the server. I've confounded things a little here in that I'd already done:

    Code:
    $ sudo mkdir /media/extras /media/syncatron
    But in any case, here's the print out of ls -l /media

    Code:
    boehj@sutti:~$ ls -l /media
    total 16
    drwxr-xr-x 2 root  root  4096 2010-12-14 23:36 cdrom
    drwxrwxrwx 5 boehj boehj 4096 2011-02-28 10:49 data
    drwxr-xr-x 2 root  root  4096 2011-04-16 20:21 extras
    drwxrwxr-x 1    99    99    9 2011-04-16 19:54 extras_
    drwxr-xr-x 2 root  root  4096 2011-04-16 20:21 syncatron
    drwxrwxr-t 1 root     80   33 2011-04-15 20:19 syncatron_
    I'm guessing the 'extras_' and 'syncatron_' directories are the auto mount points.

    I also updated my /etc/fstab (haven't saved it yet) but I wonder about the options. Here are the relevant bits:

    Code:
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    nodev,noexec,nosuid 0       0
    UUID=dd096328-2e0d-46d1-a630-760f895ece15 /                     ext4 errors=remount-ro,user_xattr 0       1
    UUID=4d901313-a4f7-45b3-b15a-a70b2a4182e2 /media/data           ext4    defaults                  0       2
    UUID=69a1dd0a-9da2-4ca4-bd21-00cd5d23ee0d none                  swap    sw                        0       0
    
    #WD external
    UUID=1d811ccf-2b05-3c1a-aeec-1974caae0627 /media/syncatron      hfsplus	noauto                    0       2
    UUID=512f1f64-83c0-3c7a-8899-8229bc21c63d /media/extras         hfsplus noauto                    0       2
    I've done noauto because I don't want these (particularly 'syncatron') mounting unless I specifically tell them to. Are there any other options I should be putting here. Options that perhaps pertain to permissions.

    Bah, to be honest, this HFS+ stuff is making me woozy. I'd feel much more comfortable just formatting one partition ('extras') as ext4 and being done with it.

    I'm sorry this has become so unwieldy. I think I've wasted a lot of your time. Once I've reformatted 'extras' as ext4 I'll report back and perhaps, if you still have the patience, you can teach me how to write a rsync script.

    Thanks again for your help.
    Ubuntu 12.04: E8200 // P35 // 4GB // HD4850
    OS X 10.7.x: iMac 12,2; MacBook 5,2

  4. #14
    Join Date
    Mar 2007
    Beans
    110
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to synchronize a networked drive and an external drive (Ubuntu & OS X)?

    Okay, big confusion here.

    You have to decide one of two situation, which are mutually exclusive.

    EITHER you opt for automounting, which means the drive automatically appears in /media when you plug it in. Here, there must be no entry in fstab, and you remove the directories you manually created in /media

    OR you don't need automounting, and you indeed put the entries in fstab and create the directories, but not necessarily in /media. It could better to mount it in /mnt or in /backup. [Just so you know, what you put in /media automatically appears on the Desktop]. In this scenario, you want to plug the drive before you boot the server, and you won't be unmounting the external drive.

    You have to choose. The script will test if the drive is present or not before trying to send any data.

    I think automounting could be good enough.
    Sandy Bridge i5-2500, Asus P8Z68-V Pro

  5. #15
    Join Date
    Feb 2008
    Beans
    124
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to synchronize a networked drive and an external drive (Ubuntu & OS X)?

    I'm aware /media mounted drives appear on the desktop. I like this. I don't want 'syncatron' mounting unless I specifically say so because this is a bootable clone of my OS X system.

    Are you saying I can never unplug the external drive (except when the system is off) if I choose the non-auto mounting route?

    I've nuked the 'extras' partition which was HFS+ and it's now ext4. The relevant bit of my /etc/fstab looks like this:

    Code:
    #WD external
    UUID=1d811ccf-2b05-3c1a-aeec-1974caae0627 /media/syncatron      hfsplus	noauto                    0       2
    UUID=5c98197f-c4fd-4375-9d9f-6becd1cbc76c /media/extras         ext4    defaults                  0       2
    I'm happy with this arrangement.

    Now when I made the /media/extras and /media/syncatron directories I also did the following:

    Code:
    $ sudo chown -R boehj:boehj /media/extras/
    $ sudo chmod -R 755 /media/extras/
    ls -l /media prints this:

    Code:
    boehj@sutti:~$ ls -l /media/
    total 12
    drwxr-xr-x 2 root  root  4096 2010-12-14 23:36 cdrom
    drwxrwxrwx 5 boehj boehj 4096 2011-02-28 10:49 data
    drwxr-xr-x 3 boehj boehj 4096 2011-04-16 21:55 extras
    drwxrwxr-t 1 root     80   33 2011-04-15 20:19 syncatron
    Slightly worried I've borked the permissions on 'syncatron'. I'm going to check that now. How we looking so far? I'm starting to feel that manual back-ups are more my style.
    Ubuntu 12.04: E8200 // P35 // 4GB // HD4850
    OS X 10.7.x: iMac 12,2; MacBook 5,2

  6. #16
    Join Date
    Mar 2007
    Beans
    110
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to synchronize a networked drive and an external drive (Ubuntu & OS X)?

    Okay, doing good so far. Great you opted for leaving the drive automounting, its more OSX style : you see it when it mounts, and you already know how to unmount it before you remove it.

    Now, I need to know where are your files on your server and where you want to send them on the HD.

    Example:
    From server: /home/joe/Documents/*
    To HD: /media/extras/Backup

    Also, now is a good time to determine whether you want to sync everything from the server, or if there are directories or types of files you want to exclude.

    What we'll do next : create the script. Almost there.
    Sandy Bridge i5-2500, Asus P8Z68-V Pro

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •