flash drive

Asked by Sylvia Collins

How do I move files from a flash drive? It's not showing up. I'm using Ubuntu 9.10. It's day 2, I'm catching on s l o w l y.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu nautilus Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jeff Lane  (bladernr) said :
#1

Assuming you're running Ubuntu 9.10, and not Kubuntu (can't help with that weird KDE interface, sorry) plug the drive in, give it a second, and click on Places at the top left hand corner of your desktop. You'll see listings for various directories, and provided your drive is seen and handled successfully, you'll see it listed somewhere underneath the entry for "Computer"

Just click on the listing for your drive and the file manager will open. You can open another file manager window from that list for your home directory or whatever, and then it should be just drag and drop.

You can do it the more Linux-like way ;-) from the command line too!

Plug in your drive and give it a couple seconds to be recognized and mounted. Open a terminal (the terminal menu item is found under Applications / Accessories. Then type the word mount and hit enter. You'll see a list like this:

bladernr@klaatu:~$ mount
/dev/sda5 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/bladernr/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=bladernr)
/dev/sdb1 on /media/ADAA-824B type vfat (rw,nosuid,nodev,uhelper=devkit,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,flush)

The last entry is my USB drive, mounted to /media/ADAA-824B.

Once you see the drive in the output from mount, you can copy files like this:

cp /media/DRIVENAME/filename /home/USERNAME/wherever

be sure to subsitute DRIVENAME for the mount location for your USB drive, and USERNAME for your username.
Of course, if you're not used to CLIs, that can get to be a bit confusing... but it's a learning experience. Take it slowly... nothing to worry about at all.

There's a LOT you can do quickly once you know your way around the shell.

Revision history for this message
Sylvia Collins (sacisme) said :
#2

It's just not showing up with the other drives, that was the original problem. Soooo I attempted the command line dealy and I'm pretty sure I had an aneurysm. It's not life or death and I'm sure, eventually, I'll figure it out. It was super cool of you to take the time to try to help. It's not out of my realm to figure this out, I'm old, when I first started everything I did was from a DOS prompt so providing I don't have an actual aneurysm, I'll get this too. Thanks again. I could be full of crap too, it took me 3 hours to figure out how to put a launcher on the desktop and change it's icon. Pray for me!

Revision history for this message
Jeff Lane  (bladernr) said :
#3

You could try this (This is where the CLI comes in handy):

Open a terminal and use this command:

tail -f /var/log/messages

and hit enter. This will show you the last few lines of the messages file, and keeps monitoring. So every time something gets written to that file, you'll see it in your terminal in real time.

Now that you have that running, plug your drive in and see what happens.

This is what shows up in messages for me when I plug a drive in:

Mar 12 23:28:36 klaatu kernel: [135153.321075] usb 2-1.2: new high speed USB device using ehci_hcd and address 8
Mar 12 23:28:36 klaatu kernel: [135153.433316] usb 2-1.2: configuration #1 chosen from 1 choice
Mar 12 23:28:36 klaatu kernel: [135153.433656] scsi11 : SCSI emulation for USB Mass Storage devices
Mar 12 23:28:41 klaatu kernel: [135158.425548] scsi 11:0:0:0: Direct-Access Kingston DataTraveler 2.0 PMAP PQ: 0 ANSI: 0 CCS
Mar 12 23:28:41 klaatu kernel: [135158.425939] sd 11:0:0:0: Attached scsi generic sg2 type 0
Mar 12 23:28:43 klaatu kernel: [135159.529687] sd 11:0:0:0: [sdb] 7936000 512-byte logical blocks: (4.06 GB/3.78 GiB)
Mar 12 23:28:43 klaatu kernel: [135159.530177] sd 11:0:0:0: [sdb] Write Protect is off
Mar 12 23:28:43 klaatu kernel: [135159.532807] sdb: sdb1
Mar 12 23:28:43 klaatu kernel: [135159.582009] sd 11:0:0:0: [sdb] Attached SCSI removable disk

The first two lines show the kernel noticing the USB device. The next two show where the device is ID as a USB storage device and shows it's a Direct-Access Kingston DataTraveler 2.0.

The next line showsthat my device is attached scsi generic sg2 (meaning it's an attached SCSI style storage device)
The next two lines (that have [sdb] in them) show the size and write protect status of my drive.
The next line that says sdb: sdb1 show that this is now registerd as drive sdb and has one partition, sdb1
Finally, we see the line that says Attached SCSI removable disk

that tells us that the drive is attached and ready to go.

Now, you can ctrl-c in the terminal to end the tail -f command from earlier.

Once you do that, you can do this:

bladernr@klaatu:~$ sudo fdisk -l
[sudo] password for bladernr:

This runs the fdisk command and tells it to list partition info for all attached drives. sudo will ask for your password, so enter it.

This first bit is for my onboard Hard disk... it's 500GB SATA disk as you can see below:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x89c0dd3d

These are all the partitions on my onboard sata drive

   Device Boot Start End Blocks Id System
/dev/sda1 1 5 40131 de Dell Utility
/dev/sda2 * 6 1918 15360000 7 HPFS/NTFS
/dev/sda3 1918 28122 210484858 7 HPFS/NTFS
/dev/sda4 28123 60801 262494067+ 5 Extended
/dev/sda5 28123 59472 251818843+ 83 Linux
/dev/sda6 59473 60801 10675161 82 Linux swap / Solaris

This next stanza shows the info for /dev/sdb (remember sdb in my example above?) sdb is my usb drive.

Disk /dev/sdb: 4063 MB, 4063232000 bytes
125 heads, 62 sectors/track, 1024 cylinders
Units = cylinders of 7750 * 512 = 3968000 bytes
Disk identifier: 0x000e0903

   Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1024 3967969 c W95 FAT32 (LBA)
bladernr@klaatu:~$

It's telling me that my /dev/sdb drive (My usb disk) is 4063MB in size and has one partition that uses the entire disk.

So, we now know that the kernel and USB subsystem works because it saw and attached my drive, and now fdisk will list it's partition information as it does with any other disk.

Next step, see if it's mounted:

Just type the command mount and hit enter
This will show EVERY mounted partition and filesystem currently on the system.
bladernr@klaatu:~$ mount
/dev/sda5 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/bladernr/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=bladernr)
/dev/sdb1 on /media/ADAA-824B type vfat (rw,nosuid,nodev,uhelper=devkit,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,flush)

You'll now notice the last entry for /dev/sdb1. Once my device has been attached, and recognized, it gets automounted to a directory in /media that is generated on the fly as part of the automount process.

So now i know that my drive IS mounted, IS seen by the OS and I know WHERE it's mounted so I can take a look at it:

bladernr@klaatu:~$ ls /media/ADAA-824B/
autorun.inf dists isolinux md5sum.txt pool README.diskdefines
casper install ldlinux.sys pics preseed wubi.exe

And there it is... my disk contains an installable Ubuntu system :-)

So that's all there is too it. There are several steps that you don't necessarily have to do. It just helps to troubleshoot things and see what's happening.

Remember to start wtih the tail -f /var/log/messages command BEFORE you plug the drive in. That way you can see, in real time, the kernel messages that are dumped as the system recognizes and handles a new USB device.

Hope that helps :)

Revision history for this message
peter b (b1pete) said :
#4

Sylvia, I'll try to make it as simple as possible

- if it is a usb interfaced drive, it should be detected and mounted by the os automatically upon insertion in a usb port; ubuntu recognises quit a few file systems
- pls open a terminal and enter command as follows

sudo blkid

then enter your password; some output will be generated; pls copy and paste this output in your reply post; we'll continue after that - either me or somebody else.

Can you help with this problem?

Provide an answer of your own, or ask Sylvia Collins for more information if necessary.

To post a message you must log in.