Linux

Linux stuff

#When you forget root password, there is a way to set a new password accessing the console after booting or restarting the system. When grub load, edit the line kernel and add in the end of kernel parameters: init=/bin/bash The system will go up without requesting root password like in single user. After the system is up, re-mount / filesystem # mount -o remount,rw / Now the / filesystem is accesible and you can change root password with: # passwd root   Now reboot the machine Read more...

#to copy or backup the MBR

MBR information is stored on the first 446 bytes of a disk, to backup this information you can save it with dd to another disk, or to a file.

dd if=/dev/sda of=/dev/sdg bs=446 count=1

dd if=/dev/sda of=/path/to/a/file.mbr bs=446 count=1

 

To restore the data to its original place using our backup file:

dd if=/path/to/a/file.mbr of=/dev/sda  count=1