LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-23-2010, 12:02 PM   #1
JamesMore
Member
 
Registered: Jul 2010
Posts: 34

Rep: Reputation: 0
Trying to Mount USB mounting /dev/sda1 on /mnt/usb failed: Invalid argument


I am using an embed linux application and trying to mount a USB device.
The USB worked fine in windows. I then put it on my Linux box formatted (I hope correctly)

And then tried to do the following to mount it


Code:
Disk /dev/sda: 4040 MB, 4040748544 bytes
255 heads, 63 sectors/track, 491 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sda1               1         491     3943926  83 Linux
-bash-3.2# mkdir /mnt/usb
-bash-3.2# mount /dev/sda1 /mnt/usb
mount: mounting /dev/sda1 on /mnt/usb failed: Invalid argument
-bash-3.2#

Thanks for your help
 
Old 07-23-2010, 12:13 PM   #2
Web31337
Member
 
Registered: Sep 2009
Location: Russia
Distribution: Gentoo, LFS
Posts: 399
Blog Entries: 71

Rep: Reputation: 65
what's the filesystem on that USB? did you partitioned it only with fdisk and not used mkfs.ext3/etc?
blkid /dev/sda1 can reveal some info.
 
Old 07-23-2010, 12:15 PM   #3
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Try:

# mount -t vfat /dev/sda1 /mnt/usb

If that doesn't work, you probably don't have the necessary modules loaded for usb mass storage devices and/or for vfat. Post the output of:

# lsmod

Edit: Didn't notice that sda1 was a linux filesystem. Never mind vfat; just post the output of lsmod.

Last edited by kilgoretrout; 07-23-2010 at 12:17 PM.
 
Old 07-23-2010, 02:04 PM   #4
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
You should indicate to the mount command what is the filesystem type of your USB device wilt the the -t <fstype> option, see "man mount".

Which fixe system did you put on it (e.g. ext2, ext3, reiserfs, ...) ?
 
Old 07-23-2010, 06:14 PM   #5
JamesMore
Member
 
Registered: Jul 2010
Posts: 34

Original Poster
Rep: Reputation: 0
Thank you all for your help and hints


Quote:
what's the filesystem on that USB? did you partitioned it only with fdisk and not used mkfs.ext3/etc
Yes sorry I did not format it I only used fdisk :-(

Now I did try and format it as well as use a few other commands you guys gave hints on.


Looks like on my embed device I am running a very limited set of commands or just still doing some thing wrong.

Code:
-bash-3.2# lsmod
-bash: lsmod: command not found
-bash-3.2# mkfs.ext3
-bash: mkfs.ext3: command not found
-bash-3.2# sudo mkfs.ext3 /dev/sda1
-bash: sudo: command not found
-bash-3.2# which lsmod
-bash-3.2# which sudo
-bash-3.2# which man 
-bash-3.2# which mkfs.ext3 
-bash-3.2# which bash
/bin/bash
cd /usr/
-bash-3.2# ls
[               expand          nohup           taskset
[[              expr            nslookup        tcpsvd
ar              fdformat        od              tee
arping          find            openvt          telnet
awk             flash_eraseall  passwd          test
basename        fold            patch           tftp
bunzip2         free            printf          time
bzcat           ftpget          pscan           top
cal             ftpput          readahead       tr
chpst           fuser           readlink        traceroute
chrt            head            realpath        tty
chvt            hexdump         renice          ttysize
cksum           hostid          reset           udpsvd
clear           id              resize          unexpand
cmp             install         rpm2cpio        uniq
comm            ipcrm           runsv           unix2dos
crontab         ipcs            runsvdir        unlzma
cryptpw         killall         rx              unzip
cut             killall5        scp             uptime
dc              last            seq             uudecode
deallocvt       length          setkeycodes     uuencode
diff            less            setsid          vlock
dirname         loadfont        setuidgid       wc
dos2unix        logger          sha1sum         wget
dropbearkey     logname         softlimit       which
du              lzmacat         sort            who
dumpleases      md5sum          split           whoami
eject           mesg            strings         xargs
env             mkfifo          sum             yes
envdir          nandwrite       sv
envuidgid       nc              svlogd
ether-wake      nmeter          tail
-bash-3.2# cd /sbin/
-bash-3.2# ls
adjtimex           ifup               modprobe           sulogin
arp                init               nameif             swapoff
fdisk              insmod             pivot_root         swapon
freeramdisk        klogd              poweroff           switch_root
fsck               loadkmap           raidautorun        sysctl
fsck.minix         logread            reboot             syslogd
getty              losetup            rmmod              udhcpc
halt               lsmod              route              vconfig
hdparm             makedevs           runlevel           watchdog
hwclock            mdev               setconsole         zcip
ifconfig           mkfs.minix         slattach
ifdown             mkswap             start-stop-daemon

Last edited by JamesMore; 07-23-2010 at 06:16 PM.
 
Old 07-23-2010, 06:26 PM   #6
Web31337
Member
 
Registered: Sep 2009
Location: Russia
Distribution: Gentoo, LFS
Posts: 399
Blog Entries: 71

Rep: Reputation: 65
you can format your USB device using any LiveCD on your desktop computer, if you don't have full-featured inatlled linux distro atm.
 
Old 07-23-2010, 06:59 PM   #7
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
lsmod is in /sbin which is not in PATH so you have to give the full path to the command like:

# /sbin/lsmod

Quote:
I did not format it
Undoubtedly, that's your problem. Format using a livecd or format it back to FAT32 in windows.

Last edited by kilgoretrout; 07-23-2010 at 07:04 PM.
 
Old 07-23-2010, 11:46 PM   #8
JamesMore
Member
 
Registered: Jul 2010
Posts: 34

Original Poster
Rep: Reputation: 0
Thanks kilgoretrout for the hint I swear at one stage I did that guess not

Quote:
-bash-3.2# /sbin/lsmod /dev/sda1
Module Size Used by Not tainted


can you let me know what the syntax will be to format it the drive, will grab ubuntu I guess in the morning thanks for every ones help
 
Old 07-24-2010, 03:49 AM   #9
Web31337
Member
 
Registered: Sep 2009
Location: Russia
Distribution: Gentoo, LFS
Posts: 399
Blog Entries: 71

Rep: Reputation: 65
boot into livecd, find your usb device(likely still /dev/sda1 , but check it with fdisk first), then
Code:
mkfs.ext3 /dev/sda1
and that's it.
or, yes, alternatively you can format it to fat32.
Unfortunately, it seems to me that either of ways won't actually help you using this drive on this device(what's the device btw?), as far as I can see there is no fsck.ext2/fsck.ext3 only minix fs, so likely you will not be able to use any of previously mentioned filesystems with current kernel of the device.
lsmod is command that lists loaded kernel modules, not for reading some info from drives as you used it. It requires no additional parameters but that won't help you here: it's just for your future reference.
 
Old 07-28-2010, 03:27 PM   #10
JamesMore
Member
 
Registered: Jul 2010
Posts: 34

Original Poster
Rep: Reputation: 0
I tried to format the drive in a live cd but I am getting a error that the drive is in use, even when i try and format it from the gui it fails

I tried to "safely remove device" but then the format command would not work either saying device was busy made sure i was no in it in termnal and also not a open window but still no luck:-(


Any ideas
 
  


Reply

Tags
format, mount, usb



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why only "mount /dev/sda /mnt/usb" works and not "mount /dev/sda1..." ? gromot Linux - General 7 05-19-2009 10:18 AM
USB drive... /dev/sda1 doesn't show unless I try mounting /dev/sda as vfat finite Linux - Hardware 8 03-10-2009 12:52 AM
ERROR AT MOUNTING USB :mount: wrong fs type, bad option, bad superblock on /dev/sda1, saiket Linux - Hardware 3 04-12-2008 12:07 AM
mount: Mounting /dev/sda2 on /mnt failed: Invalid argument dohpaz Slackware 7 05-25-2007 02:03 AM
installation Error mounting sda1: Invalid Argument sadirmata Linux - Software 4 01-31-2002 10:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration