Can't mount usb stick on FreeBSD

Stuff that plugs in via USB, FireWire, eSATA, PS/2, etc.

Can't mount usb stick on FreeBSD

Postby zuttel » 15 Aug 2010, 18:30

Hi,

I'm trying to mount a usb-hd on FreeBSD 8.0, but it doesn't work.

Code: Select all
uname -a
FreeBSD Tecra 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:48:17 UTC 2009     [email]root@almeida.cse.buffalo.edu[/email]:/usr/obj/usr/src/sys/GENERIC  i386
Tecra#


dmesg

Code: Select all
ugen3.2: <vendor 0x04b4> at usbus3
umass0: <vendor 0x04b4 product 0x6830, class 0/0, rev 2.00/0.01, addr 2> on usbus3
umass0:  SCSI over Bulk-Only; quirks = 0x4100
umass0:0:0:-1: Attached to scbus0
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <WDC WD12 00BEVE-00WZT0 0000> Fixed Direct Access SCSI-0 device
da0: 40.000MB/s transfers
da0: 114473MB (234441648 512 byte sectors: 255H 63S/T 14593C)
Tecra#

Code: Select all
Tecra# cd /dev/
Tecra# ls
acd0            audit           da0s3           kbdmux0         pts             ttyv4           ugen0.1
acd0t01         bpf             dcons           klog            random          ttyv5           ugen0.2
acpi            bpf0            devctl          kmem            stderr          ttyv6           ugen1.1
ad0             bpsm0           devstat         log             stdin           ttyv7           ugen2.1
ad0s1           console         dgdb            mdctl           stdout          ttyv8           ugen3.1
ad0s1a          consolectl      dri             mem             sysmouse        ttyv9           ugen3.2
ad0s1b          ctty            fd              nfslock         ttyu0           ttyva           ums0
ad0s1d          cuau0           fido            null            ttyu0.init      ttyvb           urandom
ad0s1e          cuau0.init      geom.ctl        pass0           ttyu0.lock      ttyvc           usb
ad0s1f          cuau0.lock      io              pccard0.cis     ttyv0           ttyvd           usbctl
agpgart         da0             iso9660         pci             ttyv1           ttyve           xpt0
ata             da0s1           kbd0            psm0            ttyv2           ttyvf           zero
atkbd0          da0s2           kbd1            ptmx            ttyv3           ufsid
Tecra#


If I put the usb-hd on my win-xp device I can see 5 partitions on it. So I think it should ad0s1a-f.

If try to mount it, I get the message below:

Code: Select all
Tecra# mount -t msdosfs /dev/da0s1 /media/
Tecra# cd /media/
Tecra# ls
Recycled                        System Volume Information


There is no data in it.

Code: Select all
Tecra# mount -t msdosfs /dev/ad0s1a /media/
mount_msdosfs: /dev/ad0s1a: Operation not permitted
Tecra#


Another try:

Code: Select all
Tecra# mount -t msdosfs -o -m=644,-M=755 /dev/da0s1 /media/
mount_msdosfs: /dev/da0s1: Operation not permitted
Tecra#


I have found some threats in the forum, but that didn´t help.

Any hints ?

Regards,

zuttel
zuttel
Junior Member
 
Posts: 9
Joined: 07 Apr 2010, 07:55

Postby jb_fvwm2 » 15 Aug 2010, 18:46

Unsure if you unmounted it (your first "ls")
before mounting again the other way? and
is it fat32, or ntfs, or... each
partition?
jb_fvwm2
Senior Member
 
Posts: 1503
Joined: 16 Nov 2008, 19:19

Postby wblock@ » 15 Aug 2010, 18:50

DD will be along shortly to nicely ask you to use appropriate formatting, so I'll skip it. That does make it easier for people to respond to your questions, though.

zuttel wrote:
Code: Select all
ugen3.2: <vendor 0x04b4> at usbus3
umass0: <vendor 0x04b4 product 0x6830, class 0/0, rev 2.00/0.01, addr 2> on usbus3
umass0:  SCSI over Bulk-Only; quirks = 0x4100
umass0:0:0:-1: Attached to scbus0
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <WDC WD12 00BEVE-00WZT0 0000> Fixed Direct Access SCSI-0 device
da0: 40.000MB/s transfers
da0: 114473MB (234441648 512 byte sectors: 255H 63S/T 14593C)


That's fine, it's da0.

Code: Select all
Tecra# cd /dev/
Tecra# ls


Don't do that, it produces way more output than you need.
[cmd="#"]ls /dev/da0*[/cmd]

Your output shows da0, da0s1, da0s2, and da0s3. These correspond to three MS-DOS partitions.

If try to mount it, I get the message below:
Code: Select all
Tecra# mount -t msdosfs /dev/da0s1 /media/
Tecra# cd /media/
Tecra# ls
Recycled                        System Volume Information

There is no data in it.


Well, no data other than the default Windows stuff. So it's already been formatted by Windows, and works.

Code: Select all
Tecra# mount -t msdosfs /dev/ad0s1a /media/
mount_msdosfs: /dev/ad0s1a: Operation not permitted
Tecra#


ad0 is probably your FreeBSD drive. da0 is the USB drive.

Another try:
Code: Select all
Tecra# mount -t msdosfs -o -m=644,-M=755 /dev/da0s1 /media/
mount_msdosfs: /dev/da0s1: Operation not permitted
Tecra#


Were you logged in as root at the time?
User avatar
wblock@
Old Fart
 
Posts: 10187
Joined: 07 Sep 2009, 23:23
Location: Milky Way galaxy

Postby gcooper@ » 16 Aug 2010, 04:37

I'm guessing based purely on your shell prompt (which could be entirely wrong, but..), you were operating as root. One thing that I'm curious about (with jb_fvwm2) as well that you haven't identified is whether or not you're trying (by accident) to mount an NTFS based partition.

truss output of the mount command where it fails would be most helpful in trying to diagnose this.

FWIW, I have also see it return "Operation not permitted" (EPERM) when the filesystem is incorrect, despite what the mount(2) manpage says:

Code: Select all
     [EPERM]            The caller is neither the super-user nor the owner of
                        dir.
User avatar
gcooper@
Junior Member
 
Posts: 72
Joined: 01 Jan 2009, 02:08

Postby jem » 16 Aug 2010, 08:18

Paste the output from:
[CMD="#"]gpart show da0[/CMD]
It should show exactly what partitions there are and their types.


If you can see 5 partitions in Windows, then you'll possibly have a mix of Primary and Logical MBR partitions. These will show as slices in FreeBSD, so da0s[1-5] perhaps. You won't see da0s1[a-f] as this refers to BSD partitions.

Alternatively, if your USB stick has been converted to a Dynamic Disk in Windows (if Windows allows that), then one big partition spanning the entire disk may show up, which has been subdivided into Logical Disk Manager volumes by Windows (see this for details). BSD probably won't have visibility of these and won't be able to mount them due to the proprietary nature of LDM.

By the way, I didn't think Windows handled partitioned USB sticks properly. It was my understanding that only the first partition would show up. For best compatibility with many OS's, USB sticks are probably best set up with a single MBR partition formatted as FAT32.
jem
Member
 
Posts: 342
Joined: 23 Oct 2009, 11:24

Postby SirDice » 16 Aug 2010, 10:05

zuttel wrote:If try to mount it, I get the message below:

Code: Select all
Tecra# mount -t msdosfs /dev/da0s1 /media/
Tecra# cd /media/
Tecra# ls
Recycled                        System Volume Information


There is no data in it.

Yes, there is. It mounted fine and it's showing the directories [file]Recycled[/file] and [file]System Volume Information[/file] with are both quintessential Windows folders.
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16170
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby zuttel » 16 Aug 2010, 19:13

Yes, the hd is formatted via NTFS. I mixed it up. But 1x partition is formatted with FAT32.

Code: Select all
Tecra# gpart show da0
=>       63  234441585  da0  MBR  (112G)
         63    2040192    1  !6  (996M)
    2040255    2040255    2  !6  (996M)
    4080510  230356035    3  !15  (110G)
  234436545       5103       - free -  (2.5M)


I have tried to mount via

Code: Select all
Tecra# mount_ntfs /dev/da0s2 /mnt/
mount_ntfs: /dev/da0s2: Operation not permitted


Code: Select all
Tecra# mount_ntfs /dev/ad0s1b /mnt/
mount_ntfs: /dev/ad0s1b: Operation not permitted


Regards,

Alexander
zuttel
Junior Member
 
Posts: 9
Joined: 07 Apr 2010, 07:55

Postby wblock@ » 16 Aug 2010, 19:16

[man=1]file[/man] can help identify filesystems:

[cmd="#"]file -s /dev/da0s1[/cmd]
[cmd="#"]file -s /dev/da0s2[/cmd]
[cmd="#"]file -s /dev/da0s3[/cmd]
User avatar
wblock@
Old Fart
 
Posts: 10187
Joined: 07 Sep 2009, 23:23
Location: Milky Way galaxy


Return to Peripheral Hardware

Who is online

Users browsing this forum: No registered users and 0 guests