LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Trying to Mount USB mounting /dev/sda1 on /mnt/usb failed: Invalid argument (http://www.linuxquestions.org/questions/linux-newbie-8/trying-to-mount-usb-mounting-dev-sda1-on-mnt-usb-failed-invalid-argument-821742/)

JamesMore 07-23-2010 12:02 PM

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

Web31337 07-23-2010 12:13 PM

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.

kilgoretrout 07-23-2010 12:15 PM

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.

Didier Spaier 07-23-2010 02:04 PM

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, ...) ?

JamesMore 07-23-2010 06:14 PM

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


Web31337 07-23-2010 06:26 PM

you can format your USB device using any LiveCD on your desktop computer, if you don't have full-featured inatlled linux distro atm.

kilgoretrout 07-23-2010 06:59 PM

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.

JamesMore 07-23-2010 11:46 PM

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

Web31337 07-24-2010 03:49 AM

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.

JamesMore 07-28-2010 03:27 PM

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


All times are GMT -5. The time now is 04:53 PM.