Results 1 to 10 of 11
I have a 160GB Western Digital USB device attached to my server. I would mount it by right clicking on the USB Mass Storage icon and choose "mount." Recently I ...
- 03-15-2009 #1Linux Newbie
- Join Date
- Feb 2007
- Location
- USA
- Posts
- 221
Newbie Confused with Mounting USB Storage Device
I have a 160GB Western Digital USB device attached to my server. I would mount it by right clicking on the USB Mass Storage icon and choose "mount." Recently I have lost my GUI ( I am currently trying to figure out what happened) and only have a command prompt to work with. I have a CRON job that backs up my web root nightly to my USB device. I noticed that the directory /media/WD_USB_2 contains my backed up web root files however I do not see the rest of my directories on the USB drive. I tried to mount my USB device manually as follows.
1. I created a directory called /mnt/usb_wd2.
2. Next I added an entry to etc/fstab like this:
/dev/sda/ /mnt/usb_wd2 auto noauto,user 0 0
When I issue the command "mount /mnt/usb_wd2" I get the following reply
"mount: /dev/sda/ already mounted or /mnt/usb_wd2 busy"
How do I replicate what I was doing with the GUI by right clicking and choosing "mount" at the command prompt?
Thanks.
-MikeSuse Linux Enterprise Server 11
Suse Linux Enterprise Server 10 - SP3
OpenSuse 11.2, KDE 4.3.1
- 03-16-2009 #2Linux User
- Join Date
- Sep 2008
- Location
- UK
- Posts
- 353
The message means that the drive is probably already mounted.
Suse uses /media for mounting removable drives.
Try using a terminal as root and typing:
fdisk -l
to see where it is mounted.
I take it that by 'lost my gui' you mean that you don't have a graphic logon?
- 03-16-2009 #3Linux Guru
- Join Date
- Jan 2009
- Location
- Dover, NH
- Posts
- 1,633
fdisk -l shows what partitions are existing (mounted or not)
typing only mount by itself will show you what's mounted where.
- 03-16-2009 #4Linux Newbie
- Join Date
- Feb 2007
- Location
- USA
- Posts
- 221
Whych,
Yes, by "lost my gui" I mean that my x windows is gone. I tried re-running SAX2 and uninstalling and re-installing X-windows via YAST2 but to no avail. Anyways, my file and web server are still functional. I am taking this in as a good way to learn how to operate Linux via the command line.
-MikeSuse Linux Enterprise Server 11
Suse Linux Enterprise Server 10 - SP3
OpenSuse 11.2, KDE 4.3.1
- 03-16-2009 #5Linux Newbie
- Join Date
- Feb 2007
- Location
- USA
- Posts
- 221
D- Cat,
When I type "mount" here is the output:
/dev/sda2 on / type reiserfs (rw,acl,user_xattr)
proc on /proc type proc (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw, mode=0620,gid=5)
nfsd on /proc/fs/nfsd type nfsd (rw)
My CRON job is baking up my web root to "/media/WD_USB_2" which is my USB storage device. When I had my X-windows functional, I could double click on the USB storage device icon and see my backed up web root files plus all other directories on my USB storage device.
I am not sure how to navigate to my USB storage device via the command line.
When I CD to "/media/WD_USB_2" I only see the directories backed up from my CRON job and do not see the rest of the directories like I saw when I viewed the USB storage device via the GUI.
I need to access some of the files on my USB storage device. How do I get to them?
Thanks.
-MikeSuse Linux Enterprise Server 11
Suse Linux Enterprise Server 10 - SP3
OpenSuse 11.2, KDE 4.3.1
- 03-17-2009 #6Linux Guru
- Join Date
- Jan 2009
- Location
- Dover, NH
- Posts
- 1,633
We still need the output of fdisk -l while the drive is plugged in to ensure the following will work as typed (there may need to be a device or type adjustment, I'm going to assume fat32 on /dev/sdb1), but I'll give it to you as best as I can predict it'll work..
su to root user, then mount as follows:
cd /media
mkdir WD_USB_2
mount -t vfat -o rw,umask=0 /dev/sdb1 /media/WD_USB_2
If fdisk -l reveals a different device, make the adjustment above. Also, if it shows the partition is ntfs, then replace vfat with ntfs-3g .
Good luck!
- 03-17-2009 #7Linux Newbie
- Join Date
- Feb 2007
- Location
- USA
- Posts
- 221
There is already a directory named "/media/WD_USB_2"
However there only 3 files listed there. These are the 3 files that I specified to back up in my CRON job. In actuality there are over 50 directories on my USB drive and non are listed.
Output for "fdisk -l"
Disk /dev/sda: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks ID System
/dev/sda1 1 262 2104483+ 82 Linux swap / Solaris
/dev/sda2 * 263 9726 76019580 83 Linux
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks ID System
/dev/sdb1 1 19457 156288321 c W95 FAT32 (LBA)
I changed directory to /media and then I typed:
mount -t vfat -o rw,unmask=0 /dev/sdb1 /media/WD_USB_2
Output:
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
Next I typed "dmesg | tail" and the output was a bunch of MAC address listings but the last line
read: "FAT: Unrecognized mount option "unmask=0" or missing value."
I am a command line noob so I appreciate any help on what all the output means.
Thanks.
-MikeSuse Linux Enterprise Server 11
Suse Linux Enterprise Server 10 - SP3
OpenSuse 11.2, KDE 4.3.1
- 03-17-2009 #8Linux Guru
- Join Date
- Jan 2009
- Location
- Dover, NH
- Posts
- 1,633
umask, not unmask
Short for User Mask, where user 0 is root.
It makes the drive accessible to all users as if they were the root user.
- 03-19-2009 #9Linux Newbie
- Join Date
- Feb 2007
- Location
- USA
- Posts
- 221
D-Cat,
I can't believe I saw "unmask" instead of "umask" - I am embarrassed!
Anyways, it worked. I am able to see all of my files on my USB storage device when I CD to "WD_USB_2." Thanks!!
From the "fdisk -l" output above , I thought /dev/sdb was my USB device because I know it is a 160GB drive.
Why did I have to mount the USB drive to /dev/sdb1 and not /dev/sdb?
MikeSuse Linux Enterprise Server 11
Suse Linux Enterprise Server 10 - SP3
OpenSuse 11.2, KDE 4.3.1
- 03-19-2009 #10Linux Guru
- Join Date
- Jan 2009
- Location
- Dover, NH
- Posts
- 1,633
You were actually correct that the device was /dev/sdb. However, just like any other hard drive, you need to define a partition table and a format the drive (usually done in the factory for externals).Why did I have to mount the USB drive to /dev/sdb1 and not /dev/sdb?
The partition table allows for 4 primary partitions and several (I never tried to find a limit) virtual partitions within an extended partition. The number after sdb represents the partition number, 1-4 is a primary partition slot. If one of those slots define an extended partition, then the contained partitions will begin at 5 and go up from there.
/dev/sdb1 litterally means the first partition on the second storage device.


Reply With Quote