At work we have a machine to which root password has been lost. I have pulled out the disk and mounted it to another computer. Now I think the next step should be editing root password in the shadow file.
But the disk I have pulled out is actually a disk1 from raid1 (mirrored) array. Is it safe to modify data on one of the disks from the array like this? If not, how should I proceed?
And if you could also answer this: what is a good way to manually generate the hash to put into the shadow file (is it md5 or something else?).
The easiest approach would be to boot the system with a live/rescue CD which can assemble the RAID and just mount the root partition and edit the file there.
Editing just one copy of a RAID1 (and only this, not RAID 0,5 or 6) would be possible, but why bother with repairing the out-of-sync array afterwards?
A simpler way to restore a lost root password is to boot up in single user mode. How you boot up in single user mode depends on the boot loader, and version of linux you're running.