Difference between revisions of "Remaster Ubuntu LiveUSB Menggunakan Text Mode"

From OnnoWiki
Jump to navigation Jump to search
(New page: How to make a USB flash drive function as a Ubuntu (or Kubuntu, Xubuntu, Edubuntu) Live CD. The base file system is ext3, it boots using extlinux and supports the same hardware as the Live...)
 
Line 1: Line 1:
How to make a USB flash drive function as a Ubuntu (or Kubuntu, Xubuntu, Edubuntu) Live CD. The base file system is ext3, it boots using extlinux and supports the same hardware as the Live CD. Instructions on how to update the Live CD and modify it's contents are also given. For the entire document /dev/sda is the USB device.
+
Pada bagian ini akan di jelaskan bagaimana cara membuat USB flashdisk agar berfungsi seperti LiveCD Ubuntu. File system yang digunakan adalah ext2, dia akan dibooting menggunakan extlinux dan mendukung hardware yang sama seperti LiveCD asalnya.
Introduction
 
  
Booting from a USB device is ofter faster than from CD and USB drives are easier to carry. You should know why you want and or need this. We used Kubuntu 7.04 Feisty Fawn as our image for booting and a Gentoo system for building on.
 
Making the LiveUSB
 
  
Download a copy of the latest Ubuntu ISO, at this time Feisty, store that ISO some place. Ensure that you have squashfs-tools, initrd-tools and syslinux packages installed. We will re-partition and format the USB device, copy the LiveCD contents over and tune it up with extlinux.
+
==Persiapan==
  
Re-partition and format the USB drive. Ensure that the first partition is at least 1GiB in size and marked bootable. Any remaining space can be divided as necessary. When formatting choose ext2, do not put a journaling filesystem onto the USB device.
+
* Siapkan Ubuntu ISO yang terbaru.
  
cfdisk /dev/sda
+
* Partisi dan format USB flashdisk anda.
mkfs.ext2 /dev/sda1
 
mkfs.ext2 /dev/sda2
 
  
Mount up the fresh partition and the ISO image.
+
$ fdisk /dev/sdX
 +
$ cfdisk /dev/sdX
 +
$ sudo mkfs.ext2 /dev/sdX1
  
mkdir /mnt/usb_disc
+
Mount partisi & file ISO
mount /dev/sda1 /mnt/usb_disc
 
mkdir /mnt/live_cd
 
mount -o loop /tmp/kubuntu-7.04-desktop-i386.iso /mnt/live_cd
 
cd /mnt/live_cd/
 
cp -aR casper disctree dists install pool preseed .disk /mnt/usb_disc
 
  
There is no need to copy the isolinux informations as extlinux will be used.
+
$ sudo mkdir /mnt/usb_disc
 +
$ sudo mount /dev/sdX1 /mnt/usb_disc
 +
$ sudo mkdir /mnt/live_cd
 +
$ sudo mount -o loop ubuntu-9.04-desktop-i386.iso /mnt/live_cd
  
cd /
+
Copy isi livecd ke usb flashdisk
mkdir /mnt/usb_disc/extlinux
 
extlinux -i /mnt/usb_disc/extlinux
 
  
Now edit the config file /mnt/usb_disc/extlinux/extlinux.conf to read something like this.
+
$ cd /mnt/live_cd/
 +
$ cp -aR casper dists install pool preseed .disk /mnt/usb_disc
  
DEFAULT /casper/vmlinuz
+
==Membuat extlinux==
APPEND  file=preseed/kubuntu.seed boot=casper initrd=/casper/initrd.gz ramdisk_size=1048576 root=/dev/ram0 rw quiet splash --
+
 
 +
kita tidak perlu mengcopy isi informasi isolinux karena kita akan menggunakan extlinux
 +
 
 +
$ cd /
 +
$ mkdir /mnt/usb_disc/extlinux
 +
$ extlinux -i /mnt/usb_disc/extlinux
 +
 
 +
Sekarang edit file config /mnt/usb_disc/extlinux/extlinux.conf agar berisi kira-kira sbb,
 +
 
 +
DEFAULT /casper/vmlinuz
 +
APPEND  file=preseed/kubuntu.seed boot=casper initrd=/casper/initrd.gz ramdisk_size=1048576 root=/dev/ram0 rw quiet splash --
 +
 
 +
 
 +
==Mengubah dan mengupdate isi dari ISO==
  
Modifying or Updating the Image
 
  
 
The filesystem is stored in the squashfs image and is therefore not open for direct update. Below we will mount the image, copy the contents out, chroot into that environment and perform necessary actions.
 
The filesystem is stored in the squashfs image and is therefore not open for direct update. Below we will mount the image, copy the contents out, chroot into that environment and perform necessary actions.
  
