Cara Mempersiapkan Cloud Block Storage volume

Cara Mempersiapkan Cloud Block Storage volume. Ketika Anda membuat server, Anda akan diberi kata sandi. Anda perlu kata sandi untuk langkah ini. Jika Anda tidak memiliki kata sandi, buka halaman Cloud Servers di Cloud Control Panel, klik ikon roda gigi di samping nama server, dan pilih Ubah Kata Sandi.

  1. Di Detail Server Control Panel, Temukan IP address server.
  2. Gunakan SSH, log in ke server sebagai root dengan IP address and root password.
    $ ssh root@198.61.222.58
    root@198.61.222.58's password:
    
    Linux nosnetdfw 2.6.32-31-server #61-Ubuntu SMP Fri Apr 8 19:44:42 UTC 2011 x86_64 GNU/Linux
    Ubuntu 10.04 LTS
    
    Welcome to the Ubuntu Server!
    * Documentation:  http://www.ubuntu.com/server/doc
    Last login: Thu Oct 18 02:26:38 2012 from 70.114.215.201
  3. Setelah log in, cek daftar disk di dalam server. Disk volume akan muncul sebagai disk kedua. Sebagai contoh 100 GB volume sudah di buat dengan /dev/vdb.
    root@nosnetdfw:~# fdisk -l
    
     Disk /dev/vda: 42.9 GB, 42949672960 bytes
     255 heads, 63 sectors/track, 5221 cylinders
     Units = cylinders of 16065 * 512 = 8225280 bytes
     Sector size (logical/physical): 512 bytes / 512 bytes
     I/O size (minimum/optimal): 512 bytes / 512 bytes
     Disk identifier: 0x000dc852
    
       Device Boot      Start         End      Blocks   Id  System
     /dev/vda1               1        5222    41942016   83  Linux
    
     Disk /dev/vdb: 107.4 GB, 107374182400 bytes
     255 heads, 63 sectors/track, 13054 cylinders
     Units = cylinders of 16065 * 512 = 8225280 bytes
     Sector size (logical/physical): 512 bytes / 512 bytes
     I/O size (minimum/optimal): 512 bytes / 512 bytes
     Disk identifier: 0x00000000
    
     Disk /dev/vdb doesn't contain a valid partition table
    

Buat Partition disk.

  1. Jalankan perintah fdisk utility dan pastikan nama disk sudah benar.
    root@nosnetdfw:~# fdisk /dev/vdb
    
    Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
    Building a new DOS disklabel with disk identifier 0x59a4ec2c.
    Changes will remain in memory only, until you decide to write them.
    After that, of course, the previous content won't be recoverable.
    
    Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
    
    WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').
    
  2. Masukan n untuk membuat partisi baru.
  3. Masukan p untuk menjadikan primary partisi.
  4. Untuk membuat partisi disk, tekan 1.
    Partition number (1-4):
    First cylinder (1-13054, default 1):
    
  5. Untuk melanjutkan proses tekan Enter.
    Using default value 1
    Last cylinder, +cylinders or +size{K,M,G} (1-13054, default 13054):
    
  6. Tekan Enter untuk menggunakan default, 1.
    Using default value 13054
    
  7. Ketik w untuk menulis partisi.
    w
    
    The partition table has been altered!
    
    Calling ioctl() to re-read partition table.
    Syncing disks.
    
  8. Lihat daftar disk nya lagi. Cloud Block Storage volume sudah siap di gunakan sebagai /dev/vdb dan di buat partisinya di /dev/vdb1.
    root@nosnetdfw:~# fdisk -l
    
    Disk /dev/vda: 42.9 GB, 42949672960 bytes
    255 heads, 63 sectors/track, 5221 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x000dc852
    
        Device Boot      Start         End      Blocks   Id  System
    /dev/vda1               1        5222    41942016   83  Linux
    
    Disk /dev/vdb: 107.4 GB, 107374182400 bytes
    255 heads, 63 sectors/track, 13054 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x59a4ec2c
    
        Device Boot      Start         End      Blocks   Id  System
    /dev/vdb1               1       13054   104856223+  83  Linux
    

Format Disk.

Format disk. contoh file system, ext3. kamu juga bisa menggukana file system lain yang mendukung seperti ext4.

root@nosnetdfw:~# mkfs -t ext3 /dev/vdb1

mke2fs 1.41.11 (14-Mar-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
6553600 inodes, 26214055 blocks
1310702 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
800 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872

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

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

Mount Disk.

Setelah partisi dan format disk, kamu harus mount di server. Setelah Disk volume mounted, sudah bisa di gunakan.

Jalankan perintah mnt dan assign disk, contoh: volume dengan nama cbsvolume1.

root@nosnetdfw:~# mkdir -p /mnt/cbsvolume1
root@nosnetdfw:~# mount /dev/vdb1 /mnt/cbsvolume1/

Setelah volume dipasang, sistem tidak mengirim umpan balik. Namun, Anda dapat memeriksa apakah volume Anda sudah siap dengan menjalankan perintah df untuk menunjukkan ruang disk kosong Anda. Volume baru Anda tercantum terakhir di daftar drive yang tersedia.

root@nosnetdfw:~# df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/vda1             40G  632M   37G   2% /
none                  493M  136K  493M   1% /dev
none                  498M     0  498M   0% /dev/shm
none                  498M   36K  498M   1% /var/run
none                  498M     0  498M   0% /var/lock
none                  498M     0  498M   0% /lib/init/rw
none                   40G  632M   37G   2% /var/lib/ureadahead/debugfs
/dev/vdb1             99G  188M   94G   1% /mnt/cbsvolume1

Drive Anda siap digunakan dengan server Linux Anda. Namun, Anda harus mempertimbangkan untuk melakukan langkah berikut untuk memastikan volume Anda tetap ada setelah reboot server.

Catatan: Jika Anda pernah memutuskan untuk memindahkan volume ke server yang berbeda, mulailah dengan un-mount volume. Gunakan perintah unmount untuk unmount volume, dan kemudian ulangi ini Mount the volumeprocess untuk titik akhir yang baru.

Buat volume permanen.

Langkah ini opsional, tetapi itu membuat volume Anda tetap terhubung ke server Anda setelah dimulai ulang.

Tambahkan volume Anda ke informasi sistem file statis dalam file fstab.

Catatan: Pada opsi fstab Anda, tambahkan opsi _netdev. Opsi ini mencegah upaya memasang volume hingga semua jaringan berjalan.

root@nosnetdfw:~# nano /etc/fstab

#
# /etc/fstab
# Created by anaconda on Tue May 29 20:13:27 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/vda1          /               ext3    defaults,noatime,barrier=0 1 1

Sebagai contoh, tambahkan baris setelah /dev/vda1:

/dev/vdb1 /mnt/cbsvolume1 ext3 defaults,noatime,_netdev,nofail 0 2

Sekarang volume tetap di server setelah server di reboot.


Di tulis oleh: