1e8fa Can't mount NTFS USB stick - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > Peripheral Hardware

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

Reply
 
Thread Tools Display Modes
  #1  
Old February 23rd, 2010, 07:37
xiaweitang xiaweitang is offline
Junior Member
 
Join Date: Feb 2010
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can't mount NTFS USB stick

I have a 16GB usb stick formated to one partition with NTFS. After I plug it in, dmesg shows fine but with one problem:
Code:
GEOM: media size does not match label
The /dev folder contains da0 and da0a, and all the following commands
Code:
mount_ntfs /dev/da0 /mnt
mount -t ntfs-3g /dev/da0 /mnt

mount_ntfs /dev/da0a /mnt
mount -t ntfs-3g /dev/da0a /mnt
give the error "invalid argument"

I also have a smartphone with usb port, the card in the phone is formated FAT, and the command
Code:
mount_msdosfs /dev/da0 /mnt
works just fine.

So I guess the problematic part is this
Code:
GEOM: media size does not match label
I googled and find little information about that error message. I don't want to reformat the drive to FAT, because I need to store files over 4G in size.
Reply With Quote
  #2  
Old February 23rd, 2010, 08:33
lme@'s Avatar
lme@ lme@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Düsseldorf, Germany
Posts: 589
Thanks: 44
Thanked 181 Times in 90 Posts
Default

I guess that you need to mount the right device.
Do a # ls -l /dev/da* and see what's there.
If there's a /dev/da0s1 try to mount this.
If not, you can try to run # : > /dev/da0. Don't worry, it won't delete your USB stick, it just opens it for writing and sometimes its actual slices are recognized and added then.
Reply With Quote
The Following User Says Thank You to lme@ For This Useful Post:
tom-pele (October 4th, 2010)
  #3  
Old February 23rd, 2010, 21:56
xiaweitang xiaweitang is offline
Junior Member
 
Join Date: Feb 2010
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by lme@ View Post
I guess that you need to mount the right device.
Do a # ls -l /dev/da* and see what's there.
If there's a /dev/da0s1 try to mount this.
If not, you can try to run # : > /dev/da0. Don't worry, it won't delete your USB stick, it just opens it for writing and sometimes its actual slices are recognized and added then.
ls -l /dev/da* only show da0 and da0a.
Reply With Quote
  #4  
Old February 23rd, 2010, 21:58
xiaweitang xiaweitang is offline
Junior Member
 
Join Date: Feb 2010
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by lme@ View Post
I guess that you need to mount the right device.
Do a # ls -l /dev/da* and see what's there.
If there's a /dev/da0s1 try to mount this.
If not, you can try to run # : > /dev/da0. Don't worry, it won't delete your USB stick, it just opens it for writing and sometimes its actual slices are recognized and added then.
I'll try the command # : > /dev/da0, but what does that command actually do?
Reply With Quote
  #5  
Old February 24th, 2010, 01:15
xiaweitang xiaweitang is offline
Junior Member
 
Join Date: Feb 2010
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by xiaweitang View Post
I'll try the command # : > /dev/da0, but what does that command actually do?
I tried that command, but still get the same error message, and dmesg show one more line of
Code:
GEOM: da0: media size does not match label.
Reply With Quote
  #6  
Old February 24th, 2010, 11:26
lme@'s Avatar
lme@ lme@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Düsseldorf, Germany
Posts: 589
Thanks: 44
Thanked 181 Times in 90 Posts
Default

The command opens the da0 device for writing and sometimes finds its partitions.
Too bad it didn't work for you.
Reply With Quote
  #7  
Old February 24th, 2010, 17:40
xiaweitang xiaweitang is offline
Junior Member
 
Join Date: Feb 2010
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by lme@ View Post
The command opens the da0 device for writing and sometimes finds its partitions.
Too bad it didn't work for you.
So should I reformat my drive using the fdisk under freeBSD? And will that make sure it will be recognized?
Reply With Quote
  #8  
Old February 25th, 2010, 10:46
lme@'s Avatar
lme@ lme@ is offline
FreeBSD Developer
 
Join Date: Oct 2007
Location: Düsseldorf, Germany
Posts: 589
Thanks: 44
Thanked 181 Times in 90 Posts
Default

Yeah, that would be worth a try. fdisk and then newfs_msdos.
Reply With Quote
  #9  
Old March 1st, 2010, 11:45
fbsd1 fbsd1 is offline
Member
 
Join Date: Feb 2010
Location: Angeles City, Philippines
Posts: 199
Thanks: 0
Thanked 42 Times in 28 Posts
Default

When you plug in your USB stick to a all ready running FBSD system the root console will display a bunch of messages about your USB stick including the device name. With no other USB devices plugged in it will be auto assigned /dev/da0.

