USB-Bootstick für Installation erstellen - Linux

Transcrição

USB-Bootstick für Installation erstellen - Linux
20.01.2017 10:57.
1/4
USB-Bootstick für Installation erstellen
USB-Bootstick für Installation erstellen
Möchten wir CentOS auf einem Rechner installieren, der kein CD- oder DVD-Laufwerk besitzt, so
können wir die Installation auch von einem USB-Stick aus anstossen.
SYSLINUX installieren
Für die weitere Installation benötigen wir das Paket syslinux. Wie installieren es - wenn noch nicht
bereits geschehen - via yum.
# yum install syslinux
Was uns syslinux alles mitbringt offenbart uns ein rpm -iql:
# rpm -qil syslinux
Name
: syslinux
Relocations: (not relocatable)
Version
: 3.73
Vendor: Dag Apt Repository,
http://dag.wieers.com/apt/
Release
: 1.el5.rf
Build Date: Mo 26 Jan 2009
23:59:24 CET
Install Date: Fr 30 Jan 2009 18:58:39 CET
Build Host:
lisse.hasselt.wieers.com
Group
: Applications/System
Source RPM:
syslinux-3.73-1.el5.rf.src.rpm
Size
: 2615123
License: GPL
Signature
: DSA/SHA1, Di 27 Jan 2009 00:27:58 CET, Key ID a20e52146b8d79e6
Packager
: Dag Wieers <[email protected]>
URL
: http://syslinux.zytor.com/
Summary
: Einfacher Kernel-loader, der von einem FAT Dateisystem startet
Description :
SYSLINUX is a suite of bootloaders, currently supporting DOS FAT
filesystems, Linux ext2/ext3 filesystems (EXTLINUX), PXE network boots
(PXELINUX), or ISO 9660 CD-ROMs (ISOLINUX). It also includes a tool,
MEMDISK, which loads legacy operating systems from these media.
USB-Stick vorbereiten
Als erstes bereiten wir unseren USB-Stick vor. Damit wir auch die richtige Laufwerk ändern, schauen
wir erst einmal im syslog nach, als welches Device der Stick erkannt wird.
# tail -f /var/log/messages
Oct 1 10:25:33 host kernel: usb 1-1: new full speed USB device using
uhci_hcd and address 2
Oct 1 10:25:33 host kernel: usb 1-1: configuration #1 chosen from 1 choice
Linux - Wissensdatenbank - https://dokuwiki.nausch.org/
Last update: 10.11.2010 22:58.
centos:usb-install https://dokuwiki.nausch.org/doku.php/centos:usb-install
Oct 1 10:25:34 host kernel: Initializing USB Mass Storage driver...
Oct 1 10:25:34 host kernel: scsi2 : SCSI emulation for USB Mass Storage
devices
Oct 1 10:25:34 host kernel: usbcore: registered new driver usb-storage
Oct 1 10:25:34 host kernel: USB Mass Storage support registered.
Oct 1 10:25:39 host kernel:
Vendor: 2.0
Model: USB DISK
Rev: 1100
Oct 1 10:25:39 host kernel:
Type:
Direct-Access
ANSI SCSI revision: 00
Oct 1 10:25:39 host kernel: SCSI device sdb: 1957888 512-byte hdwr sectors
(1002 MB)
Oct 1 10:25:39 host kernel: sdb: Write Protect is off
Oct 1 10:25:39 host kernel: sdb: assuming drive cache: write through
Oct 1 10:25:39 host kernel: SCSI device sdb: 1957888 512-byte hdwr sectors
(1002 MB)
Oct 1 10:25:39 host kernel: sdb: Write Protect is off
Oct 1 10:25:39 host kernel: sdb: assuming drive cache: write through
Oct 1 10:25:39 host kernel: sdb: sdb1
Oct 1 10:25:39 host kernel: sd 2:0:0:0: Attached scsi removable disk sdb
Oct 1 10:25:39 host kernel: sd 2:0:0:0: Attached scsi generic sg1 type 0
Oct 1 10:25:40 host hald: mounted /dev/sdb1 on behalf of uid 500
Partitionierung
Zunächst partitionieren wir unseren Stick mit Hilfe von fdisk. Hier legen wir eine (möglichst) große
DOS-Partition an. Die Partition wird dann auch noch mit dem Boot-Flag versehen.
# fdisk /dev/sdb
Filesystem anlegen
Als nächstes legen wir das Filesystem auf dem Stick an.
# mkdosfs /dev/sdb1
USB-Stick bearbeiten
SYSLINUX Bootloader kopieren
Als erstes kopieren wir nun den SYSLINUX-Bootloader auf den Stick.
# cat /usr/lib/syslinux/mbr.bin > /dev/sdb
# syslinux /dev/sdb1
bzw.
https://dokuwiki.nausch.org/
Printed on 20.01.2017 10:57.
20.01.2017 10:57.
3/4
USB-Bootstick für Installation erstellen
# cat /usr/share/syslinux/mbr.bin > /dev/sdb
# syslinux /dev/sdb1
Mount-Points setzen
Für die weitere Installations-/Kopierarbeit legen wir uns nun noch zwei Mountpoints an.
# mkdir /mnt/usb-disk
# mkdir /mnt/isoboot-image
Laufwerke mounten
Nun binden wir unseren USB-Stick ins System ein.
# mount /dev/sdb1 /mnt/usb-disk
Das ISO-Image der ersten Installation-CD mounten wir nun über das Loopback-Device:
# mount CentOS-5.4-i386-bin-1of6.iso /mnt/isoboot-image -o loop
Dateien kopieren
Jetzt können wir den Inhalt unserer ersten Installations-CD auf den Stick kopieren.
# cp /mnt/isoboot-image/isolinux/* /mnt/usb-disk
# grep -v local /mnt/isoboot-image/isolinux/isolinux.cfg > /mnt/usbdisk/syslinux.cfg
USB-Stick entfernen
Vor dem Entfernen des USB-Bootsticks hängen wir die zuvor angelegten Verzeichnisse aus dem
Dateisystembaum wieder aus.
# umount /mnt/usb-disk
# umount /mnt/isoboot-image
Installation mittels USB-Stick
Mit Hilfe unseres präparierten Boot-Sticks können wir nun unseren CD/DVD-losen Rechner Booten und
mit der FTP-HTTP-Installation weiter arbeiten. Am besten steckt man nach dem erfolgreichen
Bootvorgang kurz vor dem Partitionieren der Platten den USB-Stick ab.
Linux - Wissensdatenbank - https://dokuwiki.nausch.org/
Last update: 10.11.2010 22:58.
centos:usb-install https://dokuwiki.nausch.org/doku.php/centos:usb-install
From:
https://dokuwiki.nausch.org/ - Linux - Wissensdatenbank
Permanent link:
https://dokuwiki.nausch.org/doku.php/centos:usb-install
Last update: 10.11.2010 22:58.
https://dokuwiki.nausch.org/
Printed on 20.01.2017 10:57.