I was setting up a machine to handle some of our backups at work. It's not a critical system, so instead of setting up a RAID across 3 250GB drives, I just set up LVM so I could take advantage of all 750GB. This were going along fine, but then I wanted to see what the status of LVM was...So I ran 'lvdisplay' and got this very disturbing message:
Couldn't find device with uuid 'tcRo2m-XJ1W-JFUh-FuYP-dbbW-RHSx-FFnQ4r'.
Couldn't find all physical volumes for volume group ide_drives.
Couldn't find device with uuid 'tcRo2m-XJ1W-JFUh-FuYP-dbbW-RHSx-FFnQ4r'.
Couldn't find all physical volumes for volume group ide_drives.
Volume group "ide_drives" not found
Uh oh...Did one of the drives fail already? 'pvscan', etc. didn't yield any better results.
But then I notice the device that isn't found is '/dev/hdb', which does have the correct uuid. But it also happens that '/dev/cdrom' is a symlink to '/dev/hdb', so lvm was ignoring that device because it thought it was a cdrom device! AAARGH. Only took me 2 hours to figure that one out. I'm hoping this post can save somebody else some time.
On that same machine, I wanted to set up rsync to handle the backups since it's well suited for that purpose. I had just discovered rsync's filter rule syntax so I wanted to play around with that to specify which directories on which machines should be backed up. Lets say my directory structure looks like this:
/
/etc
/home -> /mnt/raid/home
/mnt
/mnt/raid/
/mnt/raid/home
/proc
/tmp
...
and I want to back up both /etc and /home. So I tried this set of rsync filter rules:
+ /etc/
+ /etc/**
+ /home/
+ /home/**
- *
No luck at all. rsync refused to copy over the home directories.
Again, several hours were lost figuring this out. I think what was happening was that rsync was happily copying the /home symlink and not looking deeper into the directory structure. So when it came to the '- *' rule, the actual home directories were being excluded. I solved this by adding
+ /mnt/
+ /mnt/raid/
+ /mnt/raid/home/
+ /mnt/raid/home/**
to my filter rules instead of the '/home' stuff.
Comments