# Mounting a drive



## xsiick (Apr 20, 2009)

Hello,

I have just upgraded from Linux to FreeBSD and I'm liking it. I've been having a few problems with it, I might as well ask them in one thread.

One Problem:
I've been trying to mount a drive that is built in to my server, it is holding all the files from when I backed up Linux before I overwrote it with FreeBSD. The drive did not mount itself (maybe it wasn't supposed to) and I'm not sure how to get it to mount.
Each time I try mounting the drive it says


```
[root@jakeserver ~]# mount -r /dev/da1s1 /mnt
mount: /dev/da1s1 : Invalid argument
```

Second Problem:
I have a Belkin MIMO G+ WLAN adapter, I am unsure how to set up connect it to the WLAN at my home. I don't know where to begin either.


----------



## xsiick (Apr 20, 2009)

About mounting the drive:

I was trying to mount the wrong drive.
But when I try to mount the correct drive I get this:


```
[root@jakeserver ~]$ mount -r /dev/amr0 /mnt
mount: /dev/amr0 : Block device required
```


----------



## graudeejs (Apr 20, 2009)

what file system did you use?
mount(8)


----------



## xsiick (Apr 20, 2009)

I'm unsure how to determine what filesystem that drive is.


----------



## graudeejs (Apr 20, 2009)

well try
mount -t ext2fs ....
mount -t msdosfs ....
as rooot


btw what kind of drive are you using, i have never seen /dev/amr0...


----------



## xsiick (Apr 20, 2009)

msdosfs worked for the flash drive I was trying to mount, but the amr0 didn't work for either.

amr0 is LSI Logic MegaRAID ?
90% sure that's what it's called.


----------



## graudeejs (Apr 20, 2009)

Is it a raid or a disk (or whatever) name?
If it's a raid, perhaps it's not supported


----------



## speed (Apr 20, 2009)

maybe you need to  build the kernel with "options EXT2FS", then try to use "mount -t ext2fs ....".


----------



## xsiick (Apr 20, 2009)

how do you rebuild the kernel?
also, I'm unsure if it's a raid or disk
it may be unsupported. I need some files from it though, seeing that I backed up linux onto it.


----------



## SirDice (Apr 20, 2009)

speed said:
			
		

> maybe you need to  build the kernel with "options EXT2FS", then try to use "mount -t ext2fs ....".



No need to rebuild the kernel, *kldload ext2fs* should work. It'll be loaded automagically when you use *mount -t ext2fs*.


----------



## SirDice (Apr 20, 2009)

xsiick said:
			
		

> how do you rebuild the kernel?


Strictly speaking not necessary for this but for future reference:

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html

As for the error when mounting amr0, you are trying to mount the entire disk not a slice (aka PC BIOS partition). Try amr0s1 or have a look with *fdisk amr0* to see what slices exist (if any).


----------



## xsiick (Apr 20, 2009)

SirDice said:
			
		

> As for the error when mounting amr0, you are trying to mount the entire disk not a slice (aka PC BIOS partition). Try amr0s1 or have a look with *fdisk amr0* to see what slices exist (if any).



mount: /dev/amr0s1 : No such file or directory

I don't see any slices for amr0 in /dev/
But I do see slices for amrd0
althought after mounting amrd0s1,

In /mnt, I find stuff about the dell partition system, which came with my server's BIOS, I really shouldn't touch it.

So yea, that wasn't what I backed up. The fedora backup must be in amr0, but no slices in it.


----------



## xsiick (Apr 20, 2009)

```
[root@jakeserver ~]# fdisk amr0
fdisk: could not detect sector size
```

disk isn't compatible with freebsd?


----------



## tangram (Apr 20, 2009)

Please post the contents of `% dmesg` and `% uname -a`.


----------



## xsiick (Apr 20, 2009)

http://xsiick.pastebin.com/f2af9ec3c


----------



## gnemmi (Apr 20, 2009)

If your FS is ext2fs, you might have been bitten by this one:

http://forums.freebsd.org/showthread.php?t=912

You'll find a lot of usefull information on that thread.


----------



## tangram (Apr 20, 2009)

Try:

```
# mount -t msdosfs -v /dev/amrd0s1 /mnt
```


----------



## SirDice (Apr 20, 2009)

