# [SOLVED] help with automounting external drive (freeagent)

## manji_

I have purchased a seagate external drive, freeagent pro. What i want it to do, is to be automounted, each time i connect it to my pc. From what i read, i guess that this should be done with udev rules. I found that adding this:

```
ACTION=="add", SUBSYSTEM=="scsi_device", ATTRS{vendor}=="Seagate*", ATTRS{model}=="FreeAgent*

, \ RUN+="/bin/sh -c '/sys/block/sdb/device/allow_restart'"
```

in "/etc/udev/rules.d/99-freeagent.rules" could be useful. I don't know what it does, nor what i should do. My drive is mounted automatically, but without read/write permissions.

Can anyone help?Last edited by manji_ on Thu Jan 31, 2008 11:32 pm; edited 1 time in total

----------

## mjf55

I would have added a line into your /etc/fstab file to automate mounting and tell the system where to mount it.  just follow the Gentoo documentation here :http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=8

Assuming you have a USB connection ( this drive does), NTFS file system ( again, this drive is pre-formatted as NTFS) add the following line into /etc/fstab:

```
 /dev/sdb1          /mnt/freeagent        ntfs            auto         0 0
```

This assumes 'lsusb' shows the drive as sdb1 and the mounting directory is /mnt/freeagent.  This directory must already exist.

Also, do some 'googling' about this drive.  Important information out there on this.  Try searching 'linux mount seagate freeagent pro'

----------

## manji_

I have already tried what you said, but in this way, i have a problem when i input for example a usb stick before i open the external drive. Because the usb stick gets mounted as sdb1 to the location i have entered in fstab, and then the external drive will be name sdb2.

I have searched in the forum and at google for a solution, but I didn't find something useful(otherwise i wouldn't post).

Thnx anyway.

----------

## Clad in Sky

Well, not that elegant, but try to add:

```

/dev/sdb2  /mnt/usbstick ntfs(or whatever filesystem fits your need) noauto, user 00 

```

as well. Depending on the order of your plugging you'll then have your USBstick or your external hdd as either usbstick or [whatever the other name was... freedrive?]

I should use noauto, user to the other entry as well, otherwise the system will check for your disk even if it is not connected everytime you boot.

----------

## manji_

I don't think that this is what i want. Imagine that i have two usb sticks, usb1 and usb2. Let's say i want usb1 to be mounted at a specific location. If I enter a line as you said in fstab, let's say :

```
/dev/sdb1  /mnt/usb1 ntfs(or whatever filesystem fits your need) noauto, user 00 

/dev/sdb2  /mnt/usb2 ntfs(or whatever filesystem fits your need) noauto, user 00 
```

(ok, two lines) it will work well only if I input first the usb1 and then the usb2. If i do it the other way, usb2 will be mounted to this specific location(/mnt/usb1), because /dev/sdb1 goes to the usb stick that will be be connected first, and usb1 will be named then as /dev/sdb2(right?). 

I am looking for a way to automount the external drive, but without thinking about the order i connect the drives/sticks.

I appreciate your help so far

----------

## Clad in Sky

As I said, it's not elegant...

----------

## Matteo Azzali

I just saw this.... the correct way to handle the external hard disk should be....

both your methods.

in udev:

```

ACTION=="add", SUBSYSTEM=="scsi_device", ATTRS{vendor}=="Seagate*", ATTRS{model}=="FreeAgent* , \

SYMLINK+="/dev/freeagenthd%n"

```

this wil just create a symlink when you attach the hard disk (nothing is done if it's an usb pendrive)

then in fstab:

```

/dev/freeagenthd1          /mnt/freeagent        ntfs            auto         0 0

```

...enjoy

----------

## manji_

Thnx alot for you response. I had forgotten about this thread, because I don't have this drive anymore(I now use an ide drive, with an ethernet enclosure   :Smile:   ).  Considering that Matteo's suggestion is helpful, I will mark the thread as solved, and hope it will help others with this issue, as this drive seems to be very popular, and some of my friends had the same probem.

----------

