Solved Cannot mount pendrive

inf3rno

Active Member

Reaction score: 16
Messages: 167

Well actually it is a 16GB micro SD card in an USB adapter. It works properly on another computer with win7 and I used it for ubuntu with an arm sbc too. I made it fat32 under freebsd with sade, but I cannot mount it. I checked on win7 and formatted it, but even after that I cannot mount it on freebsd. I did geom disk list and it is called da0. When I do mount /dev/da0 ./usb I got "mount /dev/da0: No such file or directory" still I can see it with ls -a /dev. Any idea how to fix this?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,346
Messages: 38,863

When I do mount /dev/da0 ./usb I got "mount /dev/da0: No such file or directory" still I can see it with ls -a /dev.
You need to provide the type of filesystem with the mount(8) command. See msdosfs(5). If you don't provide the filesystem type mount(8) is going to assume you want to mount an UFS filesystem. Also make sure your mountpoint actually exists.

For example: mount -t msdosfs /dev/da0 /mnt
 
OP
I

inf3rno

Active Member

Reaction score: 16
Messages: 167

You need to provide the type of filesystem with the mount(8) command. See msdosfs(5). If you don't provide the filesystem type mount(8) is going to assume you want to mount an UFS filesystem. Also make sure your mountpoint actually exists.

For example: mount -t msdosfs /dev/da0 /mnt

Got /dev/da0 invalid argument.
Something is wrong with this drive. When I do gpart show da0 it shows up az a 15GB MBR with 512 byte free space in the beginning. When I do gpart create -s GPT da0 it writes that geom "da0" file exists. So it exists for reading but not for writing? Weird. Can this be some sort of driver issue?
Btw. on win7 I cannot remove partition and make a new one which is interesting too... All I can do is formatting and copying to it.
 

wolffnx

Aspiring Daemon

Reaction score: 231
Messages: 677

Got /dev/da0 invalid argument.
Something is wrong with this drive. When I do gpart show da0 it shows up az a 15GB MBR with 512 byte free space in the beginning. When I do gpart create -s GPT da0 it writes that geom "da0" file exists. So it exists for reading but not for writing? Weird. Can this be some sort of driver issue?
Btw. on win7 I cannot remove partition and make a new one which is interesting too... All I can do is formatting and copying to it.

more easy solution could be
(if there any data will be erased)


dd if=/dev/zero of=/dev/da0 bs=4M status="progress"

newfs_msdos /dev/da0
 
OP
I

inf3rno

Active Member

Reaction score: 16
Messages: 167

I tried with another sd card. I could not partition that either in win7. I used rufus, that solved it and removed the old partitions I used for ubuntu. Still I cannot mount that either in freebsd. I'll try what you wrote, but I guess it won't find da0 either.
 
OP
I

inf3rno

Active Member

Reaction score: 16
Messages: 167

more easy solution could be
(if there any data will be erased)


dd if=/dev/zero of=/dev/da0 bs=4M status="progress"

newfs_msdos /dev/da0
The zero fill works, it is very slow though, USB2 and 32GB...
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,346
Messages: 38,863

When I do gpart show da0 it shows up az a 15GB MBR with 512 byte free space in the beginning. When I do gpart create -s GPT da0 it writes that geom "da0" file exists. So it exists for reading but not for writing?
It already has an MBR scheme. You're trying to create a GPT scheme over the existing partition scheme. Hence the "file exists" message. Destroy the partition table before creating a new one.
 
OP
I

inf3rno

Active Member

Reaction score: 16
Messages: 167

It already has an MBR scheme. You're trying to create a GPT scheme over the existing partition scheme. Hence the "file exists" message. Destroy the partition table before creating a new one.
Ok, thanks. It works now.
 

wolffnx

Aspiring Daemon

Reaction score: 231
Messages: 677

The zero fill works, it is very slow though, USB2 and 32GB...

yes,but is my choice when some usb pendrive not boot...and always for new instalations
I'wipe my hard disk(imagine that in 500GB or 1TB disk)
sometimes fix any error with the
Code:
count=264
parameter
and then write the .iso again
 
OP
I

inf3rno

Active Member

Reaction score: 16
Messages: 167

yes,but is my choice when some usb pendrive not boot...and always for new instalations
I'wipe my hard disk(imagine that in 500GB or 1TB disk)
sometimes fix any error with the
Code:
count=264
parameter
and then write the .iso again
My only problem with it that these devices have limited write cycles and fully writing a disk uses up 1 cycle of 1000 maybe. It is not a big deal with SSDs I think, because quality SSDs typically have at least 3000 cycles if you check here: https://techreport.com/review/27909/the-ssd-endurance-experiment-theyre-all-dead/ but SD cards is a different story and they can have as few as a few hundred cycles. Even wear leveling is not necessarily there, though my sandisk cards have it. I am sure there is a better solution without writing the entire disk, I just did not find it this time.
 

wolffnx

Aspiring Daemon

Reaction score: 231
Messages: 677

Top