Showing posts with label NAD710 NesWorking. Show all posts
Showing posts with label NAD710 NesWorking. Show all posts

Sunday, January 3, 2010

iSCSI/NFS on LVM on RAID5 (Software RAID) howto guide, CentOS 5.3

This is just a quid blog to show howto, cos I found there are not much on-line tutorial cover this in a easy way.

And of course, as I keep it simple, it only cover basic stuffs. Please feel free to comment and add on better approach.



## RAID ##
===============================
Links:
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch26_:_Linux_Software_RAID

= Create Partition with 'fdisk'
to create partition (with 'n')
modify the partition's label to RAID (with 't', and code is fd)
then 'w' to write the partition
repeat until the disks is done
do a 'partprobe' to make sure it's written and take effect
do 'fdisk -l' to make sure the partition tables is correct

= Assign disk to raid
mdadm -C -v /dev/md0 -l5 -n3 /dev/hdb1 /dev/hdc1 /dev/hdd1
# l5 => RAID 5, n3 => a RAID set of 3 disks
cat /proc/mdstat # make sure RAID is created. it will also show if it's sync-ing or recoverying
mdadm -D -s -v # Double check. or 'mdadm -D -s -V /dev/md0


## LVM ##
===============================
Links:
http://www.howtoforge.com/linux_lvm_p3

= Create Physical Volume(PV), Volume Group(VG) and Logical Volume(LV)
pvcreate /dev/md0 # assign "/dev/md0" as an PV
pvdisplay # make sure they're all set
vgcreate vg-raid /dev/md0 # create VG group "lvm-raid"
vgdisplay # Show the Volume Group status
lvcreate -n xStorage -L 40G vg-raid # Create a LV as xStorage, 40G from vg-raid
lvdisplay # Show Logical Volume status
ls /dev/vg-raid/xStorage # The created LV should be here..
mkfs.ext3 /dev/vg-raid/xStorage # format the LV to be used
mount /dev/vg-raid/xStorage /mnt # lets test if we could mount it. :-)
df -h # You should see it in your mounted list

## iSCSI ##
===============================
Links:
http://www.cyberciti.biz/tips/howto-setup-linux-iscsi-target-sanwith-tgt.html

= Installation
yum -y install scsi-target-utils iscsi-initiator-utils
chkconfig iscsid on
chkconfig iscsi on
chkconfig tgtd on
chkconfig --list | grep iscsi
chkconfig --list | grep tdtd
/etc/init.d/iscsi restart
/etc/init.d/tgtd restart
/etc/init.d/iscsid restart

= Configuring iSCSI Target (iSCSI Server)
tgt-setup-lun -d /dev/vg-raid/xStorage -n xStore 192.168.1.4 # create lun only accept client with IP 192.168.1.4
#*** NOTE: You can only setup lun with a device, not partition!! ***#
tgtadm --lld iscsi --op show --mode target # Show alll luns
iscsiadm --mode discovery --type sendtargets --portal 192.168.1.4 # List lun from the server
Change iptables:
iptables -I RH-Firewall-1-INPUT -p tcp -m tcp --dport 3260 -j ACCEPT # Open the port to all NIC
iptables-save > /etc/sysconfig/iptables # Save the updated rules to iptables configuration file

= Configuring iSCSI Initiator (iSCSI Client)
iscsiadm -m discovery --type sendtargets --portal 192.168.1.4 # Check if the iSCSI Target is accessable
iscsiadm -m node -T iqn.2001-04.com.NesSAN-xStore -l # -l to login to target, -u to logout
# add '--portal 192.168.1.4:3260' for specifid server
ll /dev/sd* # The new disk should be now there.
mount /dev/sdc /mnt # Lets mount it..
df -h
touch `hostname`-`date +%Y%m%d-%H%M%S` # Test if it's writable and if it's sync over the network


## NFS ##
===============================
Links:
http://www.cyberciti.biz/tips/howto-setup-linux-iscsi-target-sanwith-tgt.html