mount -o loop -t squashfs /mnt/usb_disc/casper/filesystem.squashfs /mnt/ubuntu_usb
+
$ mount -o loop -t squashfs /mnt/usb_disc/casper/filesystem.squashfs /mnt/ubuntu_usb
mkdir /tmp/ubuntu_usb_image
+
$ mkdir /tmp/ubuntu_usb_image
cp -aR /mnt/ubuntu_usb/* /tmp/ubuntu_usb_image/
+
$ cp -aR /mnt/ubuntu_usb/* /tmp/ubuntu_usb_image/
mount -t proc none /tmp/ubuntu_usb_image/proc
+
$ mount -t proc none /tmp/ubuntu_usb_image/proc
mount -o bind /dev /tmp/ubuntu_usb_image/dev
+
$ mount -o bind /dev /tmp/ubuntu_usb_image/dev
chroot /tmp/ubuntu_usb_image /bin/bash
+
 
 +
Lakukan chroot sesudah semua siap
 +
 
 +
$ chroot /tmp/ubuntu_usb_image /bin/bash
  
 
Now that we are in the new environment it can be modified in almost any possible way.
 
Now that we are in the new environment it can be modified in almost any possible way.
Line 51: Line 60:
 
Once finished then re-package the directory into a squashfs image.
 
Once finished then re-package the directory into a squashfs image.
  
cd /tmp
+
$ cd /tmp
mksquashfs ubuntu_usb_image ubuntu_usb.squashfs
+
$ mksquashfs ubuntu_usb_image ubuntu_usb.squashfs
cp ubuntu_usb.squashfs /mnt/usb_disc/casper/filesystem.squashfs
+
$ cp ubuntu_usb.squashfs /mnt/usb_disc/casper/filesystem.squashfs
 +
 
 +
USB flashdisk siap untuk digunakan
  
Now it's ready to boot!
 
  
  

Revision as of 16:34, 9 July 2009

Pada bagian ini akan di jelaskan bagaimana cara membuat USB flashdisk agar berfungsi seperti LiveCD Ubuntu. File system yang digunakan adalah ext2, dia akan dibooting menggunakan extlinux dan mendukung hardware yang sama seperti LiveCD asalnya.


Persiapan

  • Siapkan Ubuntu ISO yang terbaru.
  • Partisi dan format USB flashdisk anda.
$ fdisk /dev/sdX
$ cfdisk /dev/sdX
$ sudo mkfs.ext2 /dev/sdX1

Mount partisi & file ISO

$ sudo mkdir /mnt/usb_disc
$ sudo mount /dev/sdX1 /mnt/usb_disc
$ sudo mkdir /mnt/live_cd
$ sudo mount -o loop ubuntu-9.04-desktop-i386.iso /mnt/live_cd

Copy isi livecd ke usb flashdisk

$ cd /mnt/live_cd/
$ cp -aR casper dists install pool preseed .disk /mnt/usb_disc

Membuat extlinux

kita tidak perlu mengcopy isi informasi isolinux karena kita akan menggunakan extlinux

$ cd /
$ mkdir /mnt/usb_disc/extlinux
$ extlinux -i /mnt/usb_disc/extlinux

Sekarang edit file config /mnt/usb_disc/extlinux/extlinux.conf agar berisi kira-kira sbb,

DEFAULT /casper/vmlinuz
APPEND  file=preseed/kubuntu.seed boot=casper initrd=/casper/initrd.gz ramdisk_size=1048576 root=/dev/ram0 rw quiet splash --


Mengubah dan mengupdate isi dari ISO

The filesystem is stored in the squashfs image and is therefore not open for direct update. Below we will mount the image, copy the contents out, chroot into that environment and perform necessary actions.

$ mount -o loop -t squashfs /mnt/usb_disc/casper/filesystem.squashfs /mnt/ubuntu_usb
$ mkdir /tmp/ubuntu_usb_image
$ cp -aR /mnt/ubuntu_usb/* /tmp/ubuntu_usb_image/
$ mount -t proc none /tmp/ubuntu_usb_image/proc
$ mount -o bind /dev /tmp/ubuntu_usb_image/dev

Lakukan chroot sesudah semua siap

$ chroot /tmp/ubuntu_usb_image /bin/bash

Now that we are in the new environment it can be modified in almost any possible way.

apt-get install aircrack-ng firefox kismet exit

Once finished then re-package the directory into a squashfs image.

$ cd /tmp
$ mksquashfs ubuntu_usb_image ubuntu_usb.squashfs
$ cp ubuntu_usb.squashfs /mnt/usb_disc/casper/filesystem.squashfs

USB flashdisk siap untuk digunakan




Pranala Menarik