The Archives

  • 30.Jan.15
    Backup & Restore the Master Boot Record shell | rafacas | (0)
    Some days ago I had to recover the Master Boot Record (MBR) of a damaged hard disk. The MBR is the first 512 bytes of a storage device. It contains an operating system boot loader and the storage device’s partition table. If you need to make a backup of the MBR type the following command: dd if=/dev/sda of=/root/mbr.img bs=1 count=512 You only have to change sda with the device name that correponds to your hard disk. To restore it: dd if=/root/mbr.img of=/dev/sda bs=1 count=512 And as before, change sda with the device name that corresponds to the hard disk you are going to restore the MBR ...
  • 08.May.09
    Creating a file with a specific size shell | rafacas | (1)
    The last week I had to test the transfer speed between two machines. I tested it sending files with different size. For creating those files I used the dd command which allows to create an empty file of desired size. $ dd if=/dev/zero of=file_to_create bs=1k count=1024 1024+0 records in 1024+0 records out 1048576 bytes transferred in 0.010811 secs (96992910 bytes/sec) /dev/zero is a special file that provides as many null characters (ASCII NUL, 0x00) as are read from it. In the above example, the bs option set both input and output block size to 1k, and the count option copy only 1024 input blocks, so ...
  • 16.Jul.08
    Creating ISO from CD/DVD cmd | rafacas | (1)
    # dd if=/dev/cdrom of=/tmp/mycd.ISO bs=4096 Create an ISO from a CD/DVD (Replace device name and filename as appropiate)