n http://www.phys.ethz.ch/~franklin/Projects/dphys-hotplug/Logfile - done, to do author Neil Franklin, last modification see last entry near bottom copyright ETH Zuerich Physics Departement use under either modified/non-advertising BSD or GPL license 2004.11.10 Wed look how dphys-setup-[cdrom|floppy|zip] work thex do: modprobe, clean fstab, umount, rm mpoint, chgrp/chmod, new fstab look how hotplug works, in the end /etc/hotplug/usb/usb-storage is here already linked to /usr/sbin/dphys-drivemount.sh from dphys-setup-drivemount from /usr/share/dphys-setup-drivemount/usr/sbin 2004.11.11 Thu heeb dphys-drivemount.sh is old dsbg experiment, didn't work, no device anymore removed and also /etc/hotplug/usb, deinstalled dphys-setup-drivemount hotplug.functions load_drivers(), script also when module, wenn loaded it testwise plugged in iomega 80G HD, looked at logs what happens, syslog best /etc/hotplug/usb scripts only when drivers loaded, first device, unusable so we can not use /sbin/hotplug, need wrapper around it /sbin/dphys-hotplug script that calls /sbin/hotplug, then does our stuff /sbin/dphys-hotplug-usb and then /sbin/dphys-hotplug-usb-storage hotplug gives /proc/bus/usb//, /proc/bus/usb/devices gives serial /proc/scsi/usb-storage-0/1 with serial gives host* number as filename 2004.11.12 Fri variable amount mountpoints, /, when multiple partitions //part* unique / from what? user knows manufacturer, poss type, not serial nr 2004.11.24 Wed hotplug usb ACTION=add gives also DEVICE=/proc/bus/usb/002/002 sed -ne '/^T: Bus=02 .*Dev#= *3/,/^T: /{/^S: SerialNumber/p}' \ /proc/bus/usb/devices gives then S: SerialNumber=11100E00005E2A18 grep 'Serial Number: 11100E00005E2A18' /proc/scsi/usb-storage-*/* /dev/null gives then /proc/scsi/usb-storage-0/1:Serial Number: 11100E00005E2A18 grep 'Host scsi' /proc/scsi/usb-storage-0/1 gives then Host scsi1: usb-storage mount /dev/scsi/host1/bus0/target0/lun0/part1 /usb-storage works then, but needs partition differentiation for remove data is missing, so also file /var/.../002/002 with /usb-storage mountpoint name, systematic /usr--[-] reading out label work for ext2, but what with vfat which most people have? would be ideal as consistant for device, bur senseless as nobody sets it vfat can be handled by mlabel, if allways rewriting ~/.mtoolsrc u: software generic dphys-hotplug to usb/etc demux /etc/dphys-hotplug/usb.d/* then in that dphys-hotplug-usb-storage script, for each device, tests type 2004.11.25 Thu dphys-hotplug-usb-storage started with /etc/dphys-hotplug.d/usb.storage 2004.11.26 Fri dphys-hotplug-usb-storage further, add finished, remove, read out label mountpoint name collision avoidance, also using labels, there also sabotage tested, also dphys-hotplug base package packaged version 20041126.161016-1, changelog: "initial release" syslog/logger use levels, user.error, user.warning, user.debug supermount tried, to avoid needing sync, will not work with USB storage grep without stdout-pipe dies when called by hotplug script bugfix tr kills not just first 0, every 0x0 becomes x instead of x0 packaged version 20041126.183204-1, changelog: "added syslog levels, bugfix tr killing non-leading 0s" 2005.01.06 Thu sengun dphys-hotplug-usb-storage mounts / as root:root, user has no access nosuid and nodev, with ext2/3 noatime writing, with vfat root:floppy and 007 tests keep on failing, sometimes 2 mounts, because .old script in hotplug.d/ packaged version 20050106.163325-1, changelog: "added mount options, nosuid/nodev, noatime, root:floppy 007" 2005.01.07 Fri dphys-hotplug-usb-storage further bug hunting, USB stack restarted, still bugs simply van not read SCSI disc, stick works at sengun, 2 of 3 times pomfrey USB connections are all dead, possibly controller died now separate USB card laying around, dumbledore taken over als replacement ex dumbledore added floppy and CD-ROM, OS install, files copied 2005.01.13 Thu dphys-hotplug-usb-storage test, works, incl lazy umount, upload to package serv 2005.01.21 Fri grab Problem with USB stick, does not mount with root:floppy,007 rubis test with his stick doesn't mount at all, is not even partitioned dphys-hotplug-usb-storage also better debug logs, sync mount 2005.01.27 Thu dphys-hotplug-usb-storage changed to use DISCPATH and PARTPATH support for disk without partitions, remove allways delete mountpoint USB stack gets crasht when no partitions, is direct MS-DOS boot sektor system reads boot code as 4 nonsensical partitions, crashes then in kernel so no -b */part1, better dd 4sektors | file to determine, works 2005.01.28 Fri packaged version 20050128.105229-1, changelog: "sync mount, sticks without partitions, no USB stack crash, better logging" works now with rubis stick, test with grab 2 sticks one wrongly implements usb-storage (read error, also fails on Mac) other works, but has no boot code, misidentifies as parttable in parttable heuristics improved, so that it also recognises with boot-less FAT packaged version 20050128.150554-1, changelog: "better heuristics for content identification" now quite a bit of code and functionality, not just keep as internal stuff dphys-hotplug website: FAQ, INSTALL, Logfile, README, debian, index.html.en 2005.02.10 Thu website: FAQ, INSTALL, Makefile, README,index.html.en Logfile (and als changed dphys-hotplug, removed stuff for just here) packaged version 20050210.133747-1, changelog: "added website, improved docs" 2005.02.17 Thu further test with more devices heeb 80G iomega HD fails to find 55AA, /dev/scsi/host3 is missing heeb 250G mounts first (FAT) partition, ignores second (ext) partition seems to be propper policy, multi-part too seldom to bother adding code Discussion about firewire support, will require separate ieee1394-storage not important, as not many users, leave this until after sarge is running test if usb-storage before case add/remove, faills, info missing, back only add changed name from usb.storage to usb-storage, to reduce confusion needs postinst to remove the only script, as apt-get update/upgrade leaves it changed option variable CONF_LOG to CONF_VERBOSE debian/dphys-hotplug-usb-storage.docs completed, as missed up to now packaged version 20050217.165205-1, changelog: "further tests, error messages, rename script usb-storage" 2005.03.13 Sun senguen found Debian package in development that does this for udev systems http://lists.debian.org/debian-mentors/2004/10/msg00308.html 2005.04.14 Thu users USB stick does not mount, is Serial in /proc/bus/usb/devices with f while Serial in /proc/scsi/usb-storage*/* is converted to F, use grep -i packaged version 20050414.153829-1, changelog: "support for mixed case USB SerialNumber" 2005.04.29 Fri while fixing improve debugging output, use now standard CMD_ stuff while at that tidy up entire into CONF|DEBUG|SYS, add # --- comments fix for bootsectors which are FAT, but neither MSDOS nor WIN* identifiable only test for FAT, not for MSDOS.*FAT and WIN.*FAT grab mail, has an USB disk which faills to work, has no S: SerialNumber= line if none fall back to using other identifying data, vendor?, product?, GUID? GUID is not any more in 2.6 kernels, so use product name tests rubischon USB stick OK, heeb USB disk fails (worked before) finds disk but can't read it, looks like USB crashed, reboot, works now grab already gone home, so mail him instead of phone packaged version 20050429.182225-1, changelog: "support for devices without USB SerialNumber" 2005.05.12 Thu grab reports it not working, but was only USB that did not register device recommend retry until it registers, or reboot if USB stack trashed also stale /etc/mtab entry, for already gone device, hand umount works 2005.06.10 Fri port to work on our future Debian sarge systems, no devfs, use standard /dev don't require udev, as that only appears in 2.6, we still use 2.4 usb-storage script, "add" from finding device on, "remove" nothing add determining serial, scsi{} host and so host number is the same missing is /dev/scsi/host{}/bus0/target0/lun0, instead need to find /dev/sd{} need mapping from scsi{} to /dev/sd{}, info for this is in dmesg looking at existing code found massive bug, grepping nameless file if no serial should be sedding /proc/bus/usb/devices for product name, same as for serial looks like existing DISCBASE|PARTPATH logic fails, make just DISCBASE will then later demand dev type specific raw disk -> partition mapping 2005.06.16 Thu further converting to /dev, reintroduced DISCBASE, set both at beginning later both used for filtering fdisk output (no ls -a /dev/scsi/... any more) updated docs, FAQ, README, index.html.en test runs, first on existing devfs systems (regression), hangs, missing \-es still hangs, missing -l option of fdisk, now works packaged version 20050616.151724-1, changelog: "converted from devfs to normal /dev usage" 2005.06.17 Fri test on an sarge system, fails to find path, dmesg is missing the line I used seems to be no direct /proc/* file for this, look at source why line missing 2005.06.30 Thu investigate reason for missing Attached scsi removable disk message in dmesg is there on our woody custom kernels, is in slackware 10 distri kernel but missing in sarge distri kernels linux*/drivers/scsi/sd.c has the printk line for this, at end of sd_attach() both in our kernels and in original 2.4.27 for sarge, not changed in diff our /boot/System.map has sd_attach, sarge /boot/System.map-2.4.27-2-k7 not slackware 10 has sd_attach, even on bare.i non-scsi boot disk compared /boot/config*, is CONFIG_BLK_DEV_SD=y vs CONFIG_BLK_DEV_SD=m looked on zonko, no module sd loaded, connected usb disk, no message modprobe sd_mod (not sd), and promply get an Attached message so we simply need to load sd_mod module for this to work on sarge in script run normal test, if it faills, then try to load module seems than message format has changed, switch from cut to sed, works tests with other USB stick, file fails to identify partition file system work if only forst sector, fails if first 4, so first 4 only for ext test tests on sarge system, works with Iomega DH, fails for second device stick also fails for stick allone, large "scsi" spin up error message, from sd_mod? seems to be not plugged in any more first drive I was testing 2005.07.01 Fri zonko reboot to get rid of spinup, module load from beginning first drive then recognized, second not any more looks like we will need an custom kernel, with sd compiled in further test, stick first, then HD, it works, inkl later re-inserting retested with first HD, then stick, now also works, grrrrr decided to remove auto-load, which seems to be problematic, and init.d load documented that this is needed, so users don't fail on not loaded stuff packaged version 20050701.135645-1, changelog: "fixed /dev problems when no scsi disk support loaded" 2005.09.29 Thu User has 2 USB devices (1 disk, 1 stick) fail disk seems to be due to not loaded sd_mod (old senguen kernel with =m) for stick sd_mod ist loaded(!), but fails to read first block later block is readable, may be too slow stick, not ready yet went to user, disk still fails with sd_mod, stick now works without problem disk seems to be usb works but then scsi fails to understand it 2005.10.13 Thu find out why some usb-storage devices do not register sometimes usb-storage module not loaded, often scsi not allocated/dmesg-ed try senguens new kernel with USB and usb-storage compiled in, works but fails later on when user re-inserts same drive, no 'Attached scsi' 2005.10.14 Fri usb-storage no second 'Attached scsi' line after repeat plugging in small fix in error message, bugfix debug log default off problem is scsi to sd mapping, only first time so first time store sd and then when missing fall back on stored for above added an REINSERT_DEV script and filename rename REMOVE_MP to REMOVE_MPS (as multiple), and add remove- for unique changed SYS_REMOVE_DIR to more generic SYS_RUN_DIR, as now for both packaged version 20051014.163549-1, changelog: "fixed failled re-inserts because no repeat of scsi attach info" 2005.11.04 Fri senguen Gehrmann has USB stick that fails to mount on isis log shows no serial number, and also failling product name /proc/bus/usb/devices shows lines w spaces at beginning, and extremely long /proc/scsi/usb-storage-*/* shows with spaces but truncated to 31 chars so truncate for ${SERIAL} and ${PRODNAME} comparisons, log with "\"...\"" 3 weeks since last release, can now remove backwards compatibility REMOVE_MP= packaged version 20051104.132646-1, changelog: "workaround for broken long USB serial numbers and product names" 2005.12.01 Thu my own new USB HD fails, because first partition ext3 without boot sector/ident replace fatal test with just logging an note that it was seen, rest works packaged version 20051201.104619-1, changelog: "support for ext2|3 without boot sector and identity" 2006.05.17 Wed when generating /usb/nolabel-* names filter out non a-zA-Z0-9 and + - _ stuff at same time added set -e as now standard policy in our scripts script abborts, works without set -e, fails on echo|cut|sed is sed which fails so long no 2>/dev/null, old grep problem in hotplug packaged version 20060517.154655-1, changelog: "filter non a-zA-Z0-9 and + - _ from vendor/product names" 2006.06.08 Thu mut fails to remount an USB stick, test on selket shows same behaviour after rmmod usb-storage it mounts again once is mounting correctly as sams scsi as before, same /dev/sd so ${SYS_RUN_DIR}/reinsert-${SHOST} is delivering correct data evil fix by doing /sbin/rmmod usb-storage on each remove should also work on dual-stick hosts, only removes after all gone while at it, move set -e after config stuff, as in other scripts heeb/abe want User ability to umount, already in new/2.6/udev replacement updated it there and backported it to this old/2.4/hotplug based system for this also backported chown/chmod to root:floppy/770 of /dev/sd() so now mlabel and other mtools work if ~/.mtoolsrc has an c: entry but trying to umount fails, even with group or user or owner option 2006.06.09 Fri further with User ability to umount, detected console user name but the group option seems to only work in /etc/fstab and we don't want to modify that as result of user actions try modifiying /etc/mtab after the mount, pretend it was with user option but umount does not trust /etc/mtab, also checks fstab, grrrr looked at pmount, is in group plugdev, use that group anyway, add to wdm for changed Xstartup and Xreset get rid of outdated dphys-local-wdmconf but pmount forces mount in /media/*, and user must know pumount command try using udates to /etc/fstab after all, to be safe use spinlock because user can umount degrade stray mountpoint warning to note 2006.06.12 Mon USB storage FAT labels do not work any more, is mtools that are abborting sarge new test number of sectors not a multiple of sectors per track this fails on USB stick, abborts with error instead of just warning, fix packaged version 20060612.150857-1, changelog: "remove usb-storage after umount, avoid incomplete re-init allow user umount and re-mount" 2006.06.22 Thu user fails to find USB stick on /