I have an iSCSI disk array connected to a server (Ubuntu). When I login with
iscsiadm -m node --login -p 192.168.1.240
the device used to appear as /dev/sdb. I created a volume group with LVM using /dev/sdb, and eventually ext4 partitions on it. After a reboot the device is appearing as /dev/sdd, and I can no longer mount any of the partitions I had created. vgscan can see the VG (called a), but the devices mapped onto the partitions give an error:
vgscan
...
/dev/dm-9: read failed after 0 of 4096 at 4096: Input/output error
Found volume group "a" using metadata type lvm2
I would have thought that the system would be able to cope by itself with such a change (via the uuid of the devices), but I'm obviously missing something. So my questions are:
- is there a way to force my iSCSI device to go back to /dev/sdb?
- if not, is there a way to point my dev/dm-n devices to use /dev/sdd
- what is a robust way to go about it? I have learned today how to make my iSCSI device appear with the same name (say, /dev/iscsi/array): is this what I should have done? The issue of the iSCSI device not appearing back on the same /dev/sdx device is not mentioned anywhere as far as I can tell, so perhaps I'm missing something else.
Addition: rebooting the machine has the desired effect. The device reappears at the right place. The questions remain: I'd appreciate it if anybody had any pointers so they can be answered.
Best Answer
I'm answering my own questions after some further research.
vgchange VGNAME --refresh
and the errors will go away. Now you can mount the logical volumes as you used to.