[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 411
  • Last Modified:

Mounting to usb key problem

Hi Guys, I want to copy somefiles from my usb stick to my linux PC. I used command:
mount /dev/sda1 /mnt/usb
This command works sometimes. When it doesn't work I have to change the sda1 to sdb1 or sdc1 or sdd1 so on. Until I ran out of the 26 alphabet letters. I don't know what to do except for reboot the machine, so that I can restart with letter 'a'. Question: do you know how to avoid this problem?

Thanks,
BB
0
BooBoo1025
Asked:
BooBoo1025
  • 2
  • 2
1 Solution
 
byttaCommented:
A possible problem is that you don't unmount the memory key before you unplug it.

That way  /dev/sda1 is still mounted in mtab, so the next time you plug it in, the key maps to /dev/sdb1, then /dev/sdc1, etc.

so always type umount /mnt/usb before unplugging it...
0
 
BooBoo1025Author Commented:
I did use the command: eject /mnt/usb
I thought it would do the same, does it?
0
 
byttaCommented:
eject /mnt/usb should work, as it _should_ include umount.

Try this combination:
mount /mnt/usb
df
eject /mnt/usb
df

df should show you the usb drive the first time but not the second time.
If it's still there you have located the problem.

eject is used to umount and spit out floppies and CDs, but umount is the opposite of mount so I prefer using that.
0
 
BooBoo1025Author Commented:
Since, I reboot my machine before your respond. Everything seem to work as normal now.
I just tried the combination you suggested (with mount /dev/sda1 /mnt/usb instead) It showed the mount dir and when eject or umount, the mount dir disappear. The only different I see is that with eject, I have to physically unplug the stick before I can mount again. While with umount I don't have too. Anyway, thanks for the help. I will use the umount now to see if that problem occur again. :-)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now