echo '
# Local Mount Name # Client Access List
/mnt 192.168.1.0/24(rw,no_root_squash,sync)
' >> /etc/exports

exportfs -a
/etc/init.d/nfs restart # Restart nfs mount

Wednesday, February 11, 2009

The VM CLone War...




= The VM Clone War =
Lately, the LUX team has been using VM a lot. And I think half of us are using Virtual Box. And we have to setup a network with VMs. Instead of installing your system one by one, you can actually clone you hard disk and add another vm. On my beloved LUX-ers requested, here is how your clone your vm HD.


=======================================================================
1. First, clone your hard disk with VBoxManage command
VBoxManage clonehd /media/NesEeeStorage/VMs/vm-Fedora10c.vdi /media/NesEeeStorage/VMs/vm-Fedora10a.vdi

2. Add your new vm with a different name.
=======================================================================
Here is the capture....
=======================================================================
[bossanesta@NesEeeF10 VMs]$ VBoxManage clonehd /media/NesEeeStorage/VMs/vm-Fedora10c.vdi /media/NesEeeStorage/VMs/vm-Fedora10a.vdi
VirtualBox Command Line Management Interface Version 2.1.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

0%...10%...20%...30%...40%...
=======================================================================


=== NOTES ===

= if your VM's HDs are in different path =
The VBoxManage is kinda weired. When you run it, it will only search vm's harddisks in default path. So, if you changed your vm location like I do. Use full path just like me.

= creating VM with command
You can do it in GUI mode or.. if you wanna be a VBox-Guru, try "VBoxManage create". "man VBoxManage" is your friend.

= about VM networking
I've been trying to create a VM network. well.. got a lot of trouble.. @@ but i found there is a typo in VBox's office tutorial . It drove me crazy, cos I didn't expect a simple mistake from an official site while a lot of people I know got help from that page. So, I was trying to yum install this and yum install that.. My ubuntu's vbox is not working now, cos somehow I got a wrong version of vbox. Anyway, here is the typo....

PATH=/sbin:/usr/bin:/bin:/usr/bin <== the last one should be "/usr/sbin".

= It's cross platform!
Do not forget that VBox is cross platform! It means, If you have a dual or tri or quad boot like me, you can run your VM in Linux, Windows, Solaris, OSX!! That's the reason why I'm using it instead of KVM althought KVM provide a better control.

= Cloning is good news for lazy sys admin
It's always good to keep a copy of your VM. Because if you don't have enough time to trouble shot your VM and things happened. You can always go back to the one your clone before. I have been using VM for 1 months, created over 10 VMs so far in 3 tri-boot laptops. And I found that sometime the VM's hd got problem if you restart a lot. And I always just use another one, cos it's faster than scanning the HD.

= DO NOT UPGRADE!!! =
I not a big fans of auto update. First newer dosen't mean better, second, you may have a big chance that things are not working. That including linux kernel and vbox. When I was trying to install VBoxManage, I downloaded the package from repo.. and.. my vbox dosen't work any more. I guess it happened to Mohak(vyas) also. And he used the windows way to fix this linux problem --> uninstall and install. And it worked... @@ Looks like I'll do the same thing... I'm putting this in the last point, cos I dun want ppl know that I'm using the "windows way" to trouble shot.. and u know.. ususally people dun even bother read the whole blog. ;-p

Saturday, November 22, 2008

NAD710 Lab 09 - IP Routing

Network Diagram Two by Milton Neto Paiva


Introduction
For NAD710 lab09, Patricia, Milton, Mohak and myself did this lab together. Since Patricia and Milton already has two excellent step by step guide for routing between three network. I think it would be better to me to descript what problem we face instead of having another network routing guide.


Concept
The purpose of this lab is to setup fully routed network between 3 different sub-network with 5 Fedora Linus computers. Two of the computers will act as an router, which will provide routing between networks. Two of them are just host/client. Our network supposed to be fully routed, each host will be able to access each other, including ssh.


Step by Step
First of all, we sit down and design the network diagram. As the routing diagram shown, that is the design of our network. Each network will have different subnet mask and ip map. And routers has two NIC with two differetn IP. And host will only have one NIC and IP.

