Followup to self because of continuing problems.
>>>>> "jam" == John A Martin
>>>>> "Re: Trouble LVM: pvcreate to usb disk managed by udev"
>>>>> Thu, 05 Jan 2006 00:47:49 -0500
>>>>> "Andy" == Andy Hawkins
>>>>> "Re: Trouble LVM: pvcreate to usb disk managed by udev"
>>>>> Wed, 4 Jan 2006 22:06:56 +0000 (UTC)
Andy> Hi, In article <[🔎] 87r77nk7nn.fsf@athene.jamux.com>,
Andy> John A. Martin<jam@jamux.com> wrote:
>>>> As root:
>>>>
>>>> ,----[ pvcreate /dev/sdc ]
>>>> Device /dev/sdc not found.
>>>> `----
Andy> Doesn't this need to be done on a partition, rather than the
Andy> disk itself?
jam> Indeed! Thank you very much.
jam> It seems that the following just work.
jam> # pvcreate /dev/sdc1
jam> # vgcreate vg1 /dev/sdc1
jam> # lvcreate -l 1 -n test vg1
jam> # mkfs.ext3 -L test /dev/vg1/test
Correction. Problems remain after the above.
I can mount /dev/vg1/test and do df. I can umount it, mount it, do
df. If I unmount it then unplug the USB and plug it in again I cannot
mount it again until after I reboot!
,----[ # mount -t ext3 /dev/vg1/test /media/vg1/test ]
mount: wrong fs type, bad option, bad superblock on /dev/vg1/test,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
`----
No amount of fiddling around that I think of changes this.
,----[ Excerpts from dmesg ]
Initializing USB Mass Storage driver...
scsi2 : SCSI emulation for USB Mass Storage devices
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
[[ ... ]]
Vendor: WD Model: 1600BB External Rev: 0602
Type: Direct-Access ANSI SCSI revision: 00
SCSI device sdc: 312581808 512-byte hdwr sectors (160042 MB)
sdc: assuming drive cache: write through
SCSI device sdc: 312581808 512-byte hdwr sectors (160042 MB)
sdc: assuming drive cache: write through
sdc: sdc1
sd 2:0:0:0: Attached scsi disk sdc
usb-storage: device scan complete
device-mapper: 4.4.0-ioctl (2005-01-12) initialised: dm-devel@redhat.com
`----
,----[ syslog ]
Jan 6 10:15:17 athene kernel: Initializing USB Mass Storage driver...
Jan 6 10:15:17 athene kernel: scsi2 : SCSI emulation for USB Mass
Storage devices
Jan 6 10:15:17 athene kernel: usbcore: registered new driver usb-storage
Jan 6 10:15:17 athene kernel: USB Mass Storage support registered.
Jan 6 10:15:17 athene kernel: usb-storage: device found at 2
Jan 6 10:15:17 athene kernel: usb-storage: waiting for device to
settle before scanning
[[ ... ]]
Jan 6 10:15:17 athene kernel: Vendor: WD Model: 1600BB
External Rev: 0602
Jan 6 10:15:17 athene kernel: Type: Direct-Access
ANSI SCSI revision: 00
Jan 6 10:15:17 athene kernel: SCSI device sdc: 312581808 512-byte
hdwr sectors (160042 MB)
Jan 6 10:15:17 athene kernel: sdc: assuming drive cache: write through
Jan 6 10:15:17 athene kernel: SCSI device sdc: 312581808 512-byte
hdwr sectors (160042 MB)
Jan 6 10:15:17 athene kernel: sdc: assuming drive cache: write through
Jan 6 10:15:17 athene kernel: sdc: sdc1
Jan 6 10:15:17 athene kernel: sd 2:0:0:0: Attached scsi disk sdc
Jan 6 10:15:17 athene kernel: usb-storage: device scan complete
Jan 6 10:15:17 athene kernel: device-mapper: 4.4.0-ioctl (2005-01-12)
initialised: dm-devel@redhat.com
>>> [[ ... ]] <<< USB unplugged <<< ***
Jan 6 14:01:27 athene kernel: usb 5-2: USB disconnect, address 2
>>> [[ ... ]] <<< USB plugged in <<< ***
Jan 6 14:02:20 athene kernel: usb 5-2: new high speed USB device
using ehci_hcd and address 3
Jan 6 14:02:20 athene kernel: scsi3 : SCSI emulation for USB Mass
Storage devices
Jan 6 14:02:20 athene kernel: usb-storage: device found at 3
Jan 6 14:02:20 athene kernel: usb-storage: waiting for device to
settle before scanning
[[ ... ]]
Jan 6 14:02:25 athene kernel: Vendor: WD Model: 1600BB
External Rev: 0602
Jan 6 14:02:25 athene kernel: Type: Direct-Access
ANSI SCSI revision: 00
Jan 6 14:02:25 athene kernel: SCSI device sdd: 312581808 512-byte
hdwr sectors (160042 MB)
Jan 6 14:02:25 athene kernel: sdd: assuming drive cache: write through
Jan 6 14:02:25 athene kernel: SCSI device sdd: 312581808 512-byte
hdwr sectors (160042 MB)
Jan 6 14:02:25 athene kernel: sdd: assuming drive cache: write through
Jan 6 14:02:25 athene kernel: sdd: sdd1
Jan 6 14:02:25 athene kernel: sd 3:0:0:0: Attached scsi disk sdd
Jan 6 14:02:25 athene kernel: usb-storage: device scan complete
>>> [[ ... ]] <<< attempt to mount <<< ***
Jan 6 14:11:04 athene kernel: 2:0:0:0: rejecting I/O to dead device
Jan 6 14:11:04 athene kernel: EXT3-fs: unable to read superblock
`----
It looks as if unplugging the USB and plugging it in again moves it
From sdc: sdc1 to sdd: sd1. So I try the following.
,----[ cat /etc/udev/rules.d/100_local.rules ]
BUS=="usb", KERNEL=="sd??*", \
SYSFS{manufacturer}=="Western Digital", \
SYSFS{product}=="External HDD", \
SYSFS{serial}=="57442D574D414C3934323238343930", \
SYMLINK+="usbmoby%n"
`----
# lvremove vg1
# vgremove vg1
# pvremove /dev/sdc1
# pvcreate /dev/usbmoby1
# vgcreate moby1 /dev/usbmoby1
# lvcreate -l 1 -n pony moby1
# mkfs.ext3 -L pony /dev/moby1/pony
No joy. Same behavior. What am I missing?
jam
Attachment:
pgpPXyGO_NzDQ.pgp
Description: PGP signature