LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 06-07-2013, 10:38 AM   #1
afb13
LQ Newbie
 
Registered: Jun 2013
Posts: 5

Rep: Reputation: Disabled
Thumbs down Is it my or what. USB drive navigating


OK. I've looked all over the net for this. I have ubuntu running in virtualbox so I can learn linux. My boss wants to me to install some drivers on an HP thin client that runs linux of course with no GUI. So I'm trying to get used to the terminal etc..

I'm trying to navigate to my usb drive. Just simply cd (my usb drive) all over the net I find info about how to mount my drive. Ubuntu mounts my drive for me I don't need to mount it. I've run dmesg and fdisk etc.. and found out that the drive is on sdb. So how to I cd to sdb. I tried from the dev folder, I tried from the media folder.

I just want to cd into the usb drive. Why is linux so insanely difficult to understand? But thats beside the point.
 
Old 06-07-2013, 10:52 AM   #2
afb13
LQ Newbie
 
Registered: Jun 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
oks so I found it in the media folder. Now I'm trying to delete a folder so I can clean up and move my driver into an easy to locate folder. rmdir is not working it says the directory is not empty. Who cares I stil want it removed. rmdir (folder). Now what am I doing wrong?
 
Old 06-07-2013, 11:00 AM   #3
afb13
LQ Newbie
 
Registered: Jun 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
ok so I'm slowly figuring this out. Now I'm getting that I cant access a folder. Says no folder. I've got my case right. cd (foldername). No such file or directory. Now what am I doing wrong?
 
Old 06-07-2013, 11:03 AM   #4
afb13
LQ Newbie
 
Registered: Jun 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Let me give more info. $ cd Linux Drivers. Whats wrong with that command?
 
Old 06-07-2013, 11:08 AM   #5
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
As it tells you in the man page, rmdir normally removes empty directories, as a safety precaution. What you need is
rm -rf /path/to/dir
The parameter -r makes the remove command recursive and -f (force) stops it from asking permission for every file of subdirectory.

Last edited by DavidMcCann; 06-07-2013 at 11:12 AM.
 
Old 06-07-2013, 11:08 AM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Spaces need to be delimited, or the directory name needs to be in quotes
Code:
cd Linux\ Drivers
or
Code:
cd "Linux Drivers"
If you use the shell's built in tab completion it'll delimit it for you, assuming it's the only match for what you've written when you hit tab.
Code:
cd Linux<tab>
 
Old 06-07-2013, 11:10 AM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by afb13 View Post
oks so I found it in the media folder. Now I'm trying to delete a folder so I can clean up and move my driver into an easy to locate folder. rmdir is not working it says the directory is not empty. Who cares I stil want it removed. rmdir (folder). Now what am I doing wrong?

Code:
man rmdir
RMDIR(1)                         User Commands                        RMDIR(1)

NAME
       rmdir - remove empty directories
Simply a case of the wrong tool for the job. You should use "rm -r" if you want to remove a non-empty directory.
 
Old 06-07-2013, 11:12 AM   #8
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
Lots of things! If your current directory was /home/fred, then
cd Downloads
would change it to /home/fred/Downloads, while
cd /etc
would go to /etc. You typed
cd Linux Drivers
so that would look for /Linux inside your current directory and then wonder what to do with the "Drivers" bit.
 
Old 06-07-2013, 11:13 AM   #9
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by afb13 View Post
OK. I've looked all over the net for this. I have ubuntu running in virtualbox so I can learn linux. My boss wants to me to install some drivers on an HP thin client that runs linux of course with no GUI. So I'm trying to get used to the terminal etc..

I'm trying to navigate to my usb drive. Just simply cd (my usb drive) all over the net I find info about how to mount my drive. Ubuntu mounts my drive for me I don't need to mount it. I've run dmesg and fdisk etc.. and found out that the drive is on sdb. So how to I cd to sdb. I tried from the dev folder, I tried from the media folder.

I just want to cd into the usb drive. Why is linux so insanely difficult to understand? But thats beside the point.
It's not difficult to understand, it just gives you access to more than Windows does. It has a learning curve is all, so did Windows way back when you first started using it. That's something a lot of people forget...they spend years/decades learning the ins and outs of Windows and then expect to be able to sit down in front of a Linux box and instantly know how to do everything. You need to learn how to use Linux just like you learned how to use Windows, and that takes some time.

The entries in /dev/ are the raw devices. This is something that Windows hides from you, which is probably why you're confused. Windows only shows you mounted drives, Linux shows you both. If the drive is auto-mounted, you can use "df" to see where it is. If it's not auto-mounted, then you can use fdisk to find the device name, and then use mount to mount it wherever you want: "mount /dev/sdb1 /path/to/mount/location"

Last edited by suicidaleggroll; 06-07-2013 at 11:15 AM.
 
Old 06-07-2013, 11:59 AM   #10
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
to add to the great information above. some basics for dealing with USB devices in Linux. this is generalized, not specific to any distro.

tail -f /var/log/messages can be used AS YOU PLUG the USB device into the system to find its location in the computer:

Code:
[root@centos ~]# tail -f /var/log/messages
Jun  2 03:15:04 centos rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="1385" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Jun  2 20:38:08 centos auditd[1360]: Audit daemon rotating log files
Jun  6 15:45:47 centos rpc.mountd[1820]: authenticated unmount request from 192.168.2.220:846 for /exports (/exports)
Jun  6 15:50:12 centos rpc.mountd[1820]: authenticated mount request from 192.168.2.220:1023 for /exports (/exports)
Jun  6 15:50:25 centos rpc.statd[1454]: SM_NOTIFY from ssma-imac.ssmahome.local while not monitoring any hosts
Jun  6 20:08:31 centos rpc.statd[1454]: SM_NOTIFY from New-Users-MacBook.local while not monitoring any hosts
Jun  7 08:46:59 centos kernel: usb 1-2: new high speed USB device number 2 using ehci_hcd
Jun  7 08:47:00 centos kernel: usb 1-2: New USB device found, idVendor=1b1c, idProduct=0ab1
Jun  7 08:47:00 centos kernel: usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jun  7 08:47:00 centos kernel: usb 1-2: Product: Flash Voyager
Jun  7 08:47:00 centos kernel: usb 1-2: Manufacturer: Corsair
Jun  7 08:47:00 centos kernel: usb 1-2: SerialNumber: 92e646a69e562a
Jun  7 08:47:00 centos kernel: usb 1-2: configuration #1 chosen from 1 choice
Jun  7 08:47:00 centos kernel: Initializing USB Mass Storage driver...
Jun  7 08:47:00 centos kernel: scsi10 : SCSI emulation for USB Mass Storage devices
Jun  7 08:47:00 centos kernel: usbcore: registered new interface driver usb-storage
Jun  7 08:47:00 centos kernel: USB Mass Storage support registered.
Jun  7 08:47:01 centos kernel: scsi 10:0:0:0: Direct-Access     Corsair  Flash Voyager    0.00 PQ: 0 ANSI: 2
Jun  7 08:47:01 centos kernel: sd 10:0:0:0: Attached scsi generic sg3 type 0
Jun  7 08:47:01 centos kernel: sd 10:0:0:0: [sdc] 31588352 512-byte logical blocks: (16.1 GB/15.0 GiB)
Jun  7 08:47:01 centos kernel: sd 10:0:0:0: [sdc] Write Protect is off
Jun  7 08:47:01 centos kernel: sd 10:0:0:0: [sdc] Assuming drive cache: write through
Jun  7 08:47:01 centos kernel: sd 10:0:0:0: [sdc] Assuming drive cache: write through
Jun  7 08:47:01 centos kernel: sdc: sdc1
Jun  7 08:47:01 centos kernel: sd 10:0:0:0: [sdc] Assuming drive cache: write through
Jun  7 08:47:01 centos kernel: sd 10:0:0:0: [sdc] Attached SCSI removable disk
NOTE*** that sdc1 is not the full location, the location is /dev/sdc1 and it is NOT MOUNTED YET on my system.

the combination of df, and mount will allow you to see what is mounted before and after you manually mount the USB drive:

Code:
[root@centos ~]# df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/mapper/vg_centos-lv_root
              ext4     50G  4.7G   43G  11% /
tmpfs        tmpfs    939M     0  939M   0% /dev/shm
/dev/sda1     ext4    485M  117M  343M  26% /boot
/dev/mapper/vg_centos-lv_home
              ext4    1.8T  1.4T  326G  81% /exports/centos
/dev/sdb1     ext4    1.4T  1.1T  190G  86% /exports/NFS_TV_Shows
[root@centos ~]# d /mnt/
total 20
drwxr-xr-x.  6 root root 4096 Apr 28 16:17 ./
dr-xr-xr-x. 27 root root 4096 May  4 03:27 ../
drwxr-xr-x.  2 root root 4096 Apr 28 16:17 cdrom/
drwxr-xr-x.  2 root root 4096 Jan  5 11:00 usb/
drwxr-xr-x.  2 root root 4096 Jan  5 11:27 usb2/
drwxr-xr-x.  3 root root    0 May  4 03:27 win7/
[root@centos ~]# mount -t vfat /dev/sdc1 /mnt/usb
[root@centos ~]# df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/mapper/vg_centos-lv_root
              ext4     50G  4.7G   43G  11% /
tmpfs        tmpfs    939M     0  939M   0% /dev/shm
/dev/sda1     ext4    485M  117M  343M  26% /boot
/dev/mapper/vg_centos-lv_home
              ext4    1.8T  1.4T  326G  81% /exports/centos
/dev/sdb1     ext4    1.4T  1.1T  190G  86% /exports/NFS_TV_Shows
/dev/sdc1     vfat     16G 1008M   15G   7% /mnt/usb
NOTE*** on my system I have d aliased to ls -laF.

now I can cd directly to the USB device at its mount point and view what is on the drive. I can also use pwd to show you exactly were you are located in the system:

Code:
[root@centos ~]# cd /mnt/usb
[root@centos usb]# d
total 28548
drwxr-xr-x. 11 root root     8192 Dec 31  1969 ./
drwxr-xr-x.  6 root root     4096 Apr 28 16:17 ../
-rwxr-xr-x.  1 root root   163840 May 24 11:30 12 Analysis of Functions IP 12-13.doc*
drwxr-xr-x.  5 root root     8192 May 30 11:10 2010-2011/
drwxr-xr-x.  5 root root     8192 May 30 11:11 2011-2012/
drwxr-xr-x.  5 root root     8192 May 30 11:13 2012-2013/
drwxr-xr-x.  5 root root     8192 May 30 11:16 2013-2014/
-rwxr-xr-x.  1 root root   151552 Apr 15 09:04 Copy of Math Department Warehouse OrderForm(2013)-1.xls*
drwxr-xr-x.  4 root root     8192 May 30 11:23 FireFox/
-rwxr-xr-x.  1 root root   160419 Aug 16  2011 Geom EOC calculator list.pdf*
-rwxr-xr-x.  1 root root    15554 Nov  1  2011 gladiator.odt*
-rwxr-xr-x.  1 root root    11691 Jan 24 15:30 homework e-mail.odt*
-rwxr-xr-x.  1 root root    14837 Dec 22  2011 How to be an amazing math student.odt*
-rwxr-xr-x.  1 root root    37888 Jun  1  2011 inventory brunkotl.xls*
-rwxr-xr-x.  1 root root   857600 Dec  7  2011 King-Henry-Story1.ppt*
-rwxr-xr-x.  1 root root  1610240 Sep 16  2010 Master Stategies for PSAT.ppt*
drwxr-xr-x.  2 root root     8192 May 30 11:26 math websites/
-rwxr-xr-x.  1 root root    15659 Dec  6  2011 metric.odt*
-rwxr-xr-x.  1 root root   560007 Dec  7  2011 mini-metrics.pdf*
-rwxr-xr-x.  1 root root 18446936 Jan 24  2011 MSetup_x86.exe*
drwxr-xr-x.  2 root root    24576 May 30 11:16 My Pictures/
-rwxr-xr-x.  1 root root   251904 Sep  1  2011 openhouse geo 2011.ppt*
-rwxr-xr-x.  1 root root   252416 Aug  8  2011 openhouse Geometry.ppt*
-rwxr-xr-x.  1 root root     8626 Apr 30 07:32 passwords.odt*
-rwxr-xr-x.  1 root root    11917 Aug 12  2010 sign-in.odt*
-rwxr-xr-x.  1 root root  6280056 May 17  2011 Silverlight.exe*
-rwxr-xr-x.  1 root root   228352 Sep 16  2010 Summer PSAT-SAT .ppt*
[root@centos usb]# pwd
/mnt/usb
to properly and safely remove the drive from the system i use umount:

Code:
[root@centos usb]# df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/mapper/vg_centos-lv_root
              ext4     50G  4.7G   43G  11% /
tmpfs        tmpfs    939M     0  939M   0% /dev/shm
/dev/sda1     ext4    485M  117M  343M  26% /boot
/dev/mapper/vg_centos-lv_home
              ext4    1.8T  1.4T  326G  81% /exports/centos
/dev/sdb1     ext4    1.4T  1.1T  190G  86% /exports/NFS_TV_Shows
/dev/sdc1     vfat     16G 1008M   15G   7% /mnt/usb
[root@centos usb]# cd
[root@centos ~]# umount /mnt/usb
[root@centos ~]# df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/mapper/vg_centos-lv_root
              ext4     50G  4.7G   43G  11% /
tmpfs        tmpfs    939M     0  939M   0% /dev/shm
/dev/sda1     ext4    485M  117M  343M  26% /boot
/dev/mapper/vg_centos-lv_home
              ext4    1.8T  1.4T  326G  81% /exports/centos
/dev/sdb1     ext4    1.4T  1.1T  190G  86% /exports/NFS_TV_Shows
your other questions have been answered, i hope this helps you get around in your system a bit easier.
 
Old 06-07-2013, 04:14 PM   #11
afb13
LQ Newbie
 
Registered: Jun 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Ya ok. That helps. To clarify I'm on an hp thin client and I guess the man command is left out. But yes that was the info I needed from you guys. Thanks.
 
  


Reply



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
[SOLVED] dd'ing a usb drive image to a larger usb drive? Abscissa256 Linux - General 3 01-03-2012 02:44 AM
Usb drive, how to locate it, how to move folder from Usb drive to usr directory eeguy02 Linux - Newbie 5 02-28-2010 11:23 PM
Installing Debian on USB Hard Drive/USB Jump Drive kushalkoolwal Debian 10 02-26-2009 01:46 PM
USB drive using different partitions (usb key thumb drive) Arodef Linux - Hardware 0 08-04-2004 06:36 PM
navigating to cdrom drive in gnome terminal erico LinuxQuestions.org Member Success Stories 2 08-09-2003 01:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:50 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
Open Source Consulting | Domain Registration