loadYOURSELF

loadYOURSELF

Browsing Posts tagged command

MBR is the master boot record of your disks. It includes also partition table. If you want to create one to one partition table and don’t want to copy all your disk you can use the commands below

to backup your mbr

dd if=/dev/sdX of=mbr.bin bs=512 count=1

to restore back your mbr

dd if=mbr.bin of=/dev/sdX bs=1 count=64 skip=446 seek=446

Buy me a beer

you can use watch command directly like this
watch –interval=1 “ps aux|grep xinetd”
to watch xinetd at a 1 second interval.
or you can define a script like this,
vi /bin/wh
press i to enter insert mode. And write

watch –interval=1 $1

then write :wq to save file
change executable attribute with chmod 755 /bin/wh
use it like this

wh “ps uax|grep xinetd”

Buy me a beer

BACKUP DISK

dd if=/dev/sdX | gzip > a.gz

RESTORE BACK

gzip -dc  a.gz | dd of=/dev/sdX

Buy me a beer