domingo, 20 de julio de 2008

BT3 en USB con cambios persistentes



Como instalar BackTrack3, en la memoria USB y hacer que los cambios persistan, no como el livecd que una vez que reinicias se pierde todas tus configuraciones.

Asi como existen los firefox, operas, openoffice, portables, tambien existe el linux portable que lo puedes llevar en tu memoria usb,como el PenDriveLinux.El PDL es una buena opcion para aquellos que no tengan la opcion de booteo USB y quieran iniciarlo desde winbugs

En este tutorial para el BT3 es necesario que la placa tenga la opcion de booteo USB, ademas vamos a trabajar con una memoria USB de 2GB y todo lo realizado sera sobre linux en mi caso Debian, aunque con otras distros no deberia haber problemas, ademas para los que quieran hacer lo mismo pero desde windows el usuario pure_hate ha realizado un video tutorial.

Este howto practicamente es una traduccion del tutorial, realizado por el usuario umattu, con algunas modificaciones.

- Descargar el BT3 version USB.

- Como root relizamos lo siguiente
fdisk /dev/sdb <---- donde se encuentra tu memoria USB
Command (m for help):p <--- para ver las particiones que hay en el USB

- Ejemplo:

Command (m for help): p

Disk /dev/sdb: 1998 MB, 1998585344 bytes
255 heads, 63 sectors/track, 242 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa62da6ab

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 132 1060258+ b W95 FAT32
/dev/sdb2 133 242 883575 83 Linux

Command (m for help): d <---- para borrar la particion
Partition number (1-4):1 <---- estamos borrando la particion 1 y luego la 2 hasta que quede asi:

Command (m for help): p

Disk /dev/sdb: 1998 MB, 1998585344 bytes
255 heads, 63 sectors/track, 242 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa62da6ab

Device Boot Start End Blocks Id System


- Ahora vamos a crear una nueva particion:

Command (m for help): n <--- nueva particion
Command action
e extended
p primary partition (1-4)
p <---- particion primaria
Partition number (1-4): 1 <-- enter
First cylinder (1-242, default 1): <-- enter
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-242, default 242): +1080M <--- El tamaño elegido

- Creamos la segunda particion:

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (133-242, default 133):
Using default value 133
Last cylinder or +size or +sizeM or +sizeK (133-242, default 242):
Using default value 242

- Ahora veremos como quedo las particiones

Command (m for help): p

Disk /dev/sdb: 1998 MB, 1998585344 bytes
255 heads, 63 sectors/track, 242 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa62da6ab

Device Boot Start End Blocks Id System
/dev/sdb1 1 132 1060258+ 83 Linux
/dev/sdb2 133 242 883575 83 Linux

- Vamos a cambiar el id de la particion 1 que sera un Fat32

Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): b
Changed system type of partition 1 to b (W95 FAT32)

- Haremos que la primera particion sea booteable

Command (m for help): a
Partition number (1-4): 1

-Al final queda algo asi:

Command (m for help): p

Disk /dev/sdb: 1998 MB, 1998585344 bytes
255 heads, 63 sectors/track, 242 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa62da6ab

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 132 1060258+ b W95 FAT32
/dev/sdb2 133 242 883575 83 Linux

- Guardamos los cambios

Command (m for help): w

- Escribiendo el sistema de archivos, para la primera particion

mkfs -t vfat /dev/sdb1

- Para la segunda particion

mkfs -t ext2 /dev/sdb2

- Revisando el sistema de archivos con fsck, no debe mostrar mensaje de error

fsck -y /dev/sdb1
fsck -y /dev/sdb2

- Ahora, como ya descargamos el ISO del BT3 version USB, entonces lo montamos en otra carpeta

mount -t iso9660 -o loop /rutadelarchivo/bactrackusb.iso /ruta/montaje

- Una vez montado el ISO copiaremos las carpeta /boot y /BT3 a la primera particion del USB, para ello nos vamos a:

cd /ruta/monstaje

y luego copiamos los archivos

cp -r boot /media/disk
cp -r BT3 /media/disk

- Vamos a la ruta /media/disk

cd /media/disk

- Luego a

cd /boot/syslinux

- Y cambiamos los permisos de:

chmod 777 lilo
chmod 777 syslinux

-Modificando el archivo syslinux.cfg

vi syslinux.cfg

- Nos ubicamos en

LABEL pchanges
MENU LABEL BT3 Graphics mode with Persistent Changes
KERNEL /boot/vmlinuz
APPEND vga=0x317 initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw changes=/slax/slaxsave.dat autoexec=xconf;kdm

- y modificamos la ultima linea solo donde dice changes, al final queda asi:
[ESC] :i <--- para modificar el archivo

LABEL pchanges
MENU LABEL BT3 Graphics mode with Persistent Changes
KERNEL /boot/vmlinuz
APPEND vga=0x317 initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw changes=/dev/sdb2 autoexec=xconf;kdm

Guardamos los cambios
[ESC] :x <-- guardando cambios en vi

Se tiene que crear la carpeta changes en la segunda particion del USB (sdb2)
mkdir changes

- Retrocedemos un directorio

cd --

y en la carpeta boot hacemos un ls, mostrara algo asi:

bootinst.bat bootlilo.sh dos isolinux mt86p vesamenu.c32
bootinst.sh chain.c32 initrd.gz modules syslinux vmlinuz

Ejecutamos el script:

./bootinst.sh

- Empieza el Slax boot installer

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Welcome to Slax boot installer
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This installer will setup disk /dev/sdb1 to boot only Slax.

Warning! Master boot record (MBR) of /dev/sdb will be overwritten.
If you use /dev/sdb to boot any existing operating system, it will not work
anymore. Only Slax will boot from this device. Be careful!

Press any key to continue, or Ctrl+C to abort...

- Presiona cualquier tecla y:

Flushing filesystem buffers, this may take a while...
Setting up MBR on /dev/sdb...
The Master Boot Record of /dev/sdb has been updated.
Activating partition /dev/sdb1...
No partition table modifications are needed.
Updating MBR on /dev/sdb...
Setting up boot record for /dev/sdb1...
Disk /dev/sdb1 should be bootable now. Installation finished.

Read the information above and then press any key to exit...

- La instalacion fue satisfactoria, reinicia y listo.

Fuente: Foros de BT, gracias al usuario umattu

No hay comentarios.: