Mounting Pen Drive


Forum: Other Help Topics
Topic: Mounting Pen Drive
started by: adssse

Posted by adssse on May 10 2005,14:11
I know this has been covered. But I have seen multiple ways to do this.

I have been doing it as follows:
sudo mount /dev/sda
&
sudo umount /dev/sda

The problem that I am having is that it mounts fine the first time, but I cannot get it to mount again unless I reboot. I was wondering if I am doing this incorrectly and this is causing the problem. If someone could tell me the proper way of mounting a pen drive I would greatly appreciate it.

Posted by SaidinUnleashed on May 10 2005,14:42
This is possibly because when you are forcing it to mount the disk as root, it changes the permissions of the mount point for some reason.

Just mount and unmount stuff as dsl.

Posted by adssse on May 10 2005,19:54
ok I will try that, but I have also seen some people say that it should be done like this:

mount /dev/sda  /mnt/sda
umount /mnt/sda

I was wondering which is the correct way to do this?

Posted by SaidinUnleashed on May 10 2005,19:59
I just do this

mount /dev/sdaX

umount /mnt/sdaX

since the device and mountpoint are defined in fstab, it will work properly for you.

Posted by adssse on May 10 2005,22:44
alright, thank you for your help
Posted by adssse on May 11 2005,00:27
hmm... I used

mount /dev/sda

this worked fine, than i used

umount /mnt/sda

I then unplugged it and inserted it again. I tried the same as before, but got the following error

mount: can't find /dev/sda in /etc/fstab or /etc/mtab

Like a said it always seems to work the first time but than will not work again until I reboot. Any help would be appreciated.

Posted by ke4nt1 on May 11 2005,00:33
adssse,

On each one of your posts, you are using the syntax

mount /dev/sda
or
umount /dev/sda

but, as shown in Saidin's example, there are partitions to account for
on a pendrive.  You would USUALLY type..

mount /dev/sdaX
or
umount /dev/sdaX

the X = the partition on your drive  .. e.g. sda1 , sda2, etc..

You can check by using the syntax

cfdisk /dev/sda ( no X or number ) ,
which should show you the partition table on the drive.

It IS possible to have no partitions on it, but it is uncommon...

Please check and feedback..

73
ke4nt

Posted by adssse on May 11 2005,03:54
ke4nt1, thanks for your reply. I used

cfdisk /dev/sda

but received the following error:

FATAL ERROR: Cannot open disk drive
Press any key to exit cfdisk

I apologize because I must be missing something. I know the pendrive is good because I have been using it on my windows machine and at school without any problems. I have also tried another drive with dsl with the same results. Is there anything that dsl requires of this pendrive that windows wouldn't?? I am fairly new and I am still trying to learn how to get everything working.

Posted by cbagger01 on May 11 2005,11:16
Try:

sudo cfdisk /dev/sda

Posted by adssse on May 11 2005,13:36
ok, I tried

sudo cfdisk /dev/sda

and got the following error:

ERROR: Bad primary partition 0: Partition begins after end-of-disk
Press any key to exit cfdisk

Posted by adssse on May 12 2005,13:34
anyone have any idea what I am doing wrong or what I can try? any help would be appreciated
Posted by jls legalize on May 12 2005,19:10
u can try qtparted in the repository, but first load gtk also in the repository.
Posted by adssse on May 13 2005,03:32
still not working, but I have been researching and trying some things.  When I run 'lsusb' it shows the following:
Bus 003 Device 001: ID 0000:0000
Bus 003 Device 002: ID 0ea0:2168 Ours Technology, Inc.
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000

And when I enter   'dmesg | grep -i "SCSI device" '    I get
SCSI device sda: 512000 512-byte hdwr sectors (262 MB)

using 'cfdisk /dev/sda'  still gives me the fatal error mentioned in my last post.

I used 'mount /dev/sda  /mnt/sda' because it said sda in the previous part and it mounted fine. I then used 'umount /mnt/sda' to unmount. I mounted and unmounted in the same fashion without unplugging the usb drive. During this time the small light on my usb drive was blinking green. I than unplugged it and tried the same thing again. This time the light stayed solid and when I tried to mount it gave me the following message
'mount: /dev/sda is not a valid block device'
so it seems like as soon as I unplug it, plug it back in and try again it gives me the preceeding message.  I also tried sda1 instead and it also gave me the same mount error.

Also when I used 'dmesg | grep -i "SCSI device" ' again after unplugging and reinserting I received 2 lines instead of one like before:
SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
SCSI device sda: 512000 512-byte hdwr sectors (262 MB)

I am not really familier with linux to know how to use many commands but I thought if I shared this new information someone may be able to help.

Posted by adssse on May 13 2005,13:34
Someone suggested to me to try the following so I will post these results also in hopes that someone can make sense of this. I ran them once each with the drive not plugged in and once each with the drive connected.
Here are my results:
cat /proc/partitions (without usb drive plugged in):
major     minor     #blocks     name
   8          0         256000      sda
   8          1       84344761     sda1
   8          2      934940732     sda2
   8          4     1717556736    sda4
   3          0          2062368     hda
   3          1            249952     hda1
   3          2          1812384     hda2

ls /mnt (without usb plugged in):
auto  floppy  hda   sda   sda2   sdb1
cdrom   hd    hda2   sda1   sda4

cat /proc/partitions (with usb drive plugged in):
major     minor     #blocks     name
   8          0         256000      sda
   8          1       84344761     sda1
   8          2      934940732     sda2
   8          4     1717556736    sda4
   3          0          2062368     hda
   3          1            249952     hda1
   3          2          1812384     hda2

ls /mnt (with usb plugged in):
auto  floppy  hda   sda   sda2   sdb1
cdrom   hd    hda2   sda1   sda4

so it shows the same whether the drive is plugged in or not, even though 'lsusb' see's it. I am not sure what this means. All of the folders set up under /mnt were done by the system so I am not sure why there are so many. I also noticed that under /mnt/auto there is just 'floppy' & 'cdrom'. I would appreciate the help because all of this is still confusing to me.

Posted by cbagger01 on May 13 2005,22:12
It sounds to me like your USB drive is formatted like a "Superfloppy" with no partition table.  This is why you can access it as /dev/sda instead of /dev/sda1

If your device was formatted like most USB thumbdrives, it would have a partition table and a /dev/sda1 for access.

You can either continue to use your drive as a /dev/sda device,

or you can reformat it and create a /dev/sda1 device.

You can do this either in DSL, with dosfstools extension, or you can plug it into a Windows computer and format it from Windows Explorer as FAT or FAT32 format type.

Posted by adssse on May 14 2005,04:25
I plugged it into my windows machine and formated it in FAT32 (it was in FAT), but it did not seem to make a difference. It still shows up as sda. I decided to use some of the commands on another spare usb drive I had laying around and the results seem wierd to me.

These results are for the drive I have been using.
lsusb
Bus 003 Device 001: ID 0000:0000
Bus 003 Device 002: ID 0ea0:2168 Ours Technology, Inc.
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000

dmesg | grep -i "SCSI device"
SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
SCSI device sda: 512000 512-byte hdwr sectors (262 MB)


These results are for the spare drive I tried.
lsusb
Bus 003 Device 001: ID 0000:0000
Bus 003 Device 008: ID 0ea0:6803 Ours Technology, Inc.
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000

dmesg | grep -i "SCSI device"
SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
SCSI device sdb: 129024 512-byte hdwr sectors (66 MB)

It seems wierd to me that the only thing that changed when using lsusb was the device number and the number after the colon. Shouldnt the message "Ours Technology, Inc." change? Also when using   dmesg | grep -i "SCSI device"    the old references to the other usb drive are still there and the new one is sdb. I am completely confused by this. I take it that if no one else is having trouble with this than I must have messed something up. Should I format, reinstall and see if I can get it to work than or is there something else I can try.  Also, what difference does it make if I have the usb drive plugged in when I boot up? Thanks again for all of your help, I dont mean to be a nuisance, just trying to learn what I can.

Posted by cbagger01 on May 14 2005,23:23
OK, try this approach then:

Boot up DSL.

Download the dosfstools extension from the "System" section of the MyDSL menu.

Open an xterminal window and type:

sudo su
cfdisk /dev/sda


Then use cfdisk to create a new partition table and create a new partition that is the same size as your available free space.  Then write the new table and exit cfdisk

Then type:

mkdosfs /dev/sda1

and it should format your newly created partition with a DOS (FAT) file system.

Hope this does it.

Posted by adssse on May 15 2005,04:27
Ok, I tried

sudo su
cfdisk /dev/sda

I received two different kinds of errors:

FATAL ERROR: Cannot open disk drive
Press any key to exit cfdisk
(light on drive does not come on)

or

ERROR: Bad primary partition 0: Partition begins after end-of-disk
Press any key to exit cfdisk
(light on drive blinks)

Posted by cbagger01 on May 16 2005,17:13
So it doesn't give you the choice to create a new partition table after the second error message?

If not, maybe it is possible to create a new table with another program like fdisk.

Will need to do some research on this one...

Posted by adssse on May 17 2005,04:17
Nope, it doesnt give me any choices. I even did a fresh install and got the same results. I guess it doesnt like some of my hardware.
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.