LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 12-13-2012, 05:45 AM   #1
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 576

Rep: Reputation: 48
Mounting a USB Pen Drive


Hi,


I want to mount a USB Drive (Kingston) which is being detected by the Host OS Windows 7 on which I am running CentOS 6 using VirtualBox.

Which one of the following device files should I specify as a source device to be mounted?

Code:
[root@devhost dev]# ls
autofs           dri        log    lp3                 ppp    ram3    scd0      sr0     tty14  tty25  tty36  tty47  tty58  ttyS2      vcs4
block            dvd        loop0  MAKEDEV             ptmx   ram4    sda       stderr  tty15  tty26  tty37  tty48  tty59  ttyS3      vcs5
bsg              fb         loop1  mapper              pts    ram5    sda1      stdin   tty16  tty27  tty38  tty49  tty6   uinput     vcs6
bus              fb0        loop2  mcelog              ram0   ram6    sda2      stdout  tty17  tty28  tty39  tty5   tty60  urandom    vcsa
cdrom            fd         loop3  mem                 ram1   ram7    sda3      systty  tty18  tty29  tty4   tty50  tty61  usbmon0    vcsa1
char             full       loop4  net                 ram10  ram8    sda4      tty     tty19  tty3   tty40  tty51  tty62  usbmon1    vcsa2
console          fuse       loop5  network_latency     ram11  ram9    sda5      tty0    tty2   tty30  tty41  tty52  tty63  vboxguest  vcsa3
core             hpet       loop6  network_throughput  ram12  random  sg0       tty1    tty20  tty31  tty42  tty53  tty7   vboxuser   vcsa4
cpu              hugepages  loop7  null                ram13  raw     sg1       tty10   tty21  tty32  tty43  tty54  tty8   vcs        vcsa5
cpu_dma_latency  hvc0       lp0    nvram               ram14  root    shm       tty11   tty22  tty33  tty44  tty55  tty9   vcs1       vcsa6
crash            input      lp1    oldmem              ram15  rtc     snapshot  tty12   tty23  tty34  tty45  tty56  ttyS0  vcs2       vga_arbiter
disk             kmsg       lp2    port                ram2   rtc0    snd       tty13   tty24  tty35  tty46  tty57  ttyS1  vcs3       zero
Could you please also suggest what File System Type is to be used for this type of device? Is it vfat?

I am doing this which does not seem to be correct:

Code:
[root@devhost ~]# mkdir /work-usb

[root@devhost ~]# mount -t usbfs -o auto /dev/usbmon0 /work-usb/

[root@devhost ~]# ls -l /work-usb/
total 0
dr-xr-xr-x. 2 root root 0 Dec 13 14:56 001
-r--r--r--. 1 root root 0 Dec 13 14:56 devices
[root@devhost ~]# ls -l /work-usb/001/
total 0
-rw-r--r--. 1 root root 43 Dec 13 14:56 001
[root@devhost ~]#
 
Old 12-13-2012, 05:53 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 979
Blog Entries: 2

Rep: Reputation: 235Reputation: 235Reputation: 235
Might be sdb or sdb1 (if your root is on sda1) and probably vfat. You have MAKEDEV.
 
Old 12-13-2012, 05:58 AM   #3
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 576

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by linosaurusroot View Post
Might be sdb or sdb1 (if your root is on sda1) and probably vfat. You have MAKEDEV.
Since, sdb* is not there in /dev/ so I did this:

Code:
[root@devhost ~]# /dev/MAKEDEV /dev/sdb
[root@devhost ~]# mount -t vfat /dev/sdb /work-usb/
mount: /dev/sdb is not a valid block device
 
Old 12-13-2012, 06:04 AM   #4
redfox2807
Member
 
Registered: Jul 2012
Distribution: Debian testing/stable, Sailfish OS, Android
Posts: 119

Rep: Reputation: 16
Just in case: are you aware that in order the guest OS to see a USB device, you have to check it in the menu (menu->Devices->USB Devices->Your_device)? The host OS looses it as soon as you enable it in the VirtualBox for the guest OS. The flash drive might be sdb or sdb1 indeed, but it ain't in your list.
 
Old 12-13-2012, 06:11 AM   #5
bala.linuxtech
Member
 
Registered: Nov 2012
Location: Bangalore
Distribution: RHEL and Centos
Posts: 80

Rep: Reputation: Disabled
Quote:
Originally Posted by devUnix View Post
Hi,


I want to mount a USB Drive (Kingston) which is being detected by the Host OS Windows 7 on which I am running CentOS 6 using VirtualBox.

Which one of the following device files should I specify as a source device to be mounted?