Then we set up each network's host and router and make sure it can ping to each other. This can be easily done with "ifconfig" and "route add". Then we set routes between the network 11.0.0.0/8 to 172.17.0.0/16 and the network of 172.17.0.0/16 to 192.168.2.0/24. Once the pair of Host A, Host B and Host B, Host C establish the connection. We can move on next.

The next step is the most important step. We will connect the whole network together. Again, we add another route in each router, so they will connection between three network. After the routing table is update, test the connection between them. Then the routing task is finished.


Problem That We Faced
Since we use command to add routing and ip, we had some human mistake in adding route. We mistyped a number in one of the router. So, we could not route to each other, that happened in the router ip 192.168.0.254. It cost us almost half an hour to solve this problem. We could reduce the time on this trouble shooting if we check the routing table and IP step by step. But, like what Professor John Selmys said, "If you never make mistake, you'll never learn."


What we learn about this lab
So, the task is done and what we've learn? This is actually a very partical lab. In this age, almost every one has a computer and you may have more than one at your work place. Sometime for advanced secured network, you may need to set a network that able to access internet and between your local network, but there are no access from WLAN. And some situation is you may only want one or two computer/server that accept connection (e.g.. ssh, sftp) from the internet. And that would be a real task.

Network/Routing Diagram One by Patricia Constantino Sosa

Monday, November 17, 2008

0.2 Relase Contributions - De-Luxer Community

It's almost the end of semester. I'm so glad that I'm doing LUX in Seneca@york. All my classmates are friendly and nice. We're like a small group of community, we help each other to learn and acheive our goals.

I'm so glad to meet Milton and Mohak. They helped me a lot on my LUX Project and the arcade project. Of course, I gave them some help too. Beside them, I also helped Steven Liang a little bit on his project. Since we don't speak perfect English, we try to help each other to understand what we miss in class and things for our projects.

I heard that next sem is gonna be tough on project. I've gotta finish my functions this month, so I can work on the GUI next sem.. ^^

And good luck on your project guys...

Thursday, October 30, 2008

WDMT over network?

Today, we were learning Samba in NAD710. Its great. I was so surprised there are a lot of options in Samba.

Anyway, the reason why i am bloggin it is, Raymond Chan told me that maybe I should use this in the project. Em... i think it's possible... cos supporting networking is just having one more module on the function that make sure the networking path is working.

It's "do-able". But i think it has to support post-install for sure...

Anyway.. do the first thing first.. ^^ code the basic function next week.

Tuesday, October 7, 2008

MUM!!! I'm on TV!!! (Live)





Hey, mum!! I'm on tv!! well.. maybe youtube. So, at this moment, rpm speech is going in the class. ^^ BRB for more update

Sunday, September 7, 2008

NAP710 Lab1

1. What is the kernel version of Linux on matrix?
2.6.18.8-0.5-default

2. What is the IP address and MAC address of the Linux machine on matrix?
MAC: 00:0E:0C:74:9E:35
IP: 192.168.1.52

3. What is the network mask on matrix?
Mask:255.255.255.0

4. What are the network addresses of the Linux machine? (there should be three networks)
I can only find two..
Local Loopback: 127.0.0.1
eth0: 192.168.1.52

5. What is the IP address of the gateway for the Linux machine on matrix?
192.168.1.254

6. What is the command to display all the currently loaded kernel modules?
lsmod

7. Where is the file for the kernel module called "e100"?
tnchan@matrix:~> /sbin/modinfo e100
filename: /lib/modules/2.6.18.8-0.5-default/kernel/drivers/net/e100.ko

8. What is the MAC address for the network device that has the IP address 192.168.1.254?
192.168.1.254: 00:0E:0C:7F:84:6F

9. How do you display all the physically network addresses known by a Linux machine?
/sbin/arp -a

10. What is the MAC address of the network device on the Linux machine on matrix?
IP: 192.168.1.52

Thursday, September 4, 2008