Now the real question is how do you know this 16GB USB stick was formatted for NT file system? The manufacture sells them with ms/dos fat32 on them.

To clean up things
plug it into FBSD issue this command to zero out the MBR
dd if=/dev/zero of=/dev/da0 count=1
Then plug it into ms/xp open windows/explorer and try to open that drive. you will get box popup saying do you want to format this disk? answer yes. Now your USB stick is ms/dos fat32. go back to FBSD and mount_msdosfs /dev/da0 /mnt should work this time.
__________________
FreeBSD Install Guide www.a1poweruser.com
Maintainer of the sysutils/qjail port

Last edited by DutchDaemon; March 1st, 2010 at 12:42. Reason: format your posts -> http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
The Following User Says Thank You to fbsd1 For This Useful Post:
pigling (September 1st, 2010)
  #10  
Old March 2nd, 2010, 22:59
xiaweitang xiaweitang is offline
Junior Member
 
Join Date: Feb 2010
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by fbsd1 View Post
When you plug in your USB stick to a all ready running FBSD system the root console will display a bunch of messages about your USB stick including the device name. With no other USB devices plugged in it will be auto assigned /dev/da0.

Now the real question is how do you know this 16GB USB stick was formatted for NT file system? The manufacture sells them with ms/dos fat32 on them.

To clean up things
plug it into FBSD issue this command to zero out the MBR
dd if=/dev/zero of=/dev/da0 count=1
Then plug it into ms/xp open windows/explorer and try to open that drive. you will get box popup saying do you want to format this disk? answer yes. Now your USB stick is ms/dos fat32. go back to FBSD and mount_msdosfs /dev/da0 /mnt should work this time.
I know it's NTFS because I formatted it that way using gparted under ubuntu. The reason I want NTFS rather than FAT32 is because I need to put a file larger than 4GB in it.
Reply With Quote
  #11  
Old July 9th, 2010, 04:40
fabiokaminski fabiokaminski is offline
Junior Member
 
Join Date: Jul 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i went to the same problem... note that i created the w95 lba partition on linux and created msdos fs with mkfs.vfat...

got the same issues, with freebsd not recognizing the partition just (da0a) ...
then looking into the kernel modules.. i've tried:

Code:
kldload geom_mbr
and everything works fine..

hope it help others,

cheers!
Reply With Quote
  #12  
Old July 9th, 2010, 05:06
sk8harddiefast's Avatar
sk8harddiefast sk8harddiefast is online now
Senior Member
 
Join Date: Mar 2010
Location: Athens, Greece
Posts: 1,722
Thanks: 215
Thanked 142 Times in 88 Posts
Default

You should have something like /dev/da0s1 and mount it like this:
Code:
mount_msdosfs /dev/da0s1 /mnt/your folder
__________________
====================================
| -------> UNIX. Live Free Or Die! <-------- |
====================================
You can say: I can't do something because is difficult.
You must say: I tried a lot before say that I can't.
Never Give up.
http://unixsystems.dyndns.org/
I am not an BSD expert. But I really want to help.
Don't afraid to ask me anything. If I can I will help!

Nice wallpapers to make your desktop more hardcore :) ---> http://forums.freebsd.org/showthread.php?t=13416
Reply With Quote
  #13  
Old September 1st, 2010, 07:15
pigling pigling is offline
Junior Member
 
Join Date: May 2010
Posts: 18
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by fbsd1 View Post
When you plug in your USB stick to a all ready running FBSD system the root console will display a bunch of messages about your USB stick including the device name. With no other USB devices plugged in it will be auto assigned /dev/da0.

Now the real question is how do you know this 16GB USB stick was formatted for NT file system? The manufacture sells them with ms/dos fat32 on them.

To clean up things
plug it into FBSD issue this command to zero out the MBR
dd if=/dev/zero of=/dev/da0 count=1
Then plug it into ms/xp open windows/explorer and try to open that drive. you will get box popup saying do you want to format this disk? answer yes. Now your USB stick is ms/dos fat32. go back to FBSD and mount_msdosfs /dev/da0 /mnt should work this time.
This works for me. I use "sysintall" to partition and label the USB device. However, when attach/detach after writing change to disk it always prompts
Code:
GEOM: media size does not match label
Then after attaching, run
mount_msdosfs /dev/da0a /mnt/usb
give the error
Code:
invalid argument
I know dd if=/dev/zero of=/dev/da0 count=1 is to clear up the disk. But why does FreeBSD detect da0 but not da0a in /dev after formatting in winXP? Can someone give a suggestion? Thanks.

regards,
qichao

