Langsung ke konten utama

Menambahkan disk di linux via console

Menambahkan disk di linux

Penambahan dilakukan pada server virtual mesin (netmon). Penambahan tidak ditambahkan di lvm nya, tapi hanya penambahan biasa.

1. setelah dilakukan penambahan disk, booting kembali OS linuxnya

2. selanjutnya, periksa menggunakan dmesg, apakah disk yang baru saja kita tambahkan sudah dikenali atau belum
# dmesg | grep disk
RAMDISK driver initialized: 16 RAM disks of 16384K size 4096 blocksize
sd 0:0:0:0: [sda] Attached SCSI disk
sd 0:0:1:0: [sdb] Attached SCSI disk


terdapat informasi di atas, 2 scsi disk, yaitu sda dan sdb. karena sda merupakan disk yang telah ada, maka kita akan menginisialisasikan disk b.

3. buat direktory untuk mounting
# mkdir /disk

4. cek disk system

# fdisk -ls

Disk /dev/sda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0006bc68

Device Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 83 Linux
/dev/sda2 26 1958 15526822+ 8e Linux LVM

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table
Disk /dev/dm-0: 14.7 GB, 14763950080 bytes
255 heads, 63 sectors/track, 1794 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x30307800

Disk /dev/dm-1 doesn't contain a valid partition table

/dev/sdb sudah dikenali oleh linux, tapi belum memiliki tabel partisi.


5. Install tabel partisi di linux menggunakan fdisk

# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x17a21d03.
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 2610.
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)

Command (m for help):
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)

Command (m for help):
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610):
Using default value 2610

Command (m for help):
Command (m for help): v
13452 unallocated sectors

Command (m for help): p

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x17a21d03

Device Boot Start End Blocks Id System
/dev/sdb1 1 2610 20964793+ 83 Linux

Command (m for help):
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


6. Cek kembali, apakah disk telah dikenali atau belum

# fdisk -ls

Disk /dev/sda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0006bc68

Device Boot Start End Blocks Id System
/dev/sda1 * 1 25 200781 83 Linux
/dev/sda2 26 1958 15526822+ 8e Linux LVM

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x17a21d03

Device Boot Start End Blocks Id System
/dev/sdb1 1 2610 20964793+ 83 Linux
Disk /dev/dm-0: 14.7 GB, 14763950080 bytes
255 heads, 63 sectors/track, 1794 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x30307800

Disk /dev/dm-1 doesn't contain a valid partition table

terlihati di atas, tabel partisi /dev/sdb sudah dikenali oleh linux. tahap selanjutnya adalah menambahkan file systemnya


7. Format File system disk agar bisa ditulis dan dibaca

# mkfs.ext3 /dev/sdb
mke2fs 1.40.2 (12-Jul-2007)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2621440 inodes, 5242880 blocks
262144 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
160 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000

Writing inode tables: done
Creating journal (32768 blocks):
done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.


8. Petakan disk tadi pada direktory yang telah kita buat. agar nantinya kita tidak perlu repot memetakan ulang. pemetaan disk, dapat dilakukan di /etc/fstab

tambakan baris berikut di /etc/fstab
/dev/sdb /disk ext3 defaults 1 1


/dev/sdb -> disk yang akan di petakan (di mount)
/disk -> lokasi disk akan dipetakan (di mounting)
ext3 -> jenis file system yang akan digunakan
default -> opsi partisi
1 1 -> partisi akan dihidupkan pada saat system di boot.


9. jika sudah diletakkan di /etc/fstab, langkah selanjutnya adalah memanggil partisi tadi
# mount -a


10. cek apakah sudah sukses di mount atau tidak
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
14G 9.7G 3.0G 77% /
/dev/sda1 190M 13M 169M 7% /boot
tmpfs 508M 0 508M 0% /dev/shm
/dev/sdb 20G 173M 19G 1% /disk

Komentar

Postingan populer dari blog ini

Menggunakan Modem ZTE MF 622 di Ubuntu

Setelah beberapa waktu lalu saya berhasil mengutak atik modem huawei 620, Sekarang saya akan menuliskan bagaimana menggunakan modem zte mf 622 di linux. Kebetulan, linux yang saya gunakan kali ini adalah Ubuntu 8.10. Mungkin lain waktu, saya akan mencoba langkah-langkah pada tulisan ini di Fedora (sebenernya, saya lebih terbiasa dengan Fedora daripada Ubuntu), namun karena ingin mencoba distro yang digadang-gadangkan banyak komunitas sebagai distro termudah, dan terbanyak penggunanya, maka saya pun akhirnya tak dapat menahan rayuan untuk mencoba ubuntu versi terbaru ini. Oh ya, sebelumnya, saya menggunakannya di laptop saya, acer aspire 4520. dan ini adalah foto dari modem saya OK, segera kita mulai. Untuk menggunakan modem ZTE MF 622 ini, tidak banyak aplikasi yang dilibatkan. Aplikasi yang dibutuhkan antara lain wvdial, dmesg, pptp. * wvdial ini digunakan untuk memudahkan kita menggunakan modem ini. * dmesg digunakan untuk memeriksa message pada kernel apakah ketika modem ditancapkan...

Bind DNS Graph in Cacti

In My Previous tutorial, Menampilkan hasil DNS query pada cacti I tried to graph my bind dns server in cacti. At the moment, I usedBind version 4.3. By the time, ISC (Consorcium that create bind) always update this software. Usually, they update because of found bug, improve perfomance, hardware support, and other. Until now, Bind version is 10. but currently, I still use bind 9.8. it seems that, after bind 9.4, ISC change mayor update in thebind version. because of this, my tutorial for bind 9.3.4 did not compatible anymore for latest bind. I have tried to search in internet,googling, find the forum, but still not successfull.  And fortunately, 5 days ago, I tried to access cacti forum. found the new way to graph new bind version in cacti. for the forum, you can see at this link : http://forums.cacti.net/viewtopic.php?f=12&t=45926&start=0 Because of my couriousity, I tried to make graph my bind. Oh ya, I run my dns server in Linux (RHEL 5.5) I think ou can run...

Cara membangun DNS Filter (mari berantas pornografi)

Kebutuhan : 1. dns server, pilihan yang baik menggunakan powerdns, karena saya rpm base, maka silakan di download di : http://downloads.powerdns.com/releases/rpm/pdns-static-2.9.22-1.i386.rpm download powerdns sebagai authoritative server 2. linux box, pastinya. 3. database situs-situs yang ingin di blok, bisa didownload di http://urlblacklist.com/cgi-bin/commercialdownload.pl?type=download&file=bigblacklist pilih situs porno 4. web server saya asumsikan di sini, kita akan menyimpan databasenya dalam bentuk file. powerdns bisa menyimpannya dalam database, salah satu yang telah saya coba adalah mysql. namun pada tutorial ini, yang saya bahas adalah menggunakan file. di dalam database tersebut, terdapat kategori porn, nah pilih kategori tersebut. lalu pilih file domain. ide dari dns filtering ini adalah "memaksa" suatu domain, katakanlah situs porno tadi, ke suatu ip yang telah kita assign. ip tersebut, bisa di server dns filter ini. misalnya dns filter...