xsiick said:
			
		

> I don't see any slices for amr0 in /dev/
> But I do see slices for amrd0
> althought after mounting amrd0s1,
> 
> ...


Ok.. The first slice might be the Dell BIOS bit. Your stuff is probably one of the other slices. 

What does the output of *fdisk amrd0* say?


----------



## tangram (Apr 20, 2009)

According to *xsiick*'s dmesg:


```
GEOM_LABEL: Label for provider amrd0s1 is msdosfs/DellUtility.
```

So the wrong mount command is being given.

It should work by running:


```
# mount -t msdosfs -v /dev/amrd0s1 /mnt
```

*xsiick* what exactly do you want to mount? The Dell partition? Or is it an external USB HDD?

If it is the external HDD in your dmesg, run:

```
# mount -t msdosfs -o large /dev/da2s1 /mnt
```

Btw, post your /etc/fstab. Your dmesg is spitting out some errors.


----------



## xsiick (Apr 21, 2009)

Alright, so:

I've figured out (with fdisk amrd0) that all the files that were backed up
from my old linux machine are on amrd0s3,
I need to figure out how to mount that drive.


```
[root@jakeserver ~]# mount -t msdosfs -v /dev/amrd0s3 /mnt
mount_msdosfs: /dev/amrd0s3: : Invalid argument
```

Once I figure out how to mount amrd0s3, I will be able to access
all of my old files.


----------



## xsiick (Apr 21, 2009)

```
[root@jakeserver ~]# mount -t msdosfs -v /dev/amrd0s3 /mnt
mount_msdosfs: /dev/amrd0s3: : Invalid argument
/dev/da0s1a on / (ufs, local, fsid 7601ea499df63b8c)
```


----------



## phoenix (Apr 21, 2009)

Please read what he's posted.    /dev/*amrd0s1* is the Dell system partition.  Stop telling him to mount that various ways, he's already mounted it and determined it's not what he wants.

What's the output of *ls /dev/amrd**?  That will list all the amrd devices, and all the slices on those devices.  Most likely, there will either be an *amrd0s2* or an *amrd1s1*.  Try mounting those.

Doing an *fdisk /dev/amrd0* will show all the slices on that device.  Similarly, doing an *fdisk /dev/amrd1* will show all the slices on that device.  And so on, if there are any other *amrd** devices.

If these are FAT-formatted slices, use *mount -t msdosfs*.

If these are ext2- or ext3-formatted slices, use *mount -t ext2fs*.  Note: if the ext2 filesystem uses 256-byte inodes, you won't be able to mount it.  FreeBSD only natively supports ext2 with 128-byte inodes.

If these are ntfs-formatted slices, use *mount -t ntfs*.  If you need write-access, you'll want to install the ntfs-3g port.

And so on, depending on the filesystem used on the slice.  FreeBSD also supports read-only access to ReiserFS, and XFS.


----------



## ivan (Apr 21, 2009)

i m mount same way and working but when i m restart the system is mount is erasing only have drive letter and inside is empty

how can i do my mount fixed for see auto mounted all starting my system ..

thank you


----------



## tangram (Apr 21, 2009)

You'll need to have entries in /etc/fstab.

Read this: http://www.freebsd.org/doc/en/books/handbook/mount-unmount.html.

And be careful, a mistype of wrong entry in the fstab will drop you down to single user mode (which is a pain).


----------



## xsiick (Apr 22, 2009)

phoenix said:
			
		

> Please read what he's posted.    /dev/*amrd0s1* is the Dell system partition.  Stop telling him to mount that various ways, he's already mounted it and determined it's not what he wants.
> 
> What's the output of *ls /dev/amrd**?  That will list all the amrd devices, and all the slices on those devices.  Most likely, there will either be an *amrd0s2* or an *amrd1s1*.  Try mounting those.
> 
> ...





Thank you Phoenix, this was a very helpful post.
I am still having an issue however. I am unsure what fs the drive is, and I am also unsure how to determine what fs it is.

If it is ntfs, and I need to install the package, then i would
need to connect to the internet which I haven't figured out yet.

I would rather figure out how to connect it to the internet
before doing anything else.

I originally issued two problems in
this thread post, but have only tried dealing with one, if
anyone could help me with the second reason I posted this so I
could install the ntfs package, that would be fantastic!


----------



## xsiick (Apr 22, 2009)

```
[root@jakeserver ~]# fdisk /dev/amrd0s3
******* Working on device /dev/amrd0s3 *******
parameters extracted from in-core disklabel are:
cylinders2840 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders2840 heads=255 sectors/track=63 (16065 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partitions 1 is:
sysid 7 (0x07), (OS/2 HPFS, NTFS, QNX=2 (16-bit) or Advanced UNIX)
    start 63, size 45624537 (22277 Meg), flag 0
        beg: cyl 1023/ head 1/ sector 1;
        end: cyl 1023/ head 254/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
```

that is fdisk /dev/amrd0s3 if anyone needs to know,
amrd0s3 is the drive I've needed to mount.


----------



## phoenix (Apr 22, 2009)

Don't run fdisk on slices, just run it on the disk device: `# fdisk /dev/amrd0`

That will show all the slices (s1, s2, s3, etc).

However, looking at that blurb, it's most likely NTFS.

You can try the native NTFS support, which would allow you to mount it read-only: `# mount -t ntfs -r /dev/amrd0s3 /mnt`

Then you an use `# ls /mnt` to see if it mounted correctly, and has the data that you want.

If you want the mount to stay across reboots, then create a directory to use as the (permanent) mountpoint (/home/whatever, for example) and then add a line to */etc/fstab* similar to 
	
	



```
/dev/amrd0s3   /home/whatever   ntfs   ro   0   0
```
  You can test that the line in fstab works using:
`# mount /home/whatever`
and
`# umount /home/whatever`

See the fstab(5), mount(8) and mount_ntfs(8) man pages for all the gory details.


----------



## phoenix (Apr 22, 2009)

Don't run fdisk on slices, just run it on the disk device.  So `# fdisk /dev/amrd0`  That will show all the slices.

However, looking at that blurb, it's most likely NTFS.

You can try the native NTFS support, which would allow you to mount it read-only: `# mount -t ntfs -r /dev/amrd0s3 /mnt`  The you an use *ls* to see if it mounted correctly, and has the data that you want.

If you want the mount to stay across reboots, then create a directory to use as the mountpoint (/home/whatever, for example) and then add a line to */etc/fstab* similar to 
	
	



```
/dev/amrd0s3   /home/whatever   ntfs   ro   0   0
```
  You can test that the line in fstab works using `# mount /home/whatever` and `# umount /home/whatever`

See the fstab(5), mount() and mount_ntfs() man pages for all the gory details.


----------



## xsiick (Apr 22, 2009)

phoenix said:
			
		

> `# mount -t ntfs -r /dev/amrd0s3 /mnt`  The you an use *ls* to see if it mounted correctly, and has the data that you want.





```
[root@jakeserver ~]$ mount -t ntfs -r /dev/amrd0s3 /mnt
```

WORKED! Thank you so much phoenix! You were a HUGE help!


----------



## SirDice (Apr 22, 2009)

xsiick said:
			
		

> I am still having an issue however. I am unsure what fs the drive is, and I am also unsure how to determine what fs it is.


fdisk(8) should be able to tell you that.



> If it is ntfs, and I need to install the package, then i would need to connect to the internet which I haven't figured out yet.


You only need the ntfs-3g package/port if you want _write_ access to an ntfs filesystem. Read-only ntfs is supported natively.


----------



## ivan (Apr 24, 2009)

*to read write *

fusefs-ntfs port to free bsd
http://www.freshports.org/sysutils/fusefs-ntfs

first have to load the Fuse driver. You can load it manually:



```
%su -
#kldload /usr/local/modules/fuse.ko
```

Or automatically at system bootup: With root privilege, open /etc/rc.conf and add the following line:


```
fusefs_enable="YES"
```

If you don't have a mount point yet for your NTFS partition, create one, ie:


```
#mkdir -p /mnt/ntfsc
```

Then with the driver loaded, you just have to mount your NTFS partition. Assuming your partition is /dev/ad0s1, that would be:


```
#ntfs-3g /dev/ad0s1 /mnt/ntfsc
```

Then open your file browser, go to your mount point, you have read and write access to your files


----------

