loadYOURSELF

loadYOURSELF

Entries Tagged ‘dd’

Creating & using ext3 filesystem images

Ext3 is a linux filesystem and used by most of the linux systems. This article shows and example ext3 image usage situation.

we will create and use 20MB ext3 image. 1024×20480 bytes.

first we create an empty file with dd block size 1024

dd if=/dev/zero of=disk1.image bs=1024 count=20480

then we format that image

mkfs.ext3 -F -b 1024 disk1.image 20480

this will give an empty filesystem whose type is ext3.

MBR backup with dd command @ LINUX

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

Backup entire disk (mbr included) with dd (linux command) and gzip

BACKUP DISK

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

RESTORE BACK

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

Buy me a beer

How to read BIOS from linux

# dd if=/dev/mem bs=1k skip=768 count=256 2>/dev/null | strings -n 8

Buy me a beer