Re: [ubuntu-uk] Symlinking to USB hard drives

2010-10-07 Thread Neil Greenwood
On 5 October 2010 19:11, Anton Piatek  wrote:
> On 5 Oct 2010 18:55, "Glen Mehn"  wrote:
>> On 04/10/10 20:25, Neil Greenwood wrote:
>>> Hi all,
>>>
>>> I have a couple of matched USB hard drives that I use as part of my
>>> backup strategy. At the moment they both have the same label, so they
>>> end up mounted at /media/backup. But this means I can't easily tell
>>> which drive is which, and when I plug the second in, it gets mounted
>>> at /media/backup_.
>>>
>>> I'd like to re-label the drives to backup1 and backup2, but then have
>>> a symlink automatically created at /media/backup to whichever drive
>>> was first plugged in. I think I need to use a udev rule, but other
>>> than that I'm not sure.
>>>
>>> Does anyone have any ideas?
>>
>> Hi Neil,
>>
>> You can rename partitions in parted or gparted, which should sort it out
>> for you. Then in your backup script, put something like:
>>
>> if test -d /mounts/backup1
>> do ln -s /mounts/backup1 /mounts/backup
>> elif test -d /mounts/backup2
>> do ln -s /mounts backup2 /mounts/backup
>> else print "neither backup mount point exists, exiting"; exit 1
>>
>> Does that make sense?
>>
>> Best,
>>
>> Glen
>>
> I use devices by id in my fstab to have unique mount points. Have a browse
> through /dev/ when the disk is connected
>
> Anton
>

Sorry, I should have been clearer with my question!

I know how to rename the partitions: I named them both 'backup' in the
first place.

I don't have one specific backup script, I use the drive from
different applications for different backup purposes. I'd like the
first drive I plug in to get a symlink automatically, which I think
udev can do. I'm just not sure exactly how, nor how to check whether
or not the symlink has already been created.


Cofion,
Neil.

-- 
ubuntu-uk@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/


Re: [ubuntu-uk] Symlinking to USB hard drives

2010-10-05 Thread Anton Piatek
I use devices by id in my fstab to have unique mount points. Have a browse
through /dev/ when the disk is connected

Anton

-
Anton Piatek
email: an...@piatek.co.uk
blog/photos: http:// www.strangeparty.com
pgp: [74B1FA37] (http:// www.strangeparty.com/anton.asc)

No trees were destroyed in the sending of this message, however, a
significant number of electrons were terribly inconvenienced.
On 5 Oct 2010 18:55, "Glen Mehn"  wrote:
> On 04/10/10 20:25, Neil Greenwood wrote:
>> Hi all,
>>
>> I have a couple of matched USB hard drives that I use as part of my
>> backup strategy. At the moment they both have the same label, so they
>> end up mounted at /media/backup. But this means I can't easily tell
>> which drive is which, and when I plug the second in, it gets mounted
>> at /media/backup_.
>>
>> I'd like to re-label the drives to backup1 and backup2, but then have
>> a symlink automatically created at /media/backup to whichever drive
>> was first plugged in. I think I need to use a udev rule, but other
>> than that I'm not sure.
>>
>> Does anyone have any ideas?
>
> Hi Neil,
>
> You can rename partitions in parted or gparted, which should sort it out
> for you. Then in your backup script, put something like:
>
> if test -d /mounts/backup1
> do ln -s /mounts/backup1 /mounts/backup
> elif test -d /mounts/backup2
> do ln -s /mounts backup2 /mounts/backup
> else print "neither backup mount point exists, exiting"; exit 1
>
> Does that make sense?
>
> Best,
>
> Glen
>
> --
> Glen Mehn
> glen.m...@oba.co.uk
> skype: glenmehn | blog: http://glen.mehn.net/mba
> UK: +44(0)7942 675 755 | US: +1 415 704 4737
>
>
> --
> ubuntu-uk@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
> https://wiki.ubuntu.com/UKTeam/
-- 
ubuntu-uk@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/


Re: [ubuntu-uk] Symlinking to USB hard drives

2010-10-05 Thread Glen Mehn
  On 04/10/10 20:25, Neil Greenwood wrote:
> Hi all,
>
> I have a couple of matched USB hard drives that I use as part of my
> backup strategy. At the moment they both have the same label, so they
> end up mounted at /media/backup. But this means I can't easily tell
> which drive is which, and when I plug the second in, it gets mounted
> at /media/backup_.
>
> I'd like to re-label the drives to backup1 and backup2, but then have
> a symlink automatically created at /media/backup to whichever drive
> was first plugged in. I think I need to use a udev rule, but other
> than that I'm not sure.
>
> Does anyone have any ideas?

Hi Neil,

You can rename partitions in parted or gparted, which should sort it out 
for you. Then in your backup script, put something like:

if test -d /mounts/backup1
   do ln -s /mounts/backup1 /mounts/backup
elif test -d /mounts/backup2
   do ln -s /mounts backup2 /mounts/backup
else print "neither backup mount point exists, exiting"; exit 1

Does that make sense?

Best,

Glen

-- 
Glen Mehn
glen.m...@oba.co.uk
skype: glenmehn | blog: http://glen.mehn.net/mba
UK: +44(0)7942 675 755 | US: +1 415 704 4737


-- 
ubuntu-uk@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/


[ubuntu-uk] Symlinking to USB hard drives

2010-10-04 Thread Neil Greenwood
Hi all,

I have a couple of matched USB hard drives that I use as part of my
backup strategy. At the moment they both have the same label, so they
end up mounted at /media/backup. But this means I can't easily tell
which drive is which, and when I plug the second in, it gets mounted
at /media/backup_.

I'd like to re-label the drives to backup1 and backup2, but then have
a symlink automatically created at /media/backup to whichever drive
was first plugged in. I think I need to use a udev rule, but other
than that I'm not sure.

Does anyone have any ideas?

Cofion/regards,
Neil.

-- 
ubuntu-uk@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk
https://wiki.ubuntu.com/UKTeam/