USB memory stick hotswap problems

From: Ivan Voras (ivoras_at_fer.hr)
Date: 09/25/04

  • Next message: Ivan Voras: "USB hotsync problems, #2"
    Date: Sat, 25 Sep 2004 13:16:38 +0200
    To: current@freebsd.org
    
    

    What is the expected behavour when umounting USB drives which have
    already been unplugged? :)
    I'm sure I'm not the only one who often forgets to umount these thingies
    when leaving the site I'm working at the moment, so it should probably
    be something other than what I always encounter (BETA5):

    a) "You can't". Whatever I do, either umount gets "stuck" (even with -f)
    and does nothing (cpu is not used, so it's waiting for something), or it
    just exits with "device not configured".
    b) Kernel panic. This happens after using the drive for a long time, and
    umounting it some time later (even several hours later when the drive is
    no longer available at the site).
    c) A curious behaviour: umount -f works (probably because nothing has
    been written to the drive), but after re-plugging the drive, I have
    *two* /dev/da0 and /dev/da0s1 devices, and the system refuses to remount
    the filesystem ("device not configured"):

    crw-r----- 1 root operator 4, 25 Aug 25 12:46 da0
    crw-r----- 1 root operator 4, 25 Aug 25 12:46 da0
    crw-r----- 1 root operator 4, 26 Aug 25 12:46 da0s1
    crw-r----- 1 root operator 4, 26 Aug 25 12:46 da0s1

    Also, I can 100% reliably panic the system when these entries are added
    to the /etc/devd.conf and the drive is *plugged in*:

    attach 100 {
             device-name "da0";
             action "mount /mnt/flash";
    };
    detach 100 {
             device-name "da0";
             action "umount -f /mnt/flash";
    };

    (I modelled these on the "ukbd0" example. Using "umass0" for device name
      did nothing).

    Any ideas how to solve or circumevent these problems? (Aside from "don't
    do that").

    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"


  • Next message: Ivan Voras: "USB hotsync problems, #2"

    Relevant Pages

    • Re: panic after removing usb flash drive
      ... >>Of course, if you did unmount the filesystem before pulling the drive, then ... >>this shoule be looked into. ... > eat data on your other drives). ... probably won't get around umounting while in use, ...
      (freebsd-current)
    • Removing LVM
      ... I have 2 drives in my computer an 80GB and a 200GB. ... everything is on the smaller drive which is using LVM. ... At my local Linux user group we tried to do a backup of the small drive to ... I have tried umounting /proc, ...
      (Fedora)