Sutff about my job and comments about personal activities. Take a look to the first idea.

Sunday, January 07, 2007

Restore file modes from rpm database

As usual root access gives unlimited power, but a misusage could give you a few headaches, in my case, a user change the ownership and modes in the files of almost all the filesystem, so I googled for a solution and found that the rpm database could be used to restore the files from rpms packages, you could use a command like:

rpm -qa | xargs rpm --setperms --setugids

I just love how simple a solution could get you out of troubles...

SCSI serial number

As the last post stated, I've access to a storage with many harddrives and I've to manage the serial numbers by serial number. I've RHEL2 and RHEL3 at work so I wanted to find a package from Redhat...

I found a package called sg3_utils which have a few utilities to manage scsi disk including performance test, the sginfo gives you disk information including the serial number of the disk.

Good to know that RHEL is a true enterprise distribution!!!

PV metadata

I've access to a SAN environment and due a confusion, a PV metadata was overwritten, so I decided to google for a solution and found LVM saves configuration backup at /etc/lvmconf.d/ and LVM package includes a utility to recover partial information from it. In my case, I'd to deactivate the VG and restore the PV metadata
vgcfgrestore -f /etc/lvmconf.d/myvgfile.conf.1 /dev/sdX
I'm still amused by the power and flexibility of LVM...