Tutorial ini ditujukan bagi pengguna Linux overall, tidak disarankan digunakan untuk yang masih beginner, guna menghindari kesalahan. Karena sedikit kesalahan bisa berakibat fatal. Diasumsikan bahwa kita memiliki 2 harddisk yang dipasang dalam satu komputer.
Harddisk pertama adalah /dev/hda
Harddisk kedua adalah /dev/hdc
= Harddisk yang akan diclone = Harddisk yang masih kosong
//Bila tidak ada jenis /dev/hdx maka kemungkinan harddisknya bertipe /dev/sdx, //Tergantung dari jenis harddisk kita, apakah itu SATA (sdx) atau ATA (hdx) //Misal harddisk yang ingin diformat adalah /dev/hdc
root@vijaya-desktop6:~# fdisk /dev/hdc Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable.
The number of cylinders for this disk is set to 4865. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
//Untuk menampilkan help ketik 'm' lalu enter:
Command (m for help): m Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only)
//Ketik 'n' untuk membuat partisi baru
Command (m for help): n Command action e extended p primary partition (1-4)
//Pilih jenis partisi Primary (maksimal 4 per-harddisk) atau Extended, dimana //'p' untuk Primary dan 'e' untuk Extended
p
//Pilih nomor partisi (urut):
Partition number (1-4): 1
//Biarkan dalam keadaan default
First cylinder (1-4865, default 1):
//Isikan besar partisi //Ini diasumsikan sebagai partisi '/'
Last cylinder or +size or +sizeM or +sizeK (1-4865, default 4865): +5Gb
//Kemudian buat partisi lagi
Command (m for help): n Command action e extended p primary partition (1-4)
//Jenisnya Primary
p
//Partisi dengan nomor urut ke-2
Partition number (1-4): 2 First cylinder (610-4865, default 610): Using default value 610
//Isikan besarnya, ini diasumsikan sebagai partisi '/swap'
Last cylinder or +size or +sizeM or +sizeK (610-4865, default 4865): +1Gb
//Lihat partisi yang telah dibuat
Command (m for help): p
Disk /dev/hdc: 40.0 GB, 40020664320 bytes 255 heads, 63 sectors/track, 4865 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/hdc1 1 609 4891761 83 Linux /dev/hdc2 610 732 987997+ 83 Linux
//Buat partisi satu lagi
Command (m for help): n
Command action e extended p primary partition (1-4) p Partition number (1-4): Value out of range. Partition number (1-4): 3 First cylinder (733-4865, default 733): Using default value 733 Last cylinder or +size or +sizeM or +sizeK (733-4865, default 4865): Using default value 4865
//Lihat partisi:
Command (m for help): p
Disk /dev/hdc: 40.0 GB, 40020664320 bytes 255 heads, 63 sectors/track, 4865 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/hdc1 1 609 4891761 83 Linux /dev/hdc2 610 732 987997+ 83 Linux /dev/hdc3 733 4865 33198322+ 83 Linux
//Jalankan seluruh perintah yang telah dilakukan
Command (m for help): w The partition table has been altered!
Calling ioctl() to re-read partition table. Syncing disks.
//Cek ulang dengan fdisk: //Ternyata partisi kedua harus diubah id sistemnya
root@vijaya-desktop6:~# fdisk /dev/hdc
The number of cylinders for this disk is set to 4865. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/hdc: 40.0 GB, 40020664320 bytes 255 heads, 63 sectors/track, 4865 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/hdc1 1 609 4891761 83 Linux /dev/hdc2 610 732 987997+ 83 Linux //Harus diganti nih... /dev/hdc3 733 4865 33198322+ 83 Linux
//Gunakan perintah 't' untuk mengganti system id partition:
Command (m for help): t
//Pilih partisi nomor 2 yang akan digunakan sebagai partisi 'swap':
Partition number (1-4): 2
//Beri angka 82: //Mengenai angka-angka ini bisa dipelajari dimanual fdisk
Hex code (type L to list codes): 82 Changed system type of partition 2 to 82 (Linux swap / Solaris)
//Jalankan seluruh perintah:
Command (m for help): w The partition table has been altered!
Calling ioctl() to re-read partition table. Syncing disks.
//Buat filesystem bertipe Ext3 pada /dev/hdc1 yang merupakan partisi '/':
root@vijaya-desktop6:~# mkfs.ext3 /dev/hdc1 mke2fs 1.38 (30-Jun-2005) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 611648 inodes, 1222940 blocks 61147 blocks (5.00%) reserved for the super user First data block=0 38 block groups 32768 blocks per group, 32768 fragments per group 16096 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736
This filesystem will be automatically checked every 21 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
//Buat filesystem bertipe Ext3 pada /dev/hdc3 yang merupakan partisi '/home':
root@vijaya-desktop6:~# mkfs.ext3 /dev/hdc3 mke2fs 1.38 (30-Jun-2005) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 4153408 inodes, 8299580 blocks 414979 blocks (5.00%) reserved for the super user First data block=0 254 block groups 32768 blocks per group, 32768 fragments per group 16352 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624
This filesystem will be automatically checked every 28 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. root@vijaya-desktop6:~# mkswap /dev/hdc2 Setting up swapspace version 1, size = 1011703 kB no label, UUID=2560a048-ea51-4d72-b216-585b21f768c6
//Setelah seluruh drive ter-mount, lakukan perintah 'cp -arvf' sesuai dengan fungsi dari masing-masing direktori, misal direktori '/home' dicopykan ke '/home' yang baru, sesuai dengan aturan ke
Kemudian edit /etc/fstab sesuai mount drive yang akan dijalankan.
lalu masuk perintah: # grub map (hd1) (hd0) //map root(hd0,0) setup (hd0)
Untuk mengembalikan GRUB bootloader ternyata tidak susah. Kita bisa menggunakan Live-CD dari berbagai distro. Pada kasus ini saya menggunakan Ubuntu. Cukup masuk ke Ubuntu Live-CD, lalu buka terminal, masuk sebagai root, kemudian ketikkan perintah berikut: # grub root(hd0,0) setup (hd0)
Blog ini aku buat untuk sharing ilmu Linuxku.
Memang masih banyak yang belum aku ketahui tentang Linux.
Jadi kalau ada yang mempunyai kelebihan-kelebihan mengenai ilmu Linuxnya tolong posting ke blogku.
Regards,
Jun Hay