Last edited by DutchDaemon; September 1st, 2010 at 14:37. Reason: proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
  #14  
Old September 1st, 2010, 12:35
Beastie Beastie is offline
Senior Member
 
Join Date: Mar 2009
Location: /dev/earth0
Posts: 1,702
Thanks: 0
Thanked 301 Times in 245 Posts
Default

Quote:
Originally Posted by pigling View Post
Code:
mount_msdosfs /dev/da0a /mnt/usb
give the error "invalid argument".

I know "dd if=/dev/zero of=/dev/da0 count=1" is to clear up the disk. But why does FreeBSD detect da0 but not da0a in /dev after formatting in winXP?
a is a BSD (UFS) partition label. FAT and UFS are two different filesystems.
Depending on the way the drive was partitioned by Windows, replace da0a by da0s1 or simply by da0.
When in doubt always do a % ls /dev/da*
__________________
May the source be with you!
Reply With Quote
  #15  
Old September 1st, 2010, 15:21
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,714
Thanks: 432
Thanked 1,759 Times in 1,457 Posts
Default

Quote:
Originally Posted by pigling View Post
I know dd if=/dev/zero of=/dev/da0 count=1 is to clear up the disk.
More precisely, it's to clear the first block, where the MBR and partition table are stored. And that's probably where the problem is, because you aren't seeing da0s1. I think Windows will create a partition table on memory sticks by default, but don't know for sure and can't work up the enthusiasm to test it.

To easily edit a partition table, I recommend Linux's cfdisk. I only wish we had something like it for FreeBSD. (sade(8) has problems like delayed commit and happily changing your /etc/fstab when it should not. And the user interface could be better.)
Reply With Quote
  #16  
Old September 1st, 2010, 16:41
Beastie Beastie is offline
Senior Member
 
Join Date: Mar 2009
Location: /dev/earth0
Posts: 1,702
Thanks: 0
Thanked 301 Times in 245 Posts
Default

Quote:
Originally Posted by wblock View Post
To easily edit a partition table, I recommend Linux's cfdisk. I only wish we had something like it for FreeBSD.
Anything wrong with fdisk's -u option? It lets you change every single field in there. I have never needed anything else.
__________________
May the source be with you!
Reply With Quote
  #17  
Old September 1st, 2010, 17:45
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,714
Thanks: 432
Thanked 1,759 Times in 1,457 Posts
Default

Quote:
Originally Posted by Beastie View Post
Anything wrong with fdisk's -u option? It lets you change every single field in there. I have never needed anything else.
It's... I don't know the right way to describe it. The question/answer interactive thing is like a phone menu system. Maybe it's great if you use it often.

To me, the visual nature of cfdisk is easier to use.
Reply With Quote
  #18  
Old April 10th, 2012, 14:44
peetaur peetaur is offline
Member
 
Join Date: Sep 2011
Location: Geesthacht, Germany
Posts: 167
Thanks: 11
Thanked 13 Times in 13 Posts
Default

Problem and Solution

My disk was also formatted (a year ago) using mkfs.ntfs on Ubuntu Linux. I had the same problem with the "Invalid argument" error message. Also in dmesg, you see some errors such as:

Code:
g_vfs_done():ntfs/disklabelgoeshere[READ(offset=0, length=1024)]error = 22
g_vfs_done():da29s1[READ(offset=0, length=1024)]error = 22
The problem was that I didn't realize the command I was using (mount -t ... or mount_ntfs) were not the fuse package I installed a month ago.

To realize this, I saw in the man page:

Code:
CAVEATS
     This utility is primarily used for read access to an NTFS volume.  See
     the WRITING section for details about writing to an NTFS volume.

     For a full read-write NTFS support consider sysutils/fusefs-ntfs
     port/package.
So the solution was to simply use the fuse command instead:
# ntfs-3g /dev/ntfs/disklabelgoeshere /mnt/mountpoint

And now it works... but seems to read from the disk while writing, halving the write performance (12.5 MB/s over USB 2.0).
__________________
Criticism is always welcome.

Last edited by DutchDaemon; April 10th, 2012 at 17:51.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] ntfs-3g problem , can't mount cola Installation and Maintenance of FreeBSD Ports or Packages 2 November 29th, 2010 03:28
[Solved] How can i mount ntfs? cola General 7 November 27th, 2010 19:42
Can't mount usb stick on FreeBSD zuttel Peripheral Hardware 7 August 16th, 2010 20:16
USB stick mount problem nephrite Peripheral Hardware 7 February 7th, 2010 10:14
[Solved] how to mount ntfs usb HDD with rw access beginner Peripheral Hardware 12 January 28th, 2010 17:48


All times are GMT +1. The time now is 21:28.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0