Tag Archives: linux

How to access, read, write, or mount a USB flash drive in Ubuntu Linux

My most viewed blog post is about how to access a flash drive on Ubuntu Linux. Written five years ago, it is my most-viewed post ever. For example, it now accounts for over a third of my views each day. [1]

This suggests that lots of folks are still having problems using flash drives on Ubuntu, and possibly other Linux distributions as well

The post is a bit dated. A lot has changed in the last five years, so here’s an update on how I currently access flash drives on my Ubuntu 12.04 desktop.

When you first put a flash drive into the computer all you will see is the light on the flash drive come on, if it has one.

If you do

$ ls /media

you won’t see any sign of the drive.

So what you do next is to open File Manager. It’s right there near the top of the main menu. It should show the flash drive. All the drives I have come with a built-in id, and File Manager will display it near the top of its page. Look for text that begins with /media/.

For example, I just plugged in a drive while writing this. It has the id 054A-FDA0.

Leave File Manager running, while you access the drive

If you again do

$ ls /media

you should see the drive. For example, I just did and found the file /media/054A-FDA0.

You can now do things like

$ cp /media/054A-FDA0/work.tar .

and so on.

It is good form to close the drive when you are done using it. This is not really needed if you are just reading the drive, but is important if you have written data to it. You want to know all the data has been written.

There are two ways to do what in Linux is called “unmounting” the flash drive.

One is

umount /media/054A-FDA0

Note the command is “umount” and not “unmount”. This is one case where Unix terseness, in this case saving a single letter, did more harm than good.

Another is to go back to File Manager, find the symbol for the drive in the left column, and right click your mouse on it. You will get a list of options, one of which is Eject Removable Medium. Then pick that, and remove the drive

Either will work. You make the call.

By the way, whenever you are typing a command that includes the flash drive id, as soon as you have typed the first letter or so, you should hit the Tab key. The shell will then complete the rest of the name for you.

(This is true whenever you are entering a file name. It’s one of the very nice features of Linux: thoughtful people have worked hard to make your work easier.)

Notes:

1 The second most-viewed post is A Brief History of Operating Systems, based on a couple of days of writing done while I was at IBM. Steve Mills, then and now head of IBM’s Software Group, felt that his salesmen didn’t know enough about this topic, and asked that someone put something together. The request landed on my desk, and not having anyone else I could kick it down the road to, I had to do it myself. [2]

2. One of the sagest observations I have ever heard came from Ralph Griswold, in a conversation almost forty years ago:

I wish I had done it myself. In the long run I always do.

Linux: The Last OS Standing

One of my favorite films is Akira Kurosawa’s Yojimbo. It stars Toshiru Mifune, who plays a lone samurai who comes into a town where two factions are feuding, and then skillfully plays one against another until he is the last man standing, so it’s no surprise that the film was (poorly) remade as Last Man Standing, starring Bruce Willis, in one of his worst films (all gore, no subtlety, which was the point of Yojimbo.)

I was reminded of this while doing a cleanup/refactoring of the code for Macro SPITBOL.

There has been almost no work on SPITBOL, save the port to Linux, in the last decade. Most of the code has been stable since the mid 80’s, save for ports to different architectures.

SPITBOL has a run-time interface written in C. While perusing this code I noticed the code had conditional text for various operating systems: AIX, BSD, LINUX, SOLARIS, and WINNT. Not Windows, but WINNT, a sign of the age of the code.

I then decided to clean up the code. There was no need for SOLARIS. It’s dead, though its new owner Oracle has not yet addmitted it.

AIX is also an outlier OS now, used only in large servers, so that went next.

BSD, UNIX and LINUX are all variants of UNIX.

That left WINNT. I then realized that, while much of the WINNT code would probably still work, I had absolutely no intereset in supporting it. That’s because Microsoft has not made any meaningful innovation, at least when it comes to Windows, in the last decade or so.

One thing (is it the only thing?) Microsoft does well is to support previous versions of its various OS’s, going all the way back to DOS. For example, the Windows/WINNT version of SPITBOL, last touched over a decade ago, still works, and so is in my view sufficient for Windows users.

I thus edited the source so there is *no* conditional text to distinguish operating systems, because there is only *one* OS of interest. It runs everywhere, and is where operating system innovation can still be found.

So I deleted *all* the conditional text, and changed the source to just use “Unix” instead of “Linux” in the version/achitecture description.

Needless to say doing that edit was a lot of fun. Bye bye, SOLARIS. Bye, bye AIX. Bye, bye Windows. Just Unix is enough for me.

The remaining issue is what hardware to support.

I see only two architectures of interest: X86 and ARM. SPITBOL supports X86 now, and I will port the system to ARM within a few months.

This is one result of working on legacy code. It gives you a sense of what was once important, but no longer is.

It also gives you greater appreciation for the survivors, and all the hard work behind them.

On Ubuntu: Some Examples of the Use of The Web to Answer Questions About Ubuntu and Linux

Here is a list of some of the search phrases that have brought views of this blog today. Each list entry gives the search string and the number of views:

  1. building a computer to run ubuntu 6
  2. build your own linux computer 4
  3. best browser for ubuntu 3
  4. remove all java from ubuntu 2
  5. best browsers for ubuntu 2
  6. best ubuntu browser 2
  7. leigh anne tuohy 2
  8. geforce 6100sm manual 2
  9. ubuntu kodak camera
  10. uniicomp keyboard 1
  11. juploadr ubuntu 1
  12. ubuntu compatible motherboards
  13. intel 845gl ubuntu driver 1
  14. intel 845g ubuntu
  15. how do i build my own ubuntu computer 1
  16. juploadr ubuntu 1
  17. My favorite is, of course, #4.

Note that most of the searches were to learn about Ubuntu, or as part of a search to answer a question about Ubuntu. For example, the Intel 845 chip and a GEFORCE motherboard are among the components I have used in the two desktop computers I have built to run Ubuntu Linux. Each cost no more than $250.

Needless to say, there was no charge for the software that I installed on them — not one penny. WIndows XP runs about $100 a copy these days, which would have increased the cost of either machine by forty per cent.

The above list is just for today. Here are the results for all searches to date that resulted in more than one hundred views:

  1. leigh anne tuohy 4,859
  2. leigh ann tuohy 1,040
  3. twiters 773
  4. ubuntu computer 692
  5. lotus symphony ubuntu 459
  6. kyu chay 453
  7. brief history of operating system 451
  8. juploadr ubuntu 345
  9. kenken solver 326
  10. norman salsitz 323
  11. fadwa hamdan 311
  12. ubuntu java version 273
  13. symphony ubuntu 262
  14. build your own linux computer 229
  15. “leigh anne tuohy” 228
  16. ubuntu compatible motherboards 218
  17. me tube 216
  18. ubuntu mount flash drive 204
  19. ubuntu t60 183
  20. ooxml specification 169
  21. ubuntu lotus symphony 164
  22. ubuntu intel 845 161
  23. 100 dollar computer 155
  24. xo ubuntu 154
  25. leigh anne tuohy picture 153
  26. build ubuntu computer 147
  27. ubuntu motherboards 146
  28. annus terribilis 146
  29. intel 845 ubuntu 144
  30. build linux computer 141
  31. intel 845g ubuntu 138
  32. laptop xo 132
  33. mount flash drive ubuntu 126
  34. david shields 123
  35. ubuntu motherboard 123
  36. ubuntu compatible motherboard 121
  37. a brief history of operating system 119
  38. ubuntu on xo 119
  39. ubuntu motherboard compatibility 118
  40. building a linux computer 118
  41. ubuntu access usb drive 117
  42. ubuntu mount usb flash 116
  43. why do we need to communicate 107
  44. build a linux computer 105
  45. best browser for ubuntu 104
  46. ooxml spec 103
  47. ubuntu kvm switch 102
  48. leigh anne touhy 101
  49. history of operating systems 101

These lists are yet another demonstration that the most important words in a blog post are the ones in the title. Those words determine if people will be drawn to the post, and hopefully then read it.

The one that means the most to me is, of course, #6, “kyu hyuk chay,” though this is moderated by my knowledge that, while I have written several posts about him, only a handful of posts by others make mention of his name.

Note again the predominance of “ubuntu,” This is by design, for I attach high priority to promoting Ubuntu. Every title that contains “ubuntu” also contains “linux,” and vice versa.

#3 is evidence that, while twitter may claim ownership of “twitter,” I’ve got “twiter” in my pocket.

#1 and #2 are about Leigh Ann Tuohy, one of my favorite people in the world. Ms. Tuohy made the most perceptive remark about money I have heard in the last decade:

God gives people money to see how you’re going to handle it.

Her observation is the source of this blog’s motto:

WordPress gave me a blog to see how I was going to handle it

Ms. Tuohy is the adoptive mother of Michael Oher, my favorite football player. He is the reason I am now a die-hard fan of the Baltimore Ravens.

How do you access, read, write, or mount a USB flash drive in Ubuntu 7.04?

Update: 30 August 2012

It’s been five years since I first wrote on this topic. As it happens, it remains one of my most popular posts, which suggests that lots of folks are still having problems using flash drives on Ubuntu, and possibly other Linux distributions as well. [1]

A lot has changed in the last five years, so here’s an update on how I currently access flash drives on my Ubuntu 12.04 desktop.

When you first put a flash drive into the computer all you will see is the light on the flash drive come on, if it has one.

If you do

$ ls /media

you won’t see any sign of the drive.

So what you do next is to open File Manager. It’s right there near the top of the main menu. It should show the flash drive. All the drives I have come with a built-in id, and File Manager will display it near the top of its page. Look for text that begins with /media/.

For example, I just plugged in a drive while writing this. It has the id 054A-FDA0.

Leave File Manager running, while you access the drive

If you again do

$ ls /media

you should see the drive. For example, I just did and found the file /media/054A-FDA0.

You can now do things like

$ cp /media/054A-FDA0/work.tar .

and so on.

It is good form to close the drive when you are done using it. This is not really needed if you are just reading the drive, but is important if you have written data to it. You want to know all the data has been written.

There are two ways to what in Linux is called “unmounting” the flash drive.

One is

umount /media/054A-FDA0

Note the command is “umount” and not “unmount”. This is one case where Unix terseness, in this case saving a single letter, did more harm than good.

Another is to go back to File Manager, find the symbol for the drive in the left column, and right click your mouse on it. You will get a list of options, one of which is Eject Removable Medium. Then pick that, and remove the drive

Either will work. You make the call.

By the way, whenever you are typing a command that includes the flash drive id, as soon as you have typed the first letter or so, you should hit the Tab key. The shell will then complete the rest of the name for you.

(This is true whenever you are entering a file name. It’s one of the very nice features of Linux: thoughtful people have worked hard to make your work easier.)

Notes:

1. This post has been among my five most popular for several years now. The only one consistently more popular has been A Brief History of Pperating Systems, based on a couple of days of writing while I was at IBM. Steve Mills, then and now head of IBM’s Software Group, felt that his salesmen didn’t know enough about this topic, and asked that someone put something together. The request landed on my desk, and not having anyone else I could kick it down the road to, I had to do it myself. [2]

2. One of the sagest observations I have ever heard came from Ralph Griswold in a conversation almost forty years ago:

I wish I had done it myself. In the long run I always do.

======== End of update of 30 August 2012 ========

======== The text below was originally posted on 30 August 2007 ========

If you want to access a USB flash drive in Ubuntu then just plug it into a working USB slot on your machine. On your desktop you should then see a window with a title of the form “label – File Browser,” where “label” is the label the manufacturer used when the drive was formatted.

You should also see an icon containing the drive label near the top of the window and also within a list of devices on the left side of the window. Or, If you want to access the drive from a command line in a terminal window, you can type

$ ls /media

and you should see an entry with the drive’s label. For example, I’m using a Kingston DataTraveler I 2GB Flash Drive (USB2.0 Portable) Model DTI/2GB – Retail that I recently purchased from newegg. It has the label “KINGSTON,” so I can list the files on it with

$ ls /media/KINGSTON

If you just want to read files from the drive then you can just pull the drive from the slot when you are done. If you want to write files to the drive you need to unmount the drive when you are done. You can do this either by right-clicking on the drive’s icon in the list on the left side of the window and selecting “Unmount,” or you can use the command line; for example,

$ sudo umount /media/KINGSTON

This is of course very straightforward, and I expect you’re asking, “Why blog about this? Duh!”

Thing is, nothing happened the first time I tried this by just plugging the drive into a USB slot. After a little investigation, I decided to see what happened if I just plugged the drive into a USB slot on one of my other Ubuntu machines, and found that it worked.

Which is why I just inserted the word “working” into the first sentence of this post.

Which means I can give you an answer to another question about Ubuntu:

Question: How do you tell if a USB port is working on your Ubuntu machine?

Answer: Plug a USB flash drive into a USB slot. If nothing happens the slot is broken or isn’t connected.

In my case, it’s more likely — since I built this machine –that I didn’t properly connect the wires from the front USB slots to the motherboard.

Back to the drawing mother board…

  • Pages

  • May 2022
    M T W T F S S
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    3031  
  • RSS The Wayward Word Press

  • Recent Comments

    daveshields on SPITBOL for OSX is now av…
    Russ Urquhart on SPITBOL for OSX is now av…
    Sahana’s Respo… on A brief history of Sahana by S…
    Sahana’s Respo… on A brief history of Sahana by S…
    James Murray on On being the maintainer, sole…
  • Archives

  • Blog Stats

  • Top Posts

  • Top Rated

  • Recent Posts

  • Archives

  • Top Rated