Two LVM VolGroup’s, same name, one is system disk – what to do?

It’s a lot easier to rename the “old” volume group if the old drive is the only one connected to the system.

Using your first FC4 installation CD and with only the old drive installed, boot into rescue mode (boot: linux rescue), but don’t search for or mount the FC installation. At the command prompt, you will probably need to active the lvm like this:

lvm vgscan

lvm lvscan

lvm vgchange -a y

lvm pvscan

lvm lvscan

The last two commands should list your volume group(s) and logical volume(s). Now use vgrename to fix the problem:

lvm vgrename VolGroup00 whatever_you_want_to_call_it

Note that all lvm commands need to be preceded with “lvm” in rescue mode.

via Two LVM VolGroup’s, same name, one is system disk – what to do?.

How to Bulk Rename Files in Linux (Terminal or GUI)

The syntax for the rename command is:

rename [ -v ] [ -n ] [ -f ] perlexpr [ files ]

-v means “verbose” and it will output the names of the files when it renames them. It is a good idea to use this feature so you can keep track of what is being renamed. It is also a good idea to do a test run with -n which will do a test run where it won’t rename any files, but will show you a list of files that would be renamed.

via How to Bulk Rename Files in Linux (Terminal or GUI) | Webmaster Tips.

scanning for new scsi devices

scanning for new scsi devices.

New devices can be added using echo “scsi add-single-device <h> <b> <t> <l>” > /proc/scsi/scsi where the variables are host, bus (channel), target (scsi id) and lun. The success (or otherwise) of this command can be determined by sending a subsequent cat /proc/scsi/scsi command.

..from the scsi-howto (proc interface) at www.tldp.org – see it for more info.

i have a script “rescan-scsi-bus.sh” here on debian which uses the above method to recheck devices.

HTH ritch.

This was written in 2005. I found the rescan-scsi-bus.sh script on medusa but have no idea which package it came from. It wasn’t on any other Fedora 14 install so it must have come from somewhere. It scans the SCSI bus and finds the drive perfectly well.

Re-scan the SCSI bus in Linux after hot-swapping a drive

A better way to find out the correct host controller:

# udevadm info -a -p /sys/class/scsi_generic/sg0

where sg0 is the device node of which you’d like to know the corresponding SCSI controller – down that tree you will find hostX mentioned as part of the device path.

And thanks for the rescanning tip, it saved my day.

via Re-scan the SCSI bus in Linux after hot-swapping a drive | Racker Hacker.