View previous topic :: View next topic |
Author |
Message |
h2sammo Veteran
Joined: 11 Mar 2009 Posts: 1025 Location: Michigan
|
Posted: Wed Oct 14, 2009 12:34 pm Post subject: how do i mount a USB external hard drive? |
|
|
i tried Code: | MW20-PPL2106U01 bobby # mount /dev/sdb1 /mnt/usb
mount: special device /dev/sdb1 does not exist
|
also i tried sda1 but thats my boot device... i dont understand why usb mounting tutorials would have me mount sda1. how can i find out what is the device name of the external hard drive?
iw as able to mount it before with sdb1, and it worked, because i did a shred on it, but not anymore...
please help.
Code: | MW20-PPL2106U01 bobby # lsusb
Bus 004 Device 001: ID 1d6b:0001
Bus 001 Device 005: ID 1058:0704 Western Digital Technologies, Inc.
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0001
Bus 003 Device 001: ID 1d6b:0001 |
Last edited by h2sammo on Wed Oct 14, 2009 3:48 pm; edited 3 times in total |
|
Back to top |
|
|
jw5801 Apprentice
Joined: 12 Jun 2008 Posts: 251 Location: Melbourne, Australia
|
Posted: Wed Oct 14, 2009 12:55 pm Post subject: Re: how do i mount a USB external hard drive? |
|
|
Are you using a desktop environment? If so, you should be able to mount it using that (which will use udev, I think?), in a file browser.
Otherwise (as root) will tell you what partitions you can see, and give you information about them. Then pick the one that corresponds to whatever you're looking for and mount that. |
|
Back to top |
|
|
h2sammo Veteran
Joined: 11 Mar 2009 Posts: 1025 Location: Michigan
|
Posted: Wed Oct 14, 2009 1:28 pm Post subject: |
|
|
thank you, it worked, my device name was sdc
Code: |
MW20-PPL2106U01 bobby # fdisk -l
Disk /dev/sda: 60.0 GB, 60000000000 bytes
255 heads, 63 sectors/track, 7294 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x9dc96e9e
Device Boot Start End Blocks Id System
/dev/sda1 * 1 5 40131 83 Linux
/dev/sda2 6 267 2104515 82 Linux swap / Solaris
/dev/sda3 268 7297 56468475 83 Linux
Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x44fdfe06
Device Boot Start End Blocks Id System
/dev/sdc1 1 60801 488384001 83 Linux
|
|
|
Back to top |
|
|
jw5801 Apprentice
Joined: 12 Jun 2008 Posts: 251 Location: Melbourne, Australia
|
Posted: Wed Oct 14, 2009 1:43 pm Post subject: |
|
|
Happy to help!
You can also do neat things, like give your partition a label (using e2label, I'd recommend unmounting it first), and mount it according to that.
Code: | e2label /dev/sdc1 MyLabel |
Then you can mount that partition whenever it's available via the symlink in /dev/disk/by-label/
Code: | mount /dev/disk/by-label/MyLabel /a/mount/point |
That also means you can put external drives in /etc/fstab easily, without having to worry about the actual device number changing when you unplug it and plug it back in again. For example, my /etc/fstab looks like:
Code: | LABEL=Gentoo / ext3 defaults,noatime,nodiratime 0 1
LABEL=home /home ext3 defaults,noatime,nodiratime 0 2
LABEL=boot /boot ext2 defaults,noauto 0 2 |
For an external I'd definitely use the `noauto' option (options go in the 4th field), and you could also add the `user' option, to allow any user to mount it, just using `mount /mnt/MountPoint', or `mount /dev/disk/by-label/MyLabel'. |
|
Back to top |
|
|
h2sammo Veteran
Joined: 11 Mar 2009 Posts: 1025 Location: Michigan
|
Posted: Wed Oct 14, 2009 2:16 pm Post subject: |
|
|
problem.
i added device to fstab, but i can only access it as root, even though i added the user option in the mount field.
how can i access the device as user?
Quote: |
# <fs> <mountpoint> <type> <opts> <dump/pass>
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda1 /boot ext2 defaults,noatime 1 2
/dev/sda3 / ext3 noatime 0 1
/dev/sda2 none swap sw 0 0
/dev/cdrom /mnt/cdrom auto ro,user,auto,unhide 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0
# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
# use almost no memory if not populated with files)
shm /dev/shm tmpfs nodev,nosuid,noexec 0 0
/dev/sdc1 /mnt/exthdd ext3 ro,user,noauto,unhide 0 0
|
|
|
Back to top |
|
|
jw5801 Apprentice
Joined: 12 Jun 2008 Posts: 251 Location: Melbourne, Australia
|
Posted: Wed Oct 14, 2009 9:28 pm Post subject: |
|
|
h2sammo wrote: | problem.
i added device to fstab, but i can only access it as root, even though i added the user option in the mount field.
how can i access the device as user?
Code: |
/dev/sdc1 /mnt/exthdd ext3 ro,user,noauto,unhide 0 0
|
|
Well, the `unhide' option is only relevant for CD formats, so get rid of that! What exactly is the problem? Do you get an error when you attempt to mount it? If so, can you post the error?
Also, do you really want to mount it as read-only? That would mean noone (not even root!) has write access to it! I assume you've just copied the line for your cdrom device, and you don't, so I'd remove the `ro'. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|