Operating System - Linux
1753444 Members
5135 Online
108794 Solutions
New Discussion юеВ

Linux basic administration

 
SOLVED
Go to solution
dasn
Advisor

Linux basic administration

Hi Guys,
This is my first post in Linux forum. Also I am new with Linux enviornment. I have a few basic questions regarding configuring my linux.

How do i detect what HBA is installed in my Linux host and see its firmware and stuf? I mean from command line?

How do i discover all the Hardware and Storage disks that are connected to my system? Again from command line.

How do i format and partition the disk using linux command ?

Also whats the command to see gateway configured in my system ?

Any document explaining Linux administration will be of much help to me.

Thanks in advance for all the answers.
3 REPLIES 3
Ivan Ferreira
Honored Contributor
Solution

Re: Linux basic administration

1- Normally you use a utility privided by the HBA vendor, for example, qlogic provides SanSurfer.

2- You can resiscover devices in several ways, see:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1136273

3- First, create a partition with fdisk or parted commands, then format with "mkfs -t ext3 "

4- You can see your gateway with netstat -nr, check the 0.0.0.0 destination.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
dasn
Advisor

Re: Linux basic administration

Thanks for the post. I have not understood the follwing part in device discovery...

echo "1" > /sys/class/fc_host/hostXYZ/issue_lip
echo "- - -" > /sys/class/scsi_host/hostXYZ/scan

what host xyz stands for ?
skt_skt
Honored Contributor

Re: Linux basic administration

This is my first post in Linux forum. Also I am new with Linux enviornment. I have a few basic questions regarding configuring my linux.

How do i detect what HBA is installed in my Linux host and see its firmware and stuf? I mean from command line?
lspci|grep -i Fibre
02:03.0 Fibre Channel: Emulex Corporation LP9802 Fibre Channel Adapter (rev 01)
04:04.0 Fibre Channel: Emulex Corporation LP9802 Fibre Channel Adapter (rev 01)


How do i discover all the Hardware and Storage disks that are connected to my system? Again from command line.

# echo "scsi add-single-device 1 0 0 23" >/proc/scsi/scsi
# echo "scsi add-single-device 2 0 0 23" >/proc/scsi/scsi
# cat /proc/scsi/scsi|grep 23
Host: scsi1 Channel: 00 Id: 00 Lun: 23
Host: scsi1 Channel: 00 Id: 01 Lun: 23
Host: scsi2 Channel: 00 Id: 00 Lun: 23
Host: scsi2 Channel: 00 Id: 01 Lun: 23

bash: syminq: command not found
# cd /usr/sbin/lpfc
# ll lun*
-rwxr-xr-- 1 root root 2540 Apr 11 2005 lun_scan
# ./lun_scan all
Scanning lpfc0, scsi host number : 1
Scanning Target Id 0...
Scanning Target Id 1...
Scanning lpfc1, scsi host number : 2
Scanning Target Id 0...
Scanning Target Id 1...

# powermt config

Could not find config file entry for:
volumd ID = 6006016C440D00003B3CBB0565C7D711
---------------------------------------

adding emcpoweraa
How do i format and partition the disk using linux command ?

]# fdisk /dev/emcpowerc

The number of cylinders for this disk is set to 8802.
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)

Command (m for help): p

Disk /dev/emcpowerc: 255 heads, 63 sectors, 8802 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/emcpowerc1 1 6267 50339646 83 Linux
/dev/emcpowerc2 6268 7312 8393962+ 83 Linux
/dev/emcpowerc3 7313 8357 8393962+ 83 Linux
/dev/emcpowerc4 8358 8802 3574462+ 5 Extended
/dev/emcpowerc5 8358 8580 1791216 83 Linux
/dev/emcpowerc6 8581 8802 1783183+ 83 Linux

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)

To delete the existing partition

Command (m for help): d
Partition number (1-6): 6

Command (m for help): p

Disk /dev/emcpowerc: 255 heads, 63 sectors, 8802 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/emcpowerc1 1 6267 50339646 83 Linux
/dev/emcpowerc2 6268 7312 8393962+ 83 Linux
/dev/emcpowerc3 7313 8357 8393962+ 83 Linux
/dev/emcpowerc4 8358 8802 3574462+ 5 Extended
/dev/emcpowerc5 8358 8580 1791216 83 Linux

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

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

To add a new partition

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

Command (m for help): p

Disk /dev/emcpowerc: 255 heads, 63 sectors, 8802 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/emcpowerc1 1 7777 62468721 83 Linux

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

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

# mke2fs -j -m0 /dev/emcpowerc1 (With new disks mkefs may not work until you reboot, so if it fails with mkefs try rebooting)

mke2fs 1.26 (3-Feb-2002)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
7815168 inodes, 15617180 blocks
0 blocks (0.00%) reserved for the super user
First data block=0
477 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, 7962624, 11239424

Writing inode tables:

# e2label /dev/emcpowerc1 /d/applmgr

Put the below entry in /etc/fstab

LABEL=/d/applmgr /eb_rdh4_d/applmgr ext3 defaults 1 2

# mkdir /eb_rdh4_d/applmgr

# mount /eb_rdh4_d/applmgr

Also whats the command to see gateway configured in my system ?

netstat -nr