Difference between revisions of "Format dan Set Harddisk Label"

From OnnoWiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 13: Line 13:
 
  Disk /dev/sdb: 251.0 GB, 251000193024 bytes
 
  Disk /dev/sdb: 251.0 GB, 251000193024 bytes
  
A device name refers to the entire hard disk. For more information see Linux partition naming convention and IDE drive mappings.
+
Nama device menunjukan seluruh hardisk.
To partition the disk - /dev/sdb, enter:
+
 
 +
Untuk mempartisi disk /dev/sdb, tulis
  
 
  # fdisk /dev/sdb
 
  # fdisk /dev/sdb
Line 27: Line 28:
 
* w - write the new partition table and exit
 
* w - write the new partition table and exit
  
==Step#2 : Format the new disk using mkfs.ext3 command==
+
==Step #2 : Format the new disk using mkfs.ext3 command==
  
 
Untuk memformat partisi linux dapat menggunakan perintah
 
Untuk memformat partisi linux dapat menggunakan perintah
Line 37: Line 38:
 
  # mkfs.ext4 /dev/sdb1
 
  # mkfs.ext4 /dev/sdb1
  
==Step#3 : Mount the new disk using mount command==
+
==Step #3 : Mount the new disk using mount command==
  
 
Menempelkan ke folder /disk1 menggunakan perintah mount /dev/sdb1, sebagai berikut:
 
Menempelkan ke folder /disk1 menggunakan perintah mount /dev/sdb1, sebagai berikut:
Line 45: Line 46:
 
  # df -H
 
  # df -H
  
==Step#4 : Update /etc/fstab file==
+
==Step #4 : Update /etc/fstab file==
  
 
Buka file /etc/fstab
 
Buka file /etc/fstab
Line 70: Line 71:
 
==Pranala Menarik==
 
==Pranala Menarik==
  
 +
* [[Format dan Set Harddisk Label]]
 +
* [[Format Disk]]
 
* [[Format harddisk]]
 
* [[Format harddisk]]
 
* [[Linux Howto]]
 
* [[Linux Howto]]
 
* [[Label harddisk]]
 
* [[Label harddisk]]
 +
* [[Label FAT32]]
  
 
[[Category: Linux]]
 
[[Category: Linux]]

Latest revision as of 20:04, 29 March 2012

Bagaimana cara memformat dan mengupgrade harddisk menggunakan shell? Berikut adalah empat (4) langkah yang perlu dilakukan,


Step #1 : Partisi harddisk menggunakan perintah fdisk

Perintah berikut akan memperlihatkan semua harddisk yang terdeteksi:

# fdisk -l | grep '^Disk'

Output:

Disk /dev/sda: 251.0 GB, 251000193024 bytes
Disk /dev/sdb: 251.0 GB, 251000193024 bytes

Nama device menunjukan seluruh hardisk.

Untuk mempartisi disk /dev/sdb, tulis

# fdisk /dev/sdb

The basic fdisk commands you need are:

  • m - print help
  • p - print the partition table
  • n - create a new partition
  • d - delete a partition
  • q - quit without saving changes
  • w - write the new partition table and exit

Step #2 : Format the new disk using mkfs.ext3 command

Untuk memformat partisi linux dapat menggunakan perintah

# mkfs /dev/sdb1

atau

# mkfs.ext3 /dev/sdb1

atau

# mkfs.ext4 /dev/sdb1

Step #3 : Mount the new disk using mount command

Menempelkan ke folder /disk1 menggunakan perintah mount /dev/sdb1, sebagai berikut:

# mkdir /disk1
# mount /dev/sdb1 /disk1
# df -H

Step #4 : Update /etc/fstab file

Buka file /etc/fstab

# vi /etc/fstab

masukan data berikut:

/dev/sdb1               /disk1           ext3    defaults        1 2

Save and close the file.

Memberi Label Partisi

Kita dapat memberikan label partisi menggunakan e2label. Contoh, jika anda ingin memberikan label partisi baru dengan /backup, lakukan

# e2label /dev/sdb1 /backup

Kita juga dapat menggunakan label untuk nama partisi yang di mount menggunakan /etc/fstab:

LABEL=/backup /disk1 ext3 defaults 1 2

Pranala Menarik