Code:
[root@devhost dev]# ls
autofs           dri        log    lp3                 ppp    ram3    scd0      sr0     tty14  tty25  tty36  tty47  tty58  ttyS2      vcs4
block            dvd        loop0  MAKEDEV             ptmx   ram4    sda       stderr  tty15  tty26  tty37  tty48  tty59  ttyS3      vcs5
bsg              fb         loop1  mapper              pts    ram5    sda1      stdin   tty16  tty27  tty38  tty49  tty6   uinput     vcs6
bus              fb0        loop2  mcelog              ram0   ram6    sda2      stdout  tty17  tty28  tty39  tty5   tty60  urandom    vcsa
cdrom            fd         loop3  mem                 ram1   ram7    sda3      systty  tty18  tty29  tty4   tty50  tty61  usbmon0    vcsa1
char             full       loop4  net                 ram10  ram8    sda4      tty     tty19  tty3   tty40  tty51  tty62  usbmon1    vcsa2
console          fuse       loop5  network_latency     ram11  ram9    sda5      tty0    tty2   tty30  tty41  tty52  tty63  vboxguest  vcsa3
core             hpet       loop6  network_throughput  ram12  random  sg0       tty1    tty20  tty31  tty42  tty53  tty7   vboxuser   vcsa4
cpu              hugepages  loop7  null                ram13  raw     sg1       tty10   tty21  tty32  tty43  tty54  tty8   vcs        vcsa5
cpu_dma_latency  hvc0       lp0    nvram               ram14  root    shm       tty11   tty22  tty33  tty44  tty55  tty9   vcs1       vcsa6
crash            input      lp1    oldmem              ram15  rtc     snapshot  tty12   tty23  tty34  tty45  tty56  ttyS0  vcs2       vga_arbiter
disk             kmsg       lp2    port                ram2   rtc0    snd       tty13   tty24  tty35  tty46  tty57  ttyS1  vcs3       zero
Could you please also suggest what File System Type is to be used for this type of device? Is it vfat?

I am doing this which does not seem to be correct:

Code:
[root@devhost ~]# mkdir /work-usb

[root@devhost ~]# mount -t usbfs -o auto /dev/usbmon0 /work-usb/

[root@devhost ~]# ls -l /work-usb/
total 0
dr-xr-xr-x. 2 root root 0 Dec 13 14:56 001
-r--r--r--. 1 root root 0 Dec 13 14:56 devices
[root@devhost ~]# ls -l /work-usb/001/
total 0
-rw-r--r--. 1 root root 43 Dec 13 14:56 001
[root@devhost ~]#

Hi

Have you Enabled your usb Device on VM ??

First , Check your usb device settings,
I sure , If that settings is correct , the usb will comes under /dev/sdb or /dev/sdc

All the best !
Regards
Bala.Linuxtech
 
Old 12-13-2012, 06:32 AM   #6
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 576

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by bala.linuxtech View Post
Hi

Have you Enabled your usb Device on VM ??

First , Check your usb device settings,
I sure , If that settings is correct , the usb will comes under /dev/sdb or /dev/sdc

All the best !
Regards
Bala.Linuxtech
Yes, it is enabled. I have also specified the Kingston USB device on the settings page in the VirtualBox. I restarted the VM and did not see /dev/sdb* there.
 
Old 12-13-2012, 06:49 AM   #7
redfox2807
Member
 
Registered: Jul 2012
Distribution: Debian testing/stable, Sailfish OS, Android
Posts: 119

Rep: Reputation: 16
Please post the output of
Code:
ls /dev/ | grep sd
here with the flash drive checked in the menu.
 
Old 12-13-2012, 06:50 AM   #8
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,018

Rep: Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622
Have you unmounted the device in Windows also? If not Windows will hang on to it and it won't be visible to Linux, in my experience at least.
 
Old 12-13-2012, 07:11 AM   #9
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 576

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by redfox2807 View Post
Please post the output of
Code:
ls /dev/ | grep sd
here with the flash drive checked in the menu.
Okay, here goes it...

Code:
[root@devhost ~]# ls /dev/ | grep sd
sda
sda1
sda2
sda3
sda4
sda5
[root@devhost ~]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0008cf59

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        1594    12288000   83  Linux
/dev/sda3            1594        2359     6144000   82  Linux swap / Solaris
/dev/sda4            2359        2611     2026496    5  Extended
/dev/sda5            2359        2423      512000   83  Linux
[root@devhost ~]#


---------- Post added 12-13-12 at 17:42 ----------

Quote:
Originally Posted by 273 View Post
Have you unmounted the device in Windows also? If not Windows will hang on to it and it won't be visible to Linux, in my experience at least.
Well, I just did that also. But no luck!
 
Old 12-13-2012, 07:20 AM   #10
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,018

Rep: Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622
Does nothing show up in the /dev/ listing after unmounting it in Windows?
Personally I would follow a sequence like this:
Untick the device in Virtualbox.
Run "fdisk -l" and make a note of what is there.
"Unmount" the device in Windows.
Tick the device in Virtualbox.
Run "fdisk -l" and see whether it shows up.
If not, replug the device and start again.

If you've done that and it still doesn't work I'd be looking at things like whether VirtualBox has the binary blob for USB installed, which file system the drive has and whether there's anything strange about the drive like a special "fake CD" partition.
 
1 members found this post helpful.
Old 12-13-2012, 07:28 AM   #11
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 576

Original Poster
Rep: Reputation: 48
Well, this time I changed the USB port and used some other one. I see the /dev/sdb and /dev/sdb1 device files now:

Code:
[root@devhost ~]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0008cf59

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        1594    12288000   83  Linux
/dev/sda3            1594        2359     6144000   82  Linux swap / Solaris
/dev/sda4            2359        2611     2026496    5  Extended
/dev/sda5            2359        2423      512000   83  Linux

Disk /dev/sdb: 31.0 GB, 31024349184 bytes
32 heads, 63 sectors/track, 30056 cylinders
Units = cylinders of 2016 * 512 = 1032192 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x739055b7

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       30056    30296416+   c  W95 FAT32 (LBA)
[root@devhost ~]# mount /dev/sdb
sdb   sdb1  
[root@devhost ~]# mount /dev/sdb
sdb   sdb1  
[root@devhost ~]# mount /dev/sdb1 /mnt
[root@devhost ~]# cd /mnt
[root@devhost mnt]# ls
Thanks for your help!
 
Old 12-13-2012, 07:29 AM   #12
redfox2807
Member
 
Registered: Jul 2012
Distribution: Debian testing/stable, Sailfish OS, Android
Posts: 119

Rep: Reputation: 16
They you're doing something wrong. try
Code:
dmesg | tail
as root after you've checked the drive in the menu.
It should contain something like
Code:
[ 2653.532482] sd 5:0:0:0: [sdb] Write Protect is off
[ 2653.532513] sd 5:0:0:0: [sdb] Mode Sense: 23 00 00 00
[ 2653.542958] sd 5:0:0:0: [sdb] No Caching mode page present
[ 2653.546727] sd 5:0:0:0: [sdb] Assuming drive cache: write through
[ 2653.602474] sd 5:0:0:0: [sdb] No Caching mode page present
[ 2653.602543] sd 5:0:0:0: [sdb] Assuming drive cache: write through
[ 2653.610849]  sdb: sdb1
[ 2653.664355] sd 5:0:0:0: [sdb] No Caching mode page present
[ 2653.664356] sd 5:0:0:0: [sdb] Assuming drive cache: write through
[ 2653.664356] sd 5:0:0:0: [sdb] Attached SCSI removable disk
 
Old 12-13-2012, 07:29 AM   #13
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 576

Original Poster
Rep: Reputation: 48
Thumbs up

Quote:
Originally Posted by 273 View Post
Does nothing show up in the /dev/ listing after unmounting it in Windows?
Personally I would follow a sequence like this:
Untick the device in Virtualbox.
Run "fdisk -l" and make a note of what is there.
"Unmount" the device in Windows.
Tick the device in Virtualbox.
Run "fdisk -l" and see whether it shows up.
If not, replug the device and start again.

If you've done that and it still doesn't work I'd be looking at things like whether VirtualBox has the binary blob for USB installed, which file system the drive has and whether there's anything strange about the drive like a special "fake CD" partition.


So, I noted your last point with respect to the USB installed. Thanks a lot!
 
Old 12-13-2012, 09:46 AM   #14
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,018

Rep: Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622
Quote:
Originally Posted by devUnix View Post
So, I noted your last point with respect to the USB installed. Thanks a lot!
You're welcome.
Sometimes you have to start again and do everything in the correct order.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mounting usb pen drive warun Slackware 3 10-15-2007 01:49 PM
mounting a usb pen drive syedtariq Linux - Newbie 3 02-27-2007 01:20 PM
problem mounting USB pen drive Gogul VectorLinux 2 04-25-2006 04:42 AM
problem in mounting a USB pen drive santhosh.linux Programming 2 04-21-2006 01:05 AM
USB Pen Drive not mounting Psirus Debian 10 01-11-2006 01:15 AM


All times are GMT -5. The time now is 12:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration