loadYOURSELF

loadYOURSELF

Browsing Posts in Howto

You can backup your system partition table with sfdisk which you can also inlude extended partitions.

backup partition table

sfdisk -d /dev/sda > my-sda.sf

restore partition table

sfdisk /dev/sda < my-sda.sf --force

you can download the sfdisk source from

ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.15/

and you can compile it for your desktop PC or for your embedded device. (cross compiling)

Buy me a beer

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.

First change ls commands color attribute to auto

alias ls=’ls –color=auto’

then add this to /$HOME/.bashrc

then create a file /$HOME/.dircolors

extract this to that file (which must be one line after export command there is a space)

export LS_COLORS=”no=00:fi=00:di=01;35:ln=01;36:pi=40;33:so=01;35:do=01;35:

bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:

tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:

*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:

*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:

*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:

*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:

*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:

*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mng=01;35:*.pcx=01;35:

*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:

*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:

*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:

*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:

*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:”

Some definitions for abbreviations

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

Buy me a beer

change this line

/vmlinuz-2.6.9-22.EL ro root=LABEL=/1 rhgb quiet

in grub to this line

kernel /vmlinuz-2.6.9-22.EL ro root=LABEL=/1 rhgb quiet video=vesafb:ywrap,mtrr vga=0×318

Buy me a beer