4b42 Logo

Wissensdatenbank

Benutzerbild
08 Dezember 2015
2.234

USB Stick mit mehreren ISO Images mit Grub2 unter Linux erstellen

Inhaltsverzeichnis
fdisk -l /dev/sdb
Disk /dev/sdb: 14.7 GiB, 15733161984 bytes, 30728832 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6a66632b

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 8064 30728831 30720768 14.7G c W95 FAT32 (LBA)




Command (m for help): o

Created a new DOS disklabel with disk identifier 0xe22ac4ec.


fdisk /dev/sdb
Welcome to fdisk (util-linux 2.25.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

The backup GPT table is corrupt, but the primary appears OK, so that will be used.

Command (m for help): p

Disk /dev/sdb: 14.7 GiB, 15733161984 bytes, 30728832 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 7BB09305-BF8A-46C4-B8BE-C9C802941F45

Device Start End Sectors Size Type
/dev/sdb1 2048 30728191 30726144 14.7G Linux filesystem


Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): n
Partition number (1-128, default 1):
First sector (34-30728798, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-30728798, default 30728798):

Created a new partition 1 of type 'Linux filesystem' and of size 14.7 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.




mkfs.vfat /dev/sdb1
mkfs.fat 3.0.27 (2014-11-12)

mkdir /mnt/usb
mount /dev/sdb1 /mnt/usb/

grub-install --force --no-floppy --boot-directory=/mnt/usb/boot /dev/sdb
Installing for i386-pc platform.
installation beendet. Keine Fehler aufgetreten.

USB Stick aushängen
umount /mnt/usb/



Images


mkdir -p /mnt/usb/iso/windows/ /mnt/usb/iso/linux/


wget http://install.avira-update.com/package/rs_avira/unix/int/rescue-system.iso -O /mnt/usb/iso/linux/avira-rescue.iso

--2015-08-18 22:37:22--  http://install.avira-update.com/package/rs_avira/unix/int/rescue-system.iso
Auflösen des Hostnamen »install.avira-update.com (install.avira-update.com)«... 104.69.52.203
Verbindungsaufbau zu install.avira-update.com (install.avira-update.com)|104.69.52.203|:80... verbunden.
HTTP-Anforderung gesendet, warte auf Antwort... 200 OK
Länge: 655167488 (625M) [application/octet-stream]
In »»/mnt/usb/iso/linux/avira-rescue.iso«« speichern.

/mnt/usb/iso/linux/avira-rescue.iso 100%[==========================================================================================================================================>] 624.82M 10.29MB/s in 1m 8s

2015-08-18 22:45:30 (10.28 MB/s) - »»/mnt/usb/iso/linux/avira-rescue.iso«« gespeichert [655167488/655167488]



nano /mnt/usb/boot/grub/grub.cfg

set timeout=10
set default=0

menuentry "Avira Rescue" {
loopback loop /iso/linux/avira-rescue.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/iso/linux/avira-rescue.iso noeject noprompt splash --
initrd (loop)/casper/initrd.lz
}
menuentry "Windows 10" {
loopback loop /iso/windows/SW_DVD5_WIN_ENT_10_64BIT_German_MLF_X20-26103.ISO
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/iso/windows/SW_DVD5_WIN_ENT_10_64BIT_German_MLF_X20-26103.ISO noeject noprompt splash --
initrd (loop)/casper/initrd.lz
}

umount /mnt/usb