# mounting external usb disk formatted with xfs



## thorn101 (Nov 14, 2011)

Hi,
I just installed FreeBSD 8.2 (moved from ubuntu) to see what it's like. I kinda got used to the BSD way of doing things (disk slices etc) from working in mac os x for a while.

Anyway, I have a couple of external usb disk 1.5 TB each which I used under ubuntu for media storage.
I would really like to be able to access these files from FreeBSD.

I installed sysutils/xfsprogs and found through [cmd=]egrep 'da[0-9]' /var/run/dmesg.boot[/cmd] that the disk is /dev/da0 and through [cmd=]gpart list[/cmd] that it's /dev/da0p1 (pity there is no *fdisk -l*).

Now when I do [cmd=]mount -t xfs /dev/da0p1 ~/mnt/xfsdisk[/cmd] I keep getting a 
	
	



```
operation not permitted
```
 error.

I also tried mounting with the "-o ro" (read only option) but no luck.

When I googled this problem a couple of threads showed up (including one on this forum) but none had a solution. Could someone please help me out here.


----------



## Martillo1 (Nov 15, 2011)

Did you try to mount as root? I also do not understand why you use a '~' before the mountpoint.


----------



## thorn101 (Nov 15, 2011)

Hi Martillo,
When I first started I kept logging in as root (and trying to mount), so to answer your question yes I tried it as root. 
But then I installed sudo (I'm really digging portmaster :e) because I didn't want to keep logging in with root or keep doing [CMD=""]su -[/CMD]. I omitted the sudo command from my post.

As for the "~/", that's my home directory where I created the mnt/xfsdisk mount point.
I understand it is considered good practice to create a seperate /mnt partition of 10 MB to use as mount point, but since I'm testing I did not do that and I'm mounting to my homedir :r.

I think I may have sussed out what the problem is. The default behaviour when creating an xfs partition is for *mkfs.xfs* to create an internal log. The internal log requires write options even though you are mounting read only :\.
Anyway, FreeBSD doesn't support write, so default behaviour of xfs will not work under FreeBSD.

I'll try to remount with the logdev option pointing to an external log and see if that will work and post an update.

P.S. Thanks DutchDaemon for fixing the formatting, I had a serious case of square eyes when I posted.


----------



## thorn101 (Nov 15, 2011)

Just a quick update,
I tried the options for xfs as specified in the documentation for the mount command.
None of the options I needed are supported, for example with the *logdev* option you get error 
	
	



```
mount option <logdev> is unknown
```

The *norecovery* option obviously yields the same error.

I double checked to see if the xfs kernel module is loaded with `kldstat` and I get

```
Id Refs Address            Size     Name
 1    3 0xffffffff80100000 c9fe20   kernel
 2    1 0xffffffff80e22000 5d8bc    xfs.ko
```
When I do 
`file - < /dev/da0p1`
I get 
	
	



```
/dev/stdin: SGI XFS filesystem data (blksz 4096, inosz 256, v2 dirs)
```

Anyway, so supplying a different log to mount as per documentation is not possible.
Using the * -o ro,norecovery* is not possible.

So, although technically xfs is supported it is not possible for me to actually mount an xfs partition under FreeBSD.

:\ I tried
As far as I'm concerned this thread can be closed.


----------



## wblock@ (Nov 15, 2011)

It's worth checking with the port maintainer.  Looking at the port, it seems to me that internal or external logging is created when the filesystem is created.


----------

