Ubuntu Live‑USB
Ich habe mir ein Vantec NexStar CX‑Gehäuse gekauft, um eine 2,5"‑HDD als externe Festplatte zu nutzen.
Da die HDD viel Platz bietet und ich oft ein Linux Live‑System brauche, um etwas zu reparieren, installierte ich Ubuntu an den Anfang dieser HDD.
Unter Ubuntu ist das mit dem „Disk Creator“ recht einfach. In Arch Linux müsste ich ein ähnliches Tool installieren oder es manuell machen – hier der manuelle Weg.
.iso‑Image von http://www.ubuntu.com/download herunterladensyslinuxundms-sysinstallierenjulio@julio-acer ~> sudo pacman -S syslinux mtools julio@julio-acer ~> yaourt ms-sysExterne HDD per USB anschließen und das Gerät mit
fdisk -lprüfen (hier/dev/sdc)julio@julio-acer ~ $ sudo fdisk -l Disk /dev/sdc: 500.1 GB, 500107862016 bytes 171 heads, 40 sectors/track, 142803 cylinders, total 976773168 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 Disk identifier: 0x000de160 Device Boot Start End Blocks Id System /dev/sdc1 2048 2099199 1048576 b W95 FAT32Sicherstellen, dass die HDD nichts Wichtiges enthält. Formatieren, eine Partition von mind. 1 GB anlegen und als bootfähig markieren.
julio@julio-acer ~> sudo fdisk /dev/sdc Command (m for help): d Selected partition 1 Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4, default 1): 1 First sector (2048-976773167, default 2048): 2048 Last sector, +sectors or +size{K,M,G} (2048-976773167, default 976773167): +1G Command (m for help): t Selected partition 1 Hex code (type L to list codes): c Changed system type of partition 1 to c (W95 FAT32 (LBA)) Command (m for help): a Partition number (1-4): 1 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: If you have created or modified any DOS 6.x partitions, please see the fdisk manual page for additional information. Syncing disks.FAT32‑Dateisystem anlegen:
julio@julio-acer ~ $ sudo mkfs.vfat -F 32 /dev/sdc1MBR neu schreiben
julio@julio-acer ~ $ sudo dd if=/dev/zero of=/dev/sdc bs=446 count=1 1+0 records in 1+0 records out 446 bytes (446 B) copied, 0.00234799 s, 190 kB/sjulio@julio-acer ~ $ sudo ms-sys -s /dev/sdc Public domain syslinux master boot record successfully written to /dev/sdcExterne HDD einhängen
julio@julio-acer ~ $ sudo mount /dev/sdc1 /media/pendrive/GRUB auf die erste Partition installieren
julio@julio-acer ~ $ sudo grub-install - -no-floppy - -root-directory=/media/pendrive/ /dev/sdc.isoeinhängenjulio@julio-acer ~ $ sudo mount -o loop ubuntu-11.04-desktop-i386.iso /media/iso/ mount: warning: /media/iso/ seems to be mounted read-only.Kernel und initrd aus dem
.isonach/bootkopierenjulio@julio-acer ~> sudo cp /media/iso/casper/{vmlinuz,initrd.lz} /media/pendrive/boot/512 MB für die Datei
casper-rwreservieren, die alle Änderungen am System speichert.julio@julio-acer ~> sudo dd if=/dev/zero of=/media/pendrive/casper-rw bs=1M count=512 512+0 records in 512+0 records out 536870912 bytes (537 MB) copied, 1.92945 s, 278 MB/sjulio@julio-acer ~> sudo mkfs.ext3 -F /media/pendrive/casper-rw mke2fs 1.41.14 (22-Dec-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 32768 inodes, 131072 blocks 6553 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=134217728 4 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304 Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 38 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.Zweite Partition erstellen, um die
.isozu speichernjulio@julio-acer ~> sudo fdisk /dev/sdc Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4, default 2): 2 First sector (2099200-976773167, default 2099200): Using default value 2099200 Last sector, +sectors or +size{K,M,G} (2099200-976773167, default 976773167): +730M Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.Dateien aus der
.isoauf die zweite Partition kopierenjulio@julio-acer ~> sudo dd if=ubuntu-11.04-desktop-i386.iso of=/dev/sdc2 1403484+0 records in 1403484+0 records out 718583808 bytes (719 MB) copied, 116.572 s, 6.2 MB/sGrub‑Menü bearbeiten
julio@julio-acer .../pendrive/boot/grub> cat menu.lst default 0 timeout 10 title Ubuntu (Live) root (hd0,0) kernel /boot/vmlinuz boot=casper file=/preseed/ubuntu.seed persistent initrd /boot/initrd.lzPlatte aushängen, BIOS auf USB‑Boot stellen und dein Live‑USB testen.