Format Hard Disk (revisi 141117-r01KI)

Return to Lab 09

First Part: Make a partition and disk formatting tutorial

  1. Tiny Core Ova which is used for this class has 5 hard disks that can be seen at Virtual Box setting. However, we currently use only one partition. In this lab, we will study the commands that are useful for hard disk operation.
  2. When you open Tiny Core, you can access another hard disk partition by mounting it. But for this time if you mount another partition, you will just see one hard disk partition because another virtual hard disks do not have file system yet.
  3. Please look at the device disk list in Tiny Core by using command : cat /proc/partitions|grep sd. You will see the output similar with the following picture. The five virtual hard disks are sda, sdb, sdc, and sdd.
  4. Please save the output above in "hasil.txt" by using:
    $cat /proc/partitions|grep sd > hasil.txt
  5. sda,*sdb*, sdc, sdd, and sde are well known as block device file. Those file are representation of I/O devices such as hard disk, flash disk, memory card, and CD/DVD ROM. Those devices write the data in block in hard disk. Block is byte sequence with a particular size like 512 bytes or 4 kilobytes.
  6. Block device's file is located in /dev. Please cek for sda's file in /dev with command ls -lah /dev/sda. You will see:
  7. Please save the output into "hasil.txt".
    $ls -lah /dev/sda* >> hasil.txt
  8. Please look at the step 6. You will not only see /dev/sda in the output but also /dev/sda1 - /dev/sda9. From that we can say that Tiny Core support the creation of 9 partition in one disk. Partition is a method for divide the hard disk's space. We can format the disk partition with a file system.
  9. A new formatted partition must be mounted before it can be used. Please use the command /dev/sda1 to show the partition mount point.
    $cat /proc/mounts | grep sda1
  10. From the command above, we will get the output similar with the following picture below. We can see that /dev/sda1 is mounted to /mnt/sda1's directory.
  11. Please save the output into "hasil.txt"
    $cat /proc/mounts | grep sda1 >> hasil.txt
  12. Now, we using sdb device to make a partition. Please use command sudo fdisk /dev/sdb so that you can entry the fdisk console.

    TIPS: If you get wrong in the previous step, please use command "q" to cancel the process.
  13. Please make a new partition which is "primary partition" by sung command "n" then p at the fdisk console.
  14. Please put 1 for partition number and first cylinder. Please put your own size for last cylinder. For this tutorial we will use the whole disk intu one partition so please put +2140M for last cylinder. Press enter button after answer the last question.
  15. Please check your partition by typing p to fdisk console. You will get the output similar witj picture below. The partition with name /dev/sdb1 has been created in /dev/sdb. After that, please write your change by using command w.
  16. Please format your new partition by using file system ext4 and change the name with LATIHAN. You can use the following command:
    $sudo mkfs.ext4 -L LATIHAN /dev/sdb1
  17. Please wait until the process is finish.
  18. Please try to mount your new formatted hard disk.
    $sudo mkdir /mnt/sdb1
    $sudo mount /dev/sdb1 /mnt/sdb1

    Command above is use for access Mount Tool, then please click sdb1 (unmounted)

    so that it change into green.
  19. Please go to /mnt/sdb1. Download the following file into your new partition.
    $ cd 
    $ wget
    $ sudo cp TinyCore-current.iso /mnt/sdb1/
    $ cd /mnt/sdb1
  20. Please do the command below to save the data and the result into sdb1
    $ ls -al >> /home/tc/[KELAS]/[NPM]/Lab09/hasil.txt
    $ sudo /sbin/blkid | grep /dev/sdb >> /home/tc/[KELAS]/[NPM]/Lab09/hasil.txt
  21. Please look the content of "hasil.txt".
    $ cd /home/tc/[KELAS]/[NPM]/Lab09
    $ cat hasil.txt

Second Part: Assignment

  1. Please repeat the steps 12-20 above to process sdc device. You must create two partition with specification as following:
    1. sdc1: type: primary, partition number: 1, size: cylinder 1-130, file system: ext3, name: your student ID,
    2. sdc2: type: primary, partition number: 2, size: cylinder 132-261, file system: ext3, name: your TOKEN,

BONUS: You will gain 5% bonus if you make sdc2 partition with extended logical type.

Return to Lab 09
Return to Wiki