Edgy 6.10 - accessing a USB flash drive with command line

Asked by Linda Poppleton

True to its word, Edgy LAMP server (32 bit) installed on my machine in less than 15 minutes. Now, 24 hours later, I am still trying to figure out how to get any other programs to install. I am just using a command line, and nearly all of the documentation I've found assumes I have a GUI.

In example, I downloaded "webmin" program to a flash drive on my desktop and plugged the USB flashdrive into the server. According to everything I've read, Ubuntu automounts the drive. In my mtab file, I see procbususb /proc/bus/usb usbfs rw 0 0. So I cruised over to /proc/bus/usb to look for my files - but the only thing I can see at /proc/bus/usb are folders called 001, 002, 003, 004, which in turn have folders in them called 001, 002....well, you get the picture.

I added "/dev/sdb /media/usb usbfs noauto, user, rw 0 0" to my fstab file and tried doing a "mount /media/usb". It works, but all I see at /media/usb is the same numbered folders I see at /proc/bus/usb. Is there an good explanation of this somewhere that I missed? Are files created by a windows system on a usb drive inaccessible to ubuntu?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Linda Poppleton
Solved:
Last query:
Last reply:
Revision history for this message
Adrian Stratulat (adrian-stratulat) said :
#1

try the next commands:
sudo mkdir /media/usb/
sudo mount -t vfat /dev/sda1 /media/usb/
cd /media/usb/

(!) /dev/sda1 can be replaced with other usb controllers devices ( sda2, sda3 )

Revision history for this message
Linda Poppleton (ljp2) said :
#2

when I insert the usb drive, I get"
[42956795.730000] sdb: assuming drive cache: write through
[42956795.740000] sdb: assuming drive cache: write through

when I issue the mount command with -t vfat (as instructed above), I get:
[42956800.030000] FAT: invalid media value (0x00)
mount: wrong fs type, bad option , bad superblock on /dev/sdb, missing codepage or other error.

doing an dmesg | tail shows the last message as VFS: Can't find a valid FAT filesystem on the dev sdb. So how can I tell what filesystem is on my usb drive?

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) said :
#3

To find out what type of partition is on your usb drive use fdisk.

sudo fdisk /dev/sdb

Then press "p" to print.

If the device was formatted on windows it's possible the partition is ntfs and not fat. Let mount figure it out by omitting "-t vfat" from the instructions above.

Revision history for this message
Linda Poppleton (ljp2) said :
#4

fdisk /dev/sdb shows:
 "The numer of cylinders for tis disk is set to 3920. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time 2) booting and partitioning software from other OSs. (eg DOS FDISK, OS/2 FDISK)

mount /dev/sdb /media/usb shows:
cramfs: worng magic
VFS: Can't find ext3 filesystem on dev sdb
FAT: invalid media value (0x00)
mount: you must specify the filesystem type

It is a 1GB Attache usb drive and I don't recall ever formatting it.

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) said :
#5

Ahh, well if you have never formatted it then we can do that.

sudo fdisk /dev/sdb
Press p to print the partition table. It may be blank - in which case you have confirmed that it is unformatted.
If you are sure you don't mind losing everything that is on it then you can press 'd' to delete the partitions, and 'n' creates new ones - the first one would likely be partition number 1. By default it will create a new part that is the full size of the device.

Once done you can use 'w' to write to the device and 'q' to quit.

Next you can create a FAT32 partition with

sudo mkfs.vfat /dev/sdb1

Once you've formatted it you can use the mount commands others have mentioned above.

Revision history for this message
Best Linda Poppleton (ljp2) said :
#6

On Windows, "properties" shows this usb device to be FAT formatted. I really did not want to reformat anything so I started poking around in the /dev list. Noticed that before I plugged in the usb, I had sda, sda1, sda2, etc. When I plugged in the usb drive, both sdb and sdb1 were added to the /dev list. I tried the mount (above) using sdb1 instead of sdb and it worked.

Thanks for your assistance!

Revision history for this message
larnoy (do-petti) said :
#7

i try many way but i can't find info in usb on ubuntu server 8.10. how to do ? plz help me