# How to use "removeable disk" with freebsd?



## fender0107401 (Apr 17, 2009)

Hi all:
I want use "removeable disk" with freebsd for backup, and I don't like ntfs or fat, so I formated the disk following this page:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/disks-adding.html

The result is: :e

```
ls /dev/ | grep -i da
da0
da0s1
da0s1c
da0s1d
da0s1e
da0s1f
da0s1g
```
To prevent hald mount this disk to /media directory(I use gnome), I touch these files in /usr/local/share/hal/fdi/preprobe/20thirdparty/ directory. Thank SirDice  very much :e

```
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
  <device>
    <match key="freebsd.driver" string="ohci">
        <merge key="info.ignore" type="bool">true</merge>
    </match>
  </device>
</deviceinfo>
```


```
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
  <device>
    <match key="freebsd.driver" string="ehci">
        <merge key="info.ignore" type="bool">true</merge>
    </match>
  </device>
</deviceinfo>
```

Finaly, I can mount one of the partitions to /mnt/fender, but I can't touch anything. 

```
$ mount /dev/da0s1e /mnt/fender/
$ cd /mnt/fender/
$ pwd
/mnt/fender
$ touch something
touch: something: Permission denied
```

How to solve it?


----------



## SirDice (Apr 17, 2009)

A newly created filesystem will have root:wheel as owner/group. 

Change the owner/group of the mounted filesystem to the user/group you want to use. Also make sure that user/group has the correct permissions.

chown and chmod are the commands to use.


----------



## fender0107401 (Apr 17, 2009)

I am sorry,I must apologize, because these file can't config hald to prevent mount the disk, but I don't know why it work when I test it last time, and I added another file to that directory, but this file also donsen't work.

```
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
  <device>
    <match key="freebsd.driver" string="uhub">
      <merge key="info.ignore" type="bool">true</merge>
    </match>
  </device>
</deviceinfo>
```
I think I need config the hald properly first.


----------



## fender0107401 (Apr 17, 2009)

*haha*

Seems solved, the following file can config hald to prevent mount the disk, and I changed the disk permession.

:e


```
<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
  <device>
    <match key="freebsd.driver" string="da">
      <merge key="info.ignore" type="bool">true</merge>
    </match>
  </device>
</deviceinfo>
```


----------



## SirDice (Apr 17, 2009)

Do realize that this will prevent HAL from automounting _any_ usb hd or memory stick. 

It might be worthwhile to look up the UUID for your drive with lshal and only prevent probing that one.


----------



## fender0107401 (Apr 17, 2009)

Yes, I know it will prevent every usb device, and that is I want, I prefer to use the freebsd's traditional way to mount the flash disk.


----------

