Good to Know Database

Toshiba NB100: Creating an USB stick for system recovery


Deutsche Fassung: www.gtkdb.de/index_7_481.html

With the following instruction you will be able to create an USB stick from the Toshiba recovery DVD to restore the Ubuntu 8.04 installation.

For the following instruction you need:
- the Toshiba NB100 recovery DVD (this howto was tested with the recovery DVD's GMR400881EU0, GMR400890EU1 and GMR400890EU2)
- an USB stick with at least 2GB (for the recovery DVD GMR400890EU2 you need a 4GB USB stick)
- a PC with a DVD drive to copy the files from the recovery DVD
- a PC with Ubuntu 8.04 (e.g. the Toshiba NB100)

First of all you should copy the files from the recovery DVD. In the following instruction I will use an ISO image of the recovery DVD. Alternatively you could copy the files from the recovery DVD into a folder on the Ubuntu 8.04 PC. In this case use the folder ~/iso to be conform with the following commands.

Before you can copy the files to the USB stick you have to create two partitions on the USB stick. Please connect the USB stick to the Ubuntu 8.04 PC.

Notice: In this case the USB stick was detected as /dev/sdc. Please adjust the following commands if your system allocate another device name to the USB stick.

If the System mounts the USB stick automatically you have to unmount the partition(s) with the following command.

georg@TOSHIBA-User:~$ sudo umount /dev/sdc[1-9]

Now we will create two partitions with fdisk on the USB stick. The first partition is the boot partition with 60MB and will be formated with FAT16. The second partition is for the image file and will be formated with Ext3. Process the following instruction step by step to create the partitions on the USB stick.

Notice: All datas on the USB stick will be deleted!

georg@TOSHIBA-User:~$ sudo fdisk /dev/sdc

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/sdc: 2063 MB, 2063597568 bytes
255 heads, 63 sectors/track, 250 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x01dee171

   Device Boot      Start         End      Blocks   Id  System

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

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

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

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

Command (m for help): p

Disk /dev/sdc: 2063 MB, 2063597568 bytes
255 heads, 63 sectors/track, 250 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x01dee171

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1           8       64228    b  W95 FAT32
/dev/sdc2               9         250     1943865+ 83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

After creating the partitions you have to format these.

georg@TOSHIBA-User:~$ sudo mkdosfs /dev/sdc1
georg@TOSHIBA-User:~$ sudo mkfs.ext3 -L recovery /dev/sdc2

To make the USB stick bootable we need the packages syslinux and mtools which you can install with the following command.

georg@TOSHIBA-User:~$ sudo apt-get install syslinux mtools

Afterwards we make the USB stick bootable with syslinux.

georg@TOSHIBA-User:~$ sudo syslinux -sf /dev/sdc1

Unplug the USB stick from the PC and connect it again. The partitions should be automatically mounted on /media/disk and /media/recovery.

Create in your personal directory a temporary directory in which we will mount the ISO image of the recovery DVD or copy the files from the DVD.

georg@TOSHIBA-User:~$ mkdir ~/iso

If you will use an ISO image, mount this with the following command.

georg@TOSHIBA-User:~$ sudo mount -o loop Recovery-DVD.iso ~/iso/

Now, change to the temporary directory and copy the required files to the boot partition on the USB stick.

georg@TOSHIBA-User:~$ cd ~/iso/
georg@TOSHIBA-User:~/iso$ cp boot.catalog isolinux.* /media/disk/
georg@TOSHIBA-User:~/iso$ cp bzImage /media/disk/vmlinuz

Create with the following command the syslinux.cfg on the boot partition.

georg@TOSHIBA-User:~/iso$ cat isolinux.cfg | sed 's/bzImage/vmlinuz/g' | sed 's/initramfs.igz/initrd.gz/g' > /media/disk/syslinux.cfg

The last file which we need for the boot partition is the ramdisk image. Because we have to modify the original ramdisk image we will create a second temporary directory and copy the ramdisk image to this directory.

georg@TOSHIBA-User:~/iso$ mkdir -p ~/initrd
georg@TOSHIBA-User:~/iso$ cp initramfs.igz ~/initrd/initramfs.img.gz

Change to the directory ~/initrd and extract the ramdisk image.

georg@TOSHIBA-User:~/iso$ cd ~/initrd/
georg@TOSHIBA-User:~/initrd$ gzip -d initramfs.img.gz

Now extract root/.xinitrc form the ramdisk image and open this file with gedit.

georg@TOSHIBA-User:~/initrd$ cpio -idv root/.xinitrc < initramfs.img
georg@TOSHIBA-User:~/initrd$ gedit root/.xinitrc

Enlarge the file as follows.

#!/bin/bash

#set X-window background color
xsetroot -solid darkslateblue

#/usr/bin/xterm

/bin/mknod /dev/sdb b 8 16
/bin/mknod /dev/sdb1 b 8 17
/bin/mknod /dev/sdb2 b 8 18
/bin/sleep 5
/bin/mkdir /cdrom
/bin/mount LABEL=recovery /mnt/cdrom
/bin/mount --bind /mnt/cdrom /cdrom

/sbin/TRW

Notice: If the USB stick is connected during the boot process, the USB stick will be available below /dev/sdb.

Notice: Depending on the used recovery DVD the image file must be available below /mnt/cdrom respectively /cdrom.

After you have modified the file, you have to add the file to the ramdisk image, compress and copy the new ramdisk image to the USB stick.

georg@TOSHIBA-User:~/initrd$ find . -name .xinitrc | cpio -o -H newc -A -O initramfs.img
georg@TOSHIBA-User:~/initrd$ gzip initramfs.img
georg@TOSHIBA-User:~/initrd$ cp initramfs.img.gz /media/disk/initrd.gz

At last you have to copy the image file to the second partition on the USB stick. Depending on the used recovery DVD the filename vary.

GMR400881EU0:

georg@TOSHIBA-User:~/initrd$ sudo cp ~/iso/Arizona-3G.000 /media/recovery/

GMR400890EU1:

georg@TOSHIBA-User:~/initrd$ sudo cp ~/iso/REV005 /media/recovery/

GMR400890EU2:

georg@TOSHIBA-User:~/initrd$ sudo cp ~/iso/Rev006.000 /media/recovery/

With the following commands you could check if all files are available on the USB stick. The following listing shows the files for the recovery DVD GMR400890EU1.

georg@TOSHIBA-User:~/initrd$ ls -la /media/disk/
total 50832
drwx------ 2 georg root    16384 2009-01-25 17:55 .
drwxr-xr-x 4 root  root     4096 2009-01-25 17:27 ..
-rwx------ 1 georg root     2048 2009-01-25 17:49 boot.catalog
-rwx------ 1 georg root 50073014 2009-01-25 17:58 initrd.gz
-rwx------ 1 georg root    11691 2009-01-25 17:49 isolinux.bin
-rwx------ 1 georg root      188 2009-01-25 17:49 isolinux.cfg
-r-x------ 1 georg root    13941 2009-01-25 10:25 ldlinux.sys
-rwx------ 1 georg root      184 2009-01-25 17:51 syslinux.cfg
-rwx------ 1 georg root  1924924 2009-01-25 17:50 vmlinuz
georg@TOSHIBA-User:~/initrd$ ls -la /media/recovery/
total 1820340
drwxr-xr-x 3 root root       4096 2009-01-25 17:49 .
drwxr-xr-x 4 root root       4096 2009-01-25 17:27 ..
drwx------ 2 root root      16384 2009-01-25 17:24 lost+found
-rwxr-xr-x 1 root root 1862178701 2009-01-25 18:04 REV005

To restore the Ubuntu system on your Toshiba NB100, plug in the USB stick, power up the machine, enter the boot menu with F12 and select the option USB Memory.


Dieser Eintrag wurde am 07.03.2009 erstellt und zuletzt am 24.01.2016 bearbeitet.

Direkter Link zu dieser Seite: http://www.gtkdb.de/index_7_544.html

[ Zur Startseite ]   [ Zur Kategorie ]


Valid XHTML 1.0 Transitional Valid CSS Valid Atom 1.0

© 2004-2016 by Georg Kainzbauer