Usb-Stick Image bearbeiten - syslinux

Du kommst mit der Installation nicht voran oder willst noch was nachfragen? Schau auch in den "Tipps und Tricks"-Bereich.
Antworten
Dirk1
Beiträge: 258
Registriert: 06.01.2007 16:13:26

Usb-Stick Image bearbeiten - syslinux

Beitrag von Dirk1 » 12.05.2010 00:35:12

Heute habe ich mit der Problematik bootfähiger USB-Sticks gekämpft und komme damit nicht so recht weiter. Liegt aber glaube ich daran, dass ich das ganze noch nicht wirklich verstanden habe.
Ich hoffe, dass jemand mir ein paar Denkanstösse geben kann.

Für einen Bootfähigen USB-Stick liegt mir eine Image-Datei mit 8 GB-Größe vor, die sich in der Art mounten lässt:

Code: Alles auswählen

mount -t vfat -o loop /home/dirk/image.img /home/dirk/disk
Da ich gerade keinen 8 GB-Stick zur Hand hatte, kam mir die Idee diese Datei mit VMWare zu booten.
Leider kann VMware auf diese Weise lediglich Iso-Images verwenden. Und das scheint doch noch etwas anderes zu sein als die vorliegende Image-Datei.

Das gemountete Verzeichnis enthält nun mehr als die Hälfte Ballast auf den gut verzichtet werden kann.
Der wesentliche Inhalt scheint mit das Verzeichnis "boot" zu sein, dass als einzigen Inhalt das Verzeichnis syslinux enthält.
Löschen des Balast hilft aber noch nicht, um die Datei in der Größe zu reduzieren.

Aus dem Szenario stellen sich mir folgende Fragen:
1. Wie kann man so ein Image in der Größe reduzieren (nachdem der Balast entfern wurde)?
2. Lässt sich als Alternative aus dem Inhalt, der sich problemlos kopieren lässt ein neues Image erstellen? Und wenn ja - wie?
3. Kann man das Image zu einem Iso-Image konvertieren, so dass es Vmware untergejubelt werden kann?
4. Kann man das Image einfach mit dd auf den USB-Stick tranferieren? Oder sind weitere Maßnahmen nötig?

Ich danke allen fürs lesen bis hier und freue mich über jeden Hinweis.

Dirk

pferdefreund
Beiträge: 3800
Registriert: 26.02.2009 14:35:56

Re: Usb-Stick Image bearbeiten - syslinux

Beitrag von pferdefreund » 12.05.2010 06:55:06

Da gabs mal für Knoppix ne Anleitung. Eventuell kannst du ja
da was ableiten. Bei mir hats funktioniert - hab jetzt immer ein
kleines Linux in der Hosentasche und das hat mir schon oft bei
Problemen geholfen.

1. Download the Knoppix 5.1.1 ISO and burn it to CD
2. Insert a 1GB or larger USB flash drive
3. Restart your Computer and boot from the Knoppix CD
4. Open up a terminal and type sudo su
5. Type fdisk -l note which drive is your USB stick (I.E: sda) Throughout this tutorial we use x as our flash drive letter. Replace x with your actual flash drive letter. For example, if your flash drive is sdb, replace x with b.
6. Type umount /dev/sdx1
7. Type fdisk /dev/sdx
1. type p to show the existing partition and d to delete it
2. type p again to show any remaining partitions (if partitions exist, repeat the previous step)
3. type n to make a new partition
4. type p for primary partition
5. type 1 to make this partition one
6. hit enter to use the default first cylinder
7. type +750M to make the partition 750 MB
8. type a to make this partition active
9. type 1 to select partition one
10. type t to change it\u2019s file system
11. type 6 to select the fat16 file system
12. type n to make another new partition
13. type p for primary partition
14. type 2 to make this the second partition
15. hit enter to use the default first cylinder
16. hit enter again to use the default last cylinder
17. type w to write the new partition table
8. Type umount /dev/sdx1 to ensure the partition is unmounted
9. Type mkfs.vfat -F 16 -n usb /dev/sdx1 to format the first partition
10. Type umount /dev/sdx2 to ensure the partition is unmounted.
11. Type mkfs.ext2 -b 4096 -L casper-rw /dev/sdx2 to format the second partition
12. Remove and reinsert your USB flash drive
13. Type mkdir /tmp/usb
14. Type mount /dev/sdx1 /tmp/usb
15. Type cd /cdrom
16. Type cp -rf KNOPPIX boot/isolinux/* /tmp/usb
17. Type cd /tmp/usb
18. Type mv isolinux.cfg syslinux.cfg
19. Type cd
20. Type umount /tmp/usb
21. Type syslinux -sf /dev/sdx1
22. Reboot your computer and set your system BIOS or Boot Menu to boot from the USB device. Save your changes and restart your PC, booting from the USB device.

You should now be able to boot Knoppix 5.1.1 via your USB stick. Proceed to use the Knoppix Persistent feature to save your changes back to the stick ;)

--=-KzPLS09R7PpyP1CWyJHF--

Dirk1
Beiträge: 258
Registriert: 06.01.2007 16:13:26

Re: Usb-Stick Image bearbeiten - syslinux

Beitrag von Dirk1 » 12.05.2010 22:51:22

Ja - super. Vielen Dank.
Die Anleitung funktioniert 1a.
Ich habe jetzt das System auf einem 4GB-Stick.
Es musste lediglich fat32 statt fat16 partitioniert/formatiert werden, da eine Datei mit mehr als 2GB dabei war.
Außerdem erforderte das System ein bestimmtes Device-Label.

Mein Fragen 1, 2, 4 sind damit erledigt - Vielen Dank soweit.

Restlos zufrieden wäre ich, wenn es jetzt noch gelingen würde, ein Iso-Image aus dem vorhandenen Material zu erstellen, mit dem sich ein VMware booten liesse.
Vielleicht lässt sich die Knoppix-Anleitung dahingehend modifizieren.

Hat dazu noch jemand eine Idee?

Benutzeravatar
Stratovarius
Beiträge: 297
Registriert: 07.04.2004 13:00:55
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: 53° 27' 20,31'' N 9° 57' 29,31'' E
Kontaktdaten:

Re: Usb-Stick Image bearbeiten - syslinux

Beitrag von Stratovarius » 13.05.2010 09:13:39

Moin

Wenn du das .img ohnehin schon gemountet hast, dann mach das doch mit "genisoimage"

Code: Alles auswählen

genisoimage -o image.iso -l /home/dirk/disk/
Evtl. musst du noch Bootparameter mit angeben, aber da musst du dich mal mit "man genisoimage" auseinander setzen :wink:

Gruß Strato

Antworten