element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Unable to mount USB Stick on RPi
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 10 replies
  • Subscribers 672 subscribers
  • Views 5573 views
  • Users 0 members are here
Related

Unable to mount USB Stick on RPi

mgt6910
mgt6910 over 12 years ago

I have copied some music files to a USB stick using Linux Mint, (on Mint

it auto-mounted with no problems),and I would

like to mount it on RPi. Details of what I have tried are appended. Any

help would be welcome (I need this sorted by Christmas, or my grandsons won't receive a present !!)

 

As root (sudo bash) on RPi,I inserted the USB Stick:

 

tail -f /var/log/messages

=================================================================

new high-speed USB device number 11 using dwc_otg

new USB device found, idVendor=0781, idProduct=5567

Product: Cruzer Blade

Manufacturer: SanDisk

Serial Number: 20060266511169034397

scsi2 : usb-storage 1-1.1.2.4.4:1.0

scsi 2:0:0:0: Direct-Access  Sandisk Cruzer Blade    1.26 PQ: 0  ANSI: 5

sd 2:0:0:0:  [sda] 62530624 512-byte logical blocks:  (32.0 GB/ 29.8 GiB)

sd 2:0:0:0:  [sda] Write Protect is off

sd 2:0:0:0:  [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA

   sda: sda1

sd 2:0:0:0:  sd 2:0:0:0:  [sda] Attached SCSI removable disk

==================================================================

 

Following instructions found at :

    http://raspi.tv/2012/mount-a-usb-flash-drive-on-raspberry-pi

 

    I entered:

        mkdir /media/my32gb

        mount -t vfat -o rw /dev/sda1 /media/my32gb

 

    which failed with :

        mount: /dev/sda1 is not a valid block device

  • Sign in to reply
  • Cancel
Parents
  • johnbeetem
    johnbeetem over 12 years ago

    When I've used a USB Flash drive on RasPi with Debian "Squeek", it OS automatically mounts the USB Flash drive in "/media".  So I do "ls /media" to see what it's been named.  Then I copy to/from "/media/<whatever>".  I suppose I should unmount it and mount it somewhere else and give it a proper name, but I never learned those commands and what I do now works well enough.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to johnbeetem

    yes, normally udev will create the device nodes in dev and the drive will be mounted for you.

     

    However, "mount: /dev/sda1 is not a valid block device" strongly suggests that the major/minor numbers for the device node do not match the kernel's idea of what the major/minor numbers really are.

     

    That's unusual and would suggest udev is broken or out of sync with whatever the kernel is doing, or even that udev is not running and stale entries from a static /dev are in use.

     

    Either way, comparing the contents of /proc/partitions with the device node should at least give us a starting point.

     

    The only other thing I can think of is that there's some usb or power issue causing the device to rapidly appear and disappear and it's at least partially gone by the time mount tries to access it.

     

    More info needed though...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 12 years ago in reply to Former Member

    my steps would be the following (never failed me.):

     

    1. Power up Raspberry Pi with device plugged in.

    2. Log into RPi

    3. Type in (at the prompt)

    fdisk -l

    4. Looking at the information on the screen, there should be two devices with about two partitions each. The marked /dev/sda1 (or any number) is your USB drive.  Some USB drives have mulitple partitions, use (in the next step) the partition with the largest amount of space.

    5. now that you know what your device is called, we can mount it to any folder or location of your choosing.

    mount /dev/sda1 /media

    This will mount the usb device called '/dev/sda' with partition '1' to the folder '/media'.

     

    This is how I mount my drives.  After you know what it is called, you can use the same command in step 5 each time you want to use the device.

     

    Hope this helps.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mgt6910
    mgt6910 over 12 years ago in reply to wallarug

    My idea is to produce a (relatively) crashproof system for my grandsons. I plan to give them 3 copies of the latest Wheezy  on 8Gb cards. Every time they  forget to shut down and a card becomes unusable, they change to another card.  To allow them to keep their files off the system-card, my idea was to make a softlink from the  /home folder to the USB stick.

    For this to work, the USB-stick needs to be auto-mounted with a fixed name that can be used for the softlink, without

    the kids having to type in a list of commands supplied by granpa (so uncool !). 

     

    What I am seeking to avoid is a procedure that obliges them to poke around inside /media, as opposed to just using pi's home. They should be

    able to switch system-cards and USB sticks, without any need to type in commands (they will have 2 complete pi systems, and  I would like them to be able to just swap sticks to see what the other one has been developing).

     

         Many thanks for the suggestions, I will follow them up ASAP. I guess that someone into bash-scripting could create a script that looks

    in /media and makes a softlink  /home/pi to whatever is auto-mounted there.   That's above my pay-grade I'm afraid (starting pi before /home/pi exists seems a bit iffy !)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 12 years ago in reply to mgt6910

    Shouldn't be too hard to achieve.

     

    Only one file needs to editted and one needs to be created.  Here we go...

     

    1. log onto raspi

    2. type in:

    sudo nano /etc/rc.local

    3. add to this file by going down to the bottom, and then BEFORE the 'exit0', add the line:

    su -c "/boot/startup.sh" root

    4. Press CRTL+x, then 'y'

    5. Create a new file called 'startup.sh' in the /boot directory like so:

    sudo nano /boot/startup.sh

    6.  In this file add the following commands so that the file looks like this:

    sudo umount /dev/sda1

    sudo mount /dev/sda1 /home/pi

    7. For the last line, you might want to change the location from '/home/pi' to whatever you want.

     

    That should do it for you.  I have not tested this but I think it should work as long as you have the USB plugged in at boot, every time you start-up the SD card, the USB drive will mount.

     

    PS: Did you know that in the 'startx' environment, the USB drive mounts automatically?  It is only command line that it doesn't.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mgt6910
    mgt6910 over 12 years ago in reply to wallarug

    Many thanks for that information, I will try this ASAP. Keeping user-files off the SD-card will greatly simplify upgrading the system in the future. If I manage the mods you suggest, I will then try startx to see if it is compatible with the change.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mgt6910
    mgt6910 over 12 years ago in reply to mgt6910

    Yes, I think that fits the bill !  Many thanks for the advice.   ( I think that the USB stick was failing because of the USB hub (trust.com/15140,7-port 2A supply). On the second RPi-port, the stick seems reliable.)

     

    With the FAT32 format of the Stick, I could not set 755 permissions for the top-level directory, or lost+found.

    To solve this, I used gparted on Linux Mint to reformat the stick as ext3, and could then set the permissions.

     

    The mods were applied as suggested, and it works fine.  The umount command produces the message : umount: /dev/sda1: not mounted, which checks with your note about automount/startx, so I will remove that line.

     

    startx starts up OK, but I haven't yet created the Desktop folder which contains the icons....

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • wallarug
    wallarug over 12 years ago in reply to mgt6910

    glad to hear that! image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to wallarug

    Fergus Byrne wrote:

     

    my steps would be the following (never failed me.):

     

    1. Power up Raspberry Pi with device plugged in.

    2. Log into RPi

    3. Type in (at the prompt)

    fdisk -l

    Fergus, the one problem with this is that fdisk -l is just querying the /dev/sda /dev/sda1 etc device nodes directly (after getting it's list from /proc/partitions).

     

    With mount giving an error message of "/dev/sda1 is not a valid block device", fdisk won't be able to read it either, and all you'd see is the sd card.

     

    Otherwise, what you suggest is almost exactly what I use image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Former Member
    Former Member over 12 years ago in reply to wallarug

    Fergus Byrne wrote:

     

    my steps would be the following (never failed me.):

     

    1. Power up Raspberry Pi with device plugged in.

    2. Log into RPi

    3. Type in (at the prompt)

    fdisk -l

    Fergus, the one problem with this is that fdisk -l is just querying the /dev/sda /dev/sda1 etc device nodes directly (after getting it's list from /proc/partitions).

     

    With mount giving an error message of "/dev/sda1 is not a valid block device", fdisk won't be able to read it either, and all you'd see is the sd card.

     

    Otherwise, what you suggest is almost exactly what I use image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube