Professional Web Applications Themes

Hot swapping USB hard disks - Linux Setup, Configuration & Administration

On my Mandrake 9.1 (2.4.22 kernel) I have an external IDE -> USB hard drive made by ExShuttle. I am having a problem when attempting to "hot swap" drives in and out of the ExShuttle case. I made an ext2 filesystem on it and it is accessable after a reboot without having to run any mount commands. I wasn't sure if these USB hard drives require unmounting before pulling the drives out or if they worked similar to a CDROM drive where a CD automounts/autoun-mounts the CD when putting it in or taking it out(at least the Mandrake distribution automounts ...

  1. #1

    Default Hot swapping USB hard disks

    On my Mandrake 9.1 (2.4.22 kernel) I have an external IDE -> USB hard
    drive made by ExShuttle. I am having a problem when attempting to
    "hot swap" drives in and out of the ExShuttle case. I made an ext2
    filesystem on it and it is accessable after a reboot without having to
    run any mount commands.

    I wasn't sure if these USB hard drives require unmounting before
    pulling the drives out or if they worked similar to a CDROM drive
    where a CD automounts/autoun-mounts the CD when putting it in or
    taking it out(at least the Mandrake distribution automounts and auto
    unmounts). I tried "hot swapping" the USB drives in and out of the
    ExShuttle, but the second drive is not accessble.

    I suspected that it needed to be unmounted first and tried to do so
    using the right mouse button selection from the "removable" icon on
    the desktop. The drive does not unmount and in '/var/log/messages' is
    says "kernel: Device busy for revalidation (usage=2)". I checked to
    see what process was tying up the devices using 'fuser' and found
    'fam' was the culprit. However, after killing this process,
    '/mnt/removable' still would not unmount.

    1) Are these type of USB connected hard drives supposed to be "hot
    swappable"?
    2) If so, what is the procedure?
    3) If not, then is the only way to swap drives by doing the following:
    un-mount the device (using 'umount /mnt/removable'), remove the drive,
    insert the new drive and then running 'mount -a' (this is what I
    currenly have to do) so I can put another drive in?

    I don't have experience with Linux USB connected devices and what the
    rule-of-thumb(s) are for connecting and disconnecting, so any
    additional information would be appreciated. Thanks

    Jack Moe
    Jack Guest

  2. #2

    Default Re: Hot swapping USB hard disks

    yep, mount/umount is normally required for adding removing filesystems.

    you can improve things a bit by editing /etc/fstab
    my entry is
    /dev/sda /mnt/uhd1 ext2 defaults,user,exec,noauto 0 0
    the user entry means that you don't have to change to root to mount/umount

    you may be able to use supermount on your removable drive, see /etc/fstab
    entries for your cdrom, man supermount, man fstab & man mount.

    I don't know if supermount uses the 'sync' mount option & since linux may
    take up to 30 secs before flushing the disks I suspect mount/umount is th
    safest option

    the 'user' option in fstab and a script or 2 makes the process fairly
    painless though

    hotplug occasionally misses the plugin event on systems I have used, so you
    may need to check for the devices being added by devfs. these are usually
    sda, sda1 etc depending on the number of partitions on the disk




    Jack Moe wrote:
     

    jb Guest

  3. #3

    Default Re: Hot swapping USB hard disks

    > Jack Moe wrote: [/ref]
    -- 
    --
    Thanks, jb.

    The '/etc/fstab' has an automount entry in it. I also found that I have to
    turn off the USB external hard drive case after issuing the 'umount' command, otherwise
    when I put another drive in and power it back up, Linux doesn't see it. Kinda like ejecting
    a mounted floppy and then taking it out and putting another one in to see what's on it.

    I was hoping that the external USB drive would work more like the CDROM drive, where the
    CD mounts and un-mounts when the CD is inserted or removed.

    It appears that it works more like a memory stick. Even Windoze reminds you to "eject"
    or use the hardware manager when removing memory sticks. Makes sense as the device is
    "mounted" read/write and *NIXes don't like to be removed before gracefully unmounting.

    Jack Moe

    Jack Guest

  4. #4

    Default Re: Hot swapping USB hard disks

    XXL PapaBear wrote:
     
    >
    >
    > [snip]
    >
    > Let e say beforehand thtat I do not have experience with this, nut how would changing the /etc/fstab entry to:
    > /dev/sda /mnt/uhd1 ext2 defaults,user,exec,auto 0 0
    > ----^
    >
    > benefit us?
    >
    > Could it be that an automount took place then, like with changeable devices?
    >
    > Gerard[/ref]
    --
    Gerard,

    The entry below was put in by Linux for me:

    none /mnt/removable supermount dev=/dev/sda1,fs=ext2:vfat,--,codepage=850,kudzu,iocht=iso8859-1 0 0

    It wasn't there until the external USB drive was attached to the system and I went in
    to configure/format the drive.

    Although 'df' does not show the size and used space, 'du /mnt/removable' gives me the
    information I need. I can 'umount /mnt/removable' and then 'mount '/dev/sda1 /usb'
    and mount like a normal hard drive. Then, 'df' shows the free and used space.

    My preference with external hard drives would not to have to run 'umount'. But, like I
    said in my reply to jb, this is not how read/write mounted volumes behave. 'umount' flushes
    data to the disk, so, unless there is a way to not cache the write data, I don't think
    it's possible. Even if flush right away is, I don't think *NIXes like mounted filesystems
    to be pulled in mid-stream without somehow telling the OS that the drive has been remove.
    But then I would think that's what the automounint feature would handle.

    Anyone care to comment. . .

    Jack Moe

    Jack Guest

  5. #5

    Default Re: Hot swapping USB hard disks

    On Sat, 31 Jan 2004 00:24:39 +1100
    jb <there.com> wrote:
     

    [snip]

    Let e say beforehand thtat I do not have experience with this, nut how would changing the /etc/fstab entry to:
    /dev/sda /mnt/uhd1 ext2 defaults,user,exec,auto 0 0
    ----^

    benefit us?

    Could it be that an automount took place then, like with changeable devices?

    Gerard

    \\\\||//
    ------------oooO---PapaBear----Oooo------------

    Jesus is alive! I spoke with Him this morning.
    XXL Guest

Similar Threads

  1. unable to mount secondary hard disks now
    By Shea in forum FreeBSD
    Replies: 2
    Last Post: April 6th, 10:35 PM
  2. Swapping hard drives
    By Ralph in forum FreeBSD
    Replies: 2
    Last Post: March 7th, 09:15 AM
  3. Jaz and Zip disks no longer work as start disks
    By Tony in forum Mac Applications & Software
    Replies: 8
    Last Post: September 6th, 06:01 AM
  4. Help Needed: G4 freezes when using Install disks...both 9.2.2and X disks.
    By William in forum Mac Applications & Software
    Replies: 3
    Last Post: July 28th, 08:01 PM
  5. Replies: 7
    Last Post: July 13th, 03:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139