LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Mount external drive (http://www.linuxquestions.org/questions/slackware-14/mount-external-drive-626254/)

rkfb 03-06-2008 06:12 PM

Mount external drive
 
If I plugin my 250gb external drive I get:

usb 1-6: new high speed USB device using ehci_hcd and address 7
usb 1-6: configuration #1 chosen from 1 choice
scsi7 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 7
usb-storage: waiting for device to settle before scanning
kobject_add failed for usb_storage with -EEXIST, don't try to register things with the same name in the same directory.
[<c03e8717>] kobject_shadow_add+0x117/0x1a0
[<c013fba4>] mod_sysfs_setup+0x24/0xb0
[<c0141458>] sys_init_module+0x1648/0x1940
[<c0102ae8>] syscall_call+0x7/0xb
=======================
scsi 7:0:0:0: Direct-Access WD 2500JB External 0108 PQ: 0 ANSI: 0
SCSI device sdb: 488397168 512-byte hdwr sectors (250059 MB)
sdb: Write Protect is off
sdb: Mode Sense: 03 00 00 00
sdb: assuming drive cache: write through
SCSI device sdb: 488397168 512-byte hdwr sectors (250059 MB)
sdb: Write Protect is off
sdb: Mode Sense: 03 00 00 00
sdb: assuming drive cache: write through
sdb: sdb1
sd 7:0:0:0: Attached scsi disk sdb
sd 7:0:0:0: Attached scsi generic sg1 type 0
usb-storage: device scan complete

and

# fdisk -l
Disk /dev/hdc: 80.0 GB, 80026361856 bytes
16 heads, 63 sectors/track, 155061 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 * 1 152779 77000584+ 83 Linux
/dev/hdc2 152780 155061 1150128 82 Linux swap

Disk /dev/hdd: 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/hdd1 1 19457 156288321 83 Linux

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 30401 244196001 83 Linux

but no window pops up to ask what I want to do with it.

# fdisk /dev/sdb

The number of cylinders for this disk is set to 30401.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 30401 244196001 83 Linux

Command (m for help):

It was working fine 'til a neighbour borrowed it and plugged it in to a windows machine. It came back blank with just one big ntfs partition which I deleted and then created the linux partition, but I don't seem to be able to access the drive in any way that I know.

# mount /dev/sdb /mnt/disk
mount: No such file or directory

# mount /dev/sdb1 /mnt/disk
mount: No such file or directory


cat /etc/fstab
/dev/hdc2 swap swap defaults 0 0
/dev/hdc1 / ext3 defaults 1 1
/dev/hdd1 /home ext3 defaults 1 2
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
/dev/sdb /mnt/disk ext3 defaults 0 0

I wonder if anyone has any suggestions?

Alien Bob 03-06-2008 06:26 PM

Yu created the partition, but did you also create a filesystem on that partition (i.e. formatted it by running "mkfs.ext3 /dev/sdb1")?

Eric

raconteur 03-06-2008 06:27 PM

In addition to Alien Bob's advice above, and this may be a bit obvious, but does /mnt/disk exist and is it readable by the current user?

Your fstab entry isn't quite correct, you do want to mount the partition on the device (sdb1) and not the root device itself (sdb), just as on the command line. I recommend getting the mount command working before making the fstab entry, though no real harm is done if it fails.

shadowsnipes 03-06-2008 06:32 PM

Your /etc/fstab should have /dev/sdb1 and not /dev/sdb

I'm assuming that you actually formatted the partition as ext3. If not, then you know what you need to do first. I'm also assuming that /mnt/disk actually exists. If not, then create that directory.

If you have an entry in fstab then you only need to
Code:

mount /mnt/disk
If you have no entry in fstab for it then you can
Code:

mount -t ext3 /dev/sdb1 /mnt/disk

rkfb 03-07-2008 09:05 AM

It was the mkfs.ext3 /dev/sdb1 that I hadn't done and all now is fine. I mistakenly believed that fdisk did all that when you created a partition. I also deleted the entry in fstab altogether and it now just pops up on the desktop when I plug it in, as it did before.

Thanks to all for the helpful replies.


All times are GMT -5. The time now is 05:19 PM.