Thursday, January 20, 2011

Merubah ukuran hardisk ISCSI

1. umount volume (umount /dev/sdxx)
2. restart iscsi initiator (/etc/init.d/open-iscsi restart)
3. jalankan parted (parted /dev/sdx
4. ganti tampilan unit ke sector (unit s)
5. print table partisi dan catat awal sector dan total sector (p)
6. remove partisi yang ada (rm number)
7. create partisi baru dengan awal sector sama dengan diatas: mkpart primary
8. keluar (quit)
9. cehck file system (e2fsck -f /dev/sdxx)
10 rubah ukuran files ystem ( sudo resize2fs /dev/sdxx)

selamt mencoba

Wednesday, January 19, 2011

SSH dan Rsync

1. On host_src, run this command as the user that runs scp/ssh/rsync

$ ssh-keygen -t rsa

This will prompt for a passphrase. Just press the enter key. It'll then generate an identification (private key) and a public key. Do not ever share the private key with anyone! ssh-keygen shows where it saved the public key. This is by default ~/.ssh/id_rsa.pub:

Your public key has been saved in /.ssh/id_rsa.pub

2. Transfer the id_rsa.pub file to host_dest by either ftp, scp, rsync or any other method.

3. On host_dest, login as the remote user which you plan to use when you run scp, ssh or rsync on host_src.
4. Copy the contents of id_rsa.pub to ~/.ssh/authorized_keys

$ cat id_rsa.pub >>~/.ssh/authorized_keys
$ chmod 700 ~/.ssh/authorized_keys

If this file does not exists, then the above command will create it. Make sure you remove permission for others to read this file. If its a public key, why prevent others from reading this file? Probably, the owner of the key has distributed it to a few trusted users and has not placed any additional security measures to check if its really a trusted user.
5. Rsync: synchronizing remote folders with a local machine
rsync -va user@remoteserver:/home/user/* /home/backup/user

Friday, January 14, 2011

Setting koneksi ke HP Lefthand dengan open-iSCSI di Ubuntu 10.10 *

1. di ubuntu 10.10
a. instal package open-iscsi (sudo apt-get install open-iscsi)
b. baca dan catat inititator name di /etc/iscsi/initiatorname.iscsi
ini akan di gunakan untuk membuat koneksi di lefthand

2. di Lefhand

a. Add new server dengan mengunakan initiator name tanpa passowrd.
b. buat volume dan assign ke server yang kita buat di point a.
3 di ubuntu

a. edit file /etc/iscsi/iscsid.conf
[...]
node.startup = automatic
[...]
b. Koneksi ke target (iscsiadm -m discovery -t st -p 192.168.0.1)
c. Login ke target (iscsiadm -m node --targetname "iqn.2003-10.com.lefthandnetworks:ecogreen:110:vol-ubuntu" --portal "192.168.0.1:3260" --login)
d. check harddisk > sudo Fdisk -l
dan akan terlihat tambahan hardisk (/dev/....)
e. format (mkfs.ext4 /dev/sdb1)
f. Mounting (sudo mount /dev/sdb1 /iSCSI


* catatan dari pengalaman membuat koneksi ke lefhand.