miércoles, 7 de enero de 2009

Debianization in situ


fdisk /dev/sda -l
sda1 40162 83 Linux
sda2 530145 82 Linux swap
sda3 11783677 83 Linux
sda4 23358510 83 Linux

mkfs.ext3 /dev/sda3

tune2fs
-e error-behavior

Change the behavior of the kernel code
when errors are detected. In all cases,
a filesystem error will cause e2fsck(8)
to check the filesystem on the next boot.

error-behavior can be one of the following:

continue Continue normal execution.

remount-ro Remount filesystem read-only.

panic Cause a kernel panic.

google tune2fs (5@1231371868) (*1) -> http://www.snow.nl/dist/xhtmlc/ch03s02.html

http://www.snow.nl/dist/xhtmlc/ -> The LPIC-2 Exam Prep (*2)

umount /dev/sda1
dumpe2fs /dev/sda1 | less
tune2fs -C 0 -i 1d -e remount-ro /dev/sda1
tune2fs -C 17 -i 52w -e remount-ro /dev/sda3
tune2fs -C 32 -i 48w -e continue /dev/sda4

swapoff /dev/sda2
mkswap -c /dev/sda2

If no -v option is given, mkswap will default to new style, but use old style if the cur‐
rent kernel is older than 2.1.117 (and also if PAGE_SIZE is less than 2048). The new
style header does not touch the first block, so may be preferable, in case you have a boot
loader or disk label there. *If you need to use both 2.0 and 2.2 kernels, use the -v0
option when creating the swapspace.*

swapon /dev/sda2

mkdir /mnt/debinst


mount /dev/sda3 /mnt/debinst
mkdir /mnt/debinst/boot
mount /dev/sda1 /mnt/debinst/boot
#mount /dev/sda4 /mnt/debinst/home

( debian:/# ls boot/ )
( config-2.6.26-1-486 initrd.img-2.6.26-1-486 System.map-2.6.26-1-486 vmlinuz-2.6.26-1-486 )
( config-2.6.26-1-686 initrd.img-2.6.26-1-686 System.map-2.6.26-1-686 vmlinuz-2.6.26-1-686 )

man debootstrap

Full process to create a complete Debian installation of sid (unstable):

main # cd / ; mkdir /sid-root
main # debootstrap sid /sid-root http://ftp.us.debian.org/debian/
[ ... watch it download the whole system ]
main # echo "proc /sid-root/proc proc none 0 0" >> /etc/fstab
main # mount proc /sid-root/proc -t proc
main # cp /etc/hosts /sid-root/etc/hosts
main # chroot /sid-root /bin/bash
chroot # dselect
[ you may use aptitude, install mc and vim ... ]
main # echo "8:23:respawn:/usr/sbin/chroot /sid-root " \
"/sbin/getty 38400 tty8" >> /etc/inittab
[ define a login tty that will use this system ]
main # init q
[ reload init ]

debootstrap lenny /mnt/debinst/
cp /home/boo/admin/debianiza.sh /mnt/debinst/root/
mount proc /mnt/debinst/proc -t proc
chroot /mnt/debinst /root/debianiza.sh


(*1) keyword ( posicion en la busqueda @ 'date +%s' )
(*2) Que cosas pasan...

2 comentarios:

alidhaey dijo...

Olvide lo que te iba a poner, pero la palabra de verificación del comentario es:
'debbaa'

Fredigato dijo...

Por algo seribaa