linux

All posts tagged linux

When in logs show messages like: postfix/qmgr[2381]: warning: connect to transport relay: No such file or directory postfix/qmgr[2381]: warning: connect to transport relay: No such file or directory trinity last message repeated 2 times you have emails unsent and should be deleted to clean postfix and avoid those annoying messages. To do that, You can check inside /var/spool/postfix/defer and find the ID's of deferred messages (inside defer folder a simple find will work). This folder contains Read more...
#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