Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
09-25-2008, 12:59 PM
|
#1
|
LQ Newbie
Registered: Aug 2005
Location: The Desert
Distribution: Ubuntu
Posts: 29
Rep:
|
Mount USB drive from command line
Okay, first of all I need to do this by the command line as GNOME is not starting right now. This is because a file is missing...which happens to be on my USB thumb drive.
When GNOME was starting the thumb drive would automatically mount, but I have no idea if it is mounting when GNOME is not running. I plug the drive in and get the following message:
[ 100.446637] sd 6:0:0:0: [sdf] Assuming drive cache: write through
[ 100.449383] sd 6:0:0:0: [sdf] Assuming drive cache: write through
The fact that the message comes up after I plug in my drive leads me to believe that the drive is still being mounted. It also makes sense that a graphical environment wouldn't affect automounting.
If the USB drive is automatically mounted, I don't know what it is called and haven't been able to find it. Help?!
|
|
|
09-25-2008, 01:02 PM
|
#2
|
Member
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS7
Posts: 267
Rep:
|
See output of cat /etc/mtab to find mounted devices.
Dave
|
|
|
09-25-2008, 01:10 PM
|
#3
|
LQ Newbie
Registered: Aug 2005
Location: The Desert
Distribution: Ubuntu
Posts: 29
Original Poster
Rep:
|
The computer in question is not connected to a network and I have no way to connect it to a network, so I can't copy and paste the results. But I have run
cat /etc/mtab
and I didn't see anything that looked like it pertained to the USB drive (in particular I was looking for anything with the sdf prefix).
So in my opinion it looks as though the USB drive is not mounted. How would I go about finding it and mounting it?
|
|
|
09-25-2008, 01:25 PM
|
#4
|
Member
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS7
Posts: 267
Rep:
|
Try a quick df to see if it's there. Your first note kind of suggested it is /dev/sdf and you may find it there. You may try mounting it via the mount command assuming it is /dev/sdf and see if is.
Dave
|
|
|
09-25-2008, 01:31 PM
|
#5
|
LQ Newbie
Registered: Aug 2005
Location: The Desert
Distribution: Ubuntu
Posts: 29
Original Poster
Rep:
|
Quote:
Originally Posted by david1941
Try a quick df to see if it's there. Your first note kind of suggested it is /dev/sdf and you may find it there. You may try mounting it via the mount command assuming it is /dev/sdf and see if is.
Dave
|
First of all, what do you mean by a quick df? Typing a command 'df'? Sorry for the questions but it's been a long time since I worked with Linux in any form.
EDIT: Okay, I tried 'df' as you suggested but I didn't see anything listed that looked like it would be the USB drive.
I have tried to mount /dev/sdf with the following command:
sudo mount -t usbfs /dev/sdf /media/usb
When I do, after I cd to /media/usb, I don't see my files. I do, however, see the following:
001 002 003 004 005 devices
EDIT: Sorry, I should mention that all the numbers were colored blue and 'devices' was the same color as the prompt.
I don't know if that might be relevant or not but I'll include it here in hopes it could help.
Last edited by rcrummett; 09-25-2008 at 01:38 PM.
Reason: clarification
|
|
|
09-25-2008, 01:48 PM
|
#6
|
Senior Member
Registered: Apr 2004
Distribution: slack what ever
Posts: 1,076
|
the command would be mount /dev/sd?1 /somedirectory
the sd?1 will depend on what the other drives are
the /somedirectory will depend on where you want to mount it
try "mkdir /flash ^M" "mount /dev/sda1 /flash ^M" if you don't get an already mounted error do a ls /flash (^M is enter)
if you do get an error try sdb1,sdc1 etc etc it will be an sdsomething1
you can leave the -t option out all newer kernels can mount a fat32 file system on there own
Last edited by rob.rice; 09-25-2008 at 01:51 PM.
|
|
|
09-25-2008, 03:27 PM
|
#7
|
Member
Registered: Mar 2008
Location: New York
Distribution: Debian
Posts: 809
Rep:
|
so you need to copy a file from the USB to your HD? If I were you I would download a live linux CD like OpenSuse or Knoppix and try to copy the file from the usb to your hd. it might work.
|
|
|
09-25-2008, 04:35 PM
|
#8
|
Senior Member
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Rep:
|
Ok,*step by step:
1: Plug in your USB drive
2:
Code:
dave@dave-laptop:~$ dmesg|tail
[ 396.133702] sd 5:0:0:0: [sdb] Assuming drive cache: write through
[ 396.133708] sdb: sdb1
[ 396.135373] sd 5:0:0:0: [sdb] Attached SCSI removable disk
[ 396.135479] sd 5:0:0:0: Attached scsi generic sg2 type 0
[ 2384.114940] usb 7-1: USB disconnect, address 4
[ 4065.246717] usb 7-1: new high speed USB device using ehci_hcd and address 5
[ 4065.309711] usb 7-1: configuration #1 chosen from 1 choice
[ 4065.310192] scsi6 : SCSI emulation for USB Mass Storage devices
[ 4065.312712] usb-storage: device found at 5
[ 4065.312720] usb-storage: waiting for device to settle before scanning
dave@dave-laptop:~$ dmesg|tail
[ 4066.925675] sd 6:0:0:0: [sdb] Write Protect is off
[ 4066.925683] sd 6:0:0:0: [sdb] Mode Sense: 45 00 00 08
[ 4066.925688] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[ 4066.928273] sd 6:0:0:0: [sdb] 3940479 512-byte hardware sectors (2018 MB)
[ 4066.929043] sd 6:0:0:0: [sdb] Write Protect is off
[ 4066.929050] sd 6:0:0:0: [sdb] Mode Sense: 45 00 00 08
[ 4066.929055] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[ 4066.929063] sdb: sdb1
[ 4066.930879] sd 6:0:0:0: [sdb] Attached SCSI removable disk
[ 4066.930963] sd 6:0:0:0: Attached scsi generic sg2 type 0
3:
You can see in my case that on the third last line I have
Code:
[ 4066.929063] sdb: sdb1
So I know that the first partition of my usb drive is sdb1
4:
Issue the commands:
Code:
dave@dave-laptop:~$ cd /mnt/
dave@dave-laptop:/mnt$ ls
dave@dave-laptop:/mnt$ sudo mkdir usb
[sudo] password for dave:
dave@dave-laptop:/mnt$ ls
usb/
dave@dave-laptop:/mnt$ sudo mount -t vfat /dev/sdb1 /mnt/usb/
dave@dave-laptop:/mnt$ cd usb
dave@dave-laptop:/mnt/usb$ ls
chem_4_kids.sh PDF Lists Groups
IT Room Layout.xls
Junior Cert Science
So you can see, the USB drive is mounted on /mnt/usb/
To unmount it:
Code:
dave@dave-laptop:/mnt$ sudo umount /mnt/usb/
dave@dave-laptop:/mnt$ cd usb/
dave@dave-laptop:/mnt/usb$ ls
dave@dave-laptop:/mnt/usb$
Hope that helps you....
|
|
|
09-25-2008, 04:37 PM
|
#9
|
Senior Member
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Rep:
|
Note, on my last post, I am using ubuntu, hence 'sudo' is required. If you can login as root, all you need to do is drop sudo wherever I have it.
|
|
|
09-25-2008, 04:37 PM
|
#10
|
LQ Newbie
Registered: Aug 2005
Location: The Desert
Distribution: Ubuntu
Posts: 29
Original Poster
Rep:
|
Quote:
Originally Posted by ceantuco
so you need to copy a file from the USB to your HD? If I were you I would download a live linux CD like OpenSuse or Knoppix and try to copy the file from the usb to your hd. it might work.
|
Interesting idea. Haven't worked with the live CDs before; do I have access to the Linux partition on my hard drive from a live CD? I'm all for that, assuming I can find a copy.
|
|
|
09-25-2008, 05:16 PM
|
#11
|
LQ Newbie
Registered: Aug 2005
Location: The Desert
Distribution: Ubuntu
Posts: 29
Original Poster
Rep:
|
irishbitte -
IT WORKED!
I was trying to mount the USB drive using usbfs instead of vfat. Changing this took care of EVERYTHING; I was able to install the packages I needed to and GNOME is running again.
Thank you all for your help!
|
|
|
All times are GMT -5. The time now is 01:28 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|