Following procedure guides you on how to update a Red Hat Linux server from RHEL 6.3 to 6.4.
1. Mount the file RHEL6.4-Server-20130130.0-x86_64-DVD1.iso on a directory.
# mount -o loop RHEL6.4-Server-20130130.0-x86_64-DVD1.iso /media/rhel6/
2. Copy the repo file from the ISO to local repos.d directory.
# cp /media/rhel6/media.repo /etc/yum.repos.d/rhel6.repo
3. Modify the file /etc/yum.repos.d/rhel6.repo
baseurl=file:///media/rhel6/
4. Update the OS
# yum update
5. Unmount the file system
# umount /media/rhel6
6. Remove the temporary repo file
# rm /etc/yum.repos.d/rhel6.repo
7. Reboot the server
8. Check the OS version.
# cat /etc/redhat-release
Friday, December 18, 2015
Managing Activation Key using Hammer commands
1. To create an activation key,
# hammer activation-key create --name "rhel70ak" \
--content-view "rhel70cv" --lifecycle-environment Library \
--organization "MyCompany"
2. To update the release version on an activation key,
# hammer activation-key update --release-version "7Server" \
--organization "MyCompany" --name "rhel70ak"
3. To display and find out the ID of the subscriptions available,
# hammer subscription list --organization "MyCompany"
4. To list and find out the ID of the activation keys,
# hammer activation-key list --organization "MyCompany"
5. Attach the subscription to the activation key,
# hammer activation-key add-subscription --id 2 --subscription-id 12
6. To list the subscriptions attached to an activation key,
# hammer activation-key subscriptions --id 2 --organization "MyCompany"
# hammer activation-key create --name "rhel70ak" \
--content-view "rhel70cv" --lifecycle-environment Library \
--organization "MyCompany"
2. To update the release version on an activation key,
# hammer activation-key update --release-version "7Server" \
--organization "MyCompany" --name "rhel70ak"
3. To display and find out the ID of the subscriptions available,
# hammer subscription list --organization "MyCompany"
4. To list and find out the ID of the activation keys,
# hammer activation-key list --organization "MyCompany"
5. Attach the subscription to the activation key,
# hammer activation-key add-subscription --id 2 --subscription-id 12
6. To list the subscriptions attached to an activation key,
# hammer activation-key subscriptions --id 2 --organization "MyCompany"
Managing Content views using Hammer commands:
1. To list all the available repositories,
# hammer repository list --organization "MyCompany"
---|-------------------------------------------------------------------|---------------------------------|--------------|---------------------------------------------------------------------------------
ID | NAME | PRODUCT | CONTENT TYPE | URL
---|-------------------------------------------------------------------|---------------------------------|--------------|---------------------------------------------------------------------------------
1 | Red Hat Enterprise Linux 7 Server Kickstart x86_64 7.1 | Red Hat Enterprise Linux Server | yum | https://cdn.redhat.com/content/dist/rhel/server/7/7.1/x86_64/kickstart
4 | Red Hat Enterprise Linux 7 Server - RH Common RPMs x86_64 7Server | Red Hat Enterprise Linux Server | yum | https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/rh-common/os
2 | Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server | Red Hat Enterprise Linux Server | yum | https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/os
3 | Red Hat Satellite Tools 6.1 for RHEL 7 Server RPMs x86_64 | Red Hat Enterprise Linux Server | yum | https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/sat-tools/6....
---|-------------------------------------------------------------------|---------------------------------|--------------|---------------------------------------------------------------------------------
2. To create a content view,.
# hammer content-view create --name "rhel70cv" \
--description "RHEL 7.0 Content View" --organization "MyCompany"
3. To add the required repositories to the content view,
# hammer content-view update --repository-ids 4,2,3 --name "rhel70cv" --organization "MyCompany"
4. Publish the content view so that its contents are locked,
# hammer content-view publish --name "rhel70cv" --organization "MyCompany"
Basic configuration of Satelite 6.1 using Hammer commands
Introduction:
Hammer is the Satellite 6's command line tool.
You can use hammer to manage entities in Satellite instead of using GUI.
To run hammer you need to provide authentication, you can specify the username and password each time,
# hammer -u admin -p
or simple edit /etc/hammer/cli.modules.d/foreman.yml
:foreman:
:enable_module: true
:host: 'https://localhost/'
:username: 'admin'
:password: ''
If you ever forget the password, you can always reset as below
# foreman-rake permissions:reset
Reset to user: admin, password: qwJxBptxb7Gfcjj5
Here are some basic hammer commands keeping in mind that you have stored the satellite credentials in foreman.ym
1, To create an organization for your Satellite
# hammer organization create --name "MyCompany"
2. To create a location for your organization
# hammer location create --name "Chennai"
3. To import the manifest that you've downloaded from Redhat site.
# hammer subscription upload --organization "MyCompany" --file /tmp/manifest-file
4. To display all the repository sets available.
# hammer repository-set list --organization "MyCompany"
5. To enable a repository
# hammer repository-set enable --organization "MyCompany" \
--product "Red Hat Enterprise Linux Server" \
--name "Red Hat Enterprise Linux 7 Server (RPMs)" --releasever "7.0" --basearch "x86_64"
6. To disable a repository
# hammer repository-set disable --organization "MyCompany" \
--product "Red Hat Enterprise Linux Server" \
--name "Red Hat Enterprise Linux 7 Server (RPMs)" --releasever "7.0" --basearch "x86_64"
7. To synchronize a repository
# hammer repository synchronize --product "Red Hat Enterprise Linux Server" \
--name "Red Hat Enterprise Linux 7 Server (RPMs)" --organization "MyComapany"
Or use the repo id
# hammer repository synchronize --id 1 --organization "MyCompany"
8. Create the Development and Production life cycle environments
# hammer lifecycle-environment create --name "Development" \
--description "Development" --organization "MyCompany" --prior "Library"
# hammer lifecycle-environment create --name "Production" \
--description "Production" --organization "MyCompany" --prior "Development"
Hammer is the Satellite 6's command line tool.
You can use hammer to manage entities in Satellite instead of using GUI.
To run hammer you need to provide authentication, you can specify the username and password each time,
# hammer -u admin -p
or simple edit /etc/hammer/cli.modules.d/foreman.yml
:foreman:
:enable_module: true
:host: 'https://localhost/'
:username: 'admin'
:password: '
If you ever forget the password, you can always reset as below
# foreman-rake permissions:reset
Reset to user: admin, password: qwJxBptxb7Gfcjj5
Here are some basic hammer commands keeping in mind that you have stored the satellite credentials in foreman.ym
1, To create an organization for your Satellite
# hammer organization create --name "MyCompany"
2. To create a location for your organization
# hammer location create --name "Chennai"
3. To import the manifest that you've downloaded from Redhat site.
# hammer subscription upload --organization "MyCompany" --file /tmp/manifest-file
4. To display all the repository sets available.
# hammer repository-set list --organization "MyCompany"
5. To enable a repository
# hammer repository-set enable --organization "MyCompany" \
--product "Red Hat Enterprise Linux Server" \
--name "Red Hat Enterprise Linux 7 Server (RPMs)" --releasever "7.0" --basearch "x86_64"
6. To disable a repository
# hammer repository-set disable --organization "MyCompany" \
--product "Red Hat Enterprise Linux Server" \
--name "Red Hat Enterprise Linux 7 Server (RPMs)" --releasever "7.0" --basearch "x86_64"
7. To synchronize a repository
# hammer repository synchronize --product "Red Hat Enterprise Linux Server" \
--name "Red Hat Enterprise Linux 7 Server (RPMs)" --organization "MyComapany"
Or use the repo id
# hammer repository synchronize --id 1 --organization "MyCompany"
8. Create the Development and Production life cycle environments
# hammer lifecycle-environment create --name "Development" \
--description "Development" --organization "MyCompany" --prior "Library"
# hammer lifecycle-environment create --name "Production" \
--description "Production" --organization "MyCompany" --prior "Development"
Installation of Satellite 6.1 in Redhat Linux
Following procedure will guide you thru the installation of Satellite 6.1 by downloading packages thru Redhat network.
1. First of all, You need to register the server in Redhat network and then configure proxy for internet connectivity.
Please refer
http://linuxulagam.blogspot.in/2015/12/how-to-register-red-hat-linux-server-in.html
2. Make sure you create the following file systems (space calculation was based on using just RHEL 6 repositories) on the server that is meant for Satellite.
File systems:
/var/lib/pgsql - 2GB
/var/lib/mongodb - 20 GB
/var/lib/pulp - 400GB
3. Enable the repositories requried to download Satellite packages.
# subscription-manager repos --enable rhel-6-server-rpms --enable rhel-server-rhscl-6-rpms --enable rhel-6-server-satellite-6.1-rpms
3. Install Katello (Satellite)
# yum install katello
# katello-installer --katello-proxy-url=http://10.11.12.13 --katello-proxy-port=8081
Installing -ebug: Coprefix: /unicast [99%] [.............................................................................Installing Done [100%] [.................................................................................]
Success!
* Katello is running at https://myserver.mycompany.net
Initial credentials are admin / 6VcVnLn5uvzM
* Capsule is running at https://myserver.mycompany.net:9090
* To install additional capsule on separate machine continue by running:"
capsule-certs-generate --capsule-fqdn "$CAPSULE" --certs-tar "~/$CAPSULE-certs.tar"
The full log is at /var/log/katello-installer/katello-installer.log
4. You need to register the server as satellite in Redhat network by logging into access.redhat.com
or thru the following command
5. Download the manifest file
6. Do the rest of the configuration like the creation of Organization, Location, import manifest, enable & sync repositories, ...
1. First of all, You need to register the server in Redhat network and then configure proxy for internet connectivity.
Please refer
http://linuxulagam.blogspot.in/2015/12/how-to-register-red-hat-linux-server-in.html
2. Make sure you create the following file systems (space calculation was based on using just RHEL 6 repositories) on the server that is meant for Satellite.
File systems:
/var/lib/pgsql - 2GB
/var/lib/mongodb - 20 GB
/var/lib/pulp - 400GB
3. Enable the repositories requried to download Satellite packages.
# subscription-manager repos --enable rhel-6-server-rpms --enable rhel-server-rhscl-6-rpms --enable rhel-6-server-satellite-6.1-rpms
3. Install Katello (Satellite)
# yum install katello
# katello-installer --katello-proxy-url=http://10.11.12.13 --katello-proxy-port=8081
Installing -ebug: Coprefix: /unicast [99%] [.............................................................................Installing Done [100%] [.................................................................................]
Success!
* Katello is running at https://myserver.mycompany.net
Initial credentials are admin / 6VcVnLn5uvzM
* Capsule is running at https://myserver.mycompany.net:9090
* To install additional capsule on separate machine continue by running:"
capsule-certs-generate --capsule-fqdn "$CAPSULE" --certs-tar "~/$CAPSULE-certs.tar"
The full log is at /var/log/katello-installer/katello-installer.log
4. You need to register the server as satellite in Redhat network by logging into access.redhat.com
or thru the following command
# subscription-manager register --type=satellite5. Download the manifest file
6. Do the rest of the configuration like the creation of Organization, Location, import manifest, enable & sync repositories, ...
How to register a Red hat Linux server in Red hat network ?
You need to make sure your server is able to talk to Red hat network thru internet.
For this, you need to add the proxy IP address (provided by your network team) on the file /etc/rhsm/rhsm.conf.
Add the details like proxy ip, port number, user name and password in the file rhsm.conf.
# vi /etc/rhsm/rhsm.conf
proxy_hostname = x.x.x.x
proxy_port = 8080
proxy_user =
proxy_password =
You may need to add a user name and password for proxy connectivity.
However if the network admin adds your server IP address to the bypass list, then there may be no need to use user name and password for internet connectivity.
Finally you need to register (subscribe) your server in Red hat network.
2. Register the server in Redhat network.
# subscription-manager register --username
The system has been registered with id: 2a2334s3-3254-13e3-8r7e-2435324c5e45
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status: Subscribed
Sunday, December 2, 2012
YUM Repository
How to create YUM repository on a RHEL Server :
1. Insert and then mount the cdrom as /media
# mount /dev/cdrom /media
2. Create a directory called /myrepo
# mkdir /myrepo
3. Copy all the RPMs from the cd to the local directory
# cp /media/Packages/*.rpm /myrepo
4. Copy the xml file from the CD to the local directory
# cp /media/Server/repodata/6b21fc619d1eccd6fb49237c666f0ce4c68f-comps-rhel-Server.xml /myrepo
5. Create a YUM repository based on the cdrom. This can be done by creating the below file.
# cat > /etc/yum.repos.d/myrepo
[myrepo]
name=rhel6
baseurl=file:///media
enabled=1
gpgcheck=0
^d
Now you can install any rpm using yum command which will install the software from /media ie., your cdrom
6. Install createrepo rpm ( including its dependents)
# yum install createrepo
7. Create a local repository
# cd /myrepo
# createrepo -g 96b21fc619d1eccd6fb49237c666f0ce4c68f-comps-rhel-Server.xml -x /myrepo
8. Finally you have to change the below file
/etc/yum.repos.d/myrepo :
[myrepo]
name=rhel6
baseurl=file:///media
enabled=1
gpgcheck=0
9. Now you have finished creating a local repository on your server.
You can install any individual rpm or groups by just invoking yum command.
Here are few commands to show different ways to use yum command:
1. To install an individual rpm and also install its dependents
# yum install package-name
2. To install a group of rpms
# yum groupinstall group-name
3. To list all the packages available in the repository
# yum list
4. To list only the packages that are installed
# yum list installed
5. To list all the groups available in the repository
# yum grouplist
6. To display information of a group of packages
# yum groupinfo group-name
7. To display information of a package
# yum info package-name
8. To uninstall a package
# yum remove package-name
9. To uninstall a group of packages
# yum groupremove group-name
10. To update a package
# yum update package-name
11. To update a group of packages
# yum update group-name
12. To search for a package using a keyword
# yum search keyword
13. To know which package a file belongs to
# yum provides /usr/bin/screen
14. To list your current (enabled) yum repositories
# yum repolist
15. To list all yum repositories
# yum repolist all
Few other info,
yum conf file: /etc/yum.conf
yum repo file: /etc/yum.repos.d/
You still have a lot to learn about YUM. So keep reading.
1. Insert and then mount the cdrom as /media
# mount /dev/cdrom /media
2. Create a directory called /myrepo
# mkdir /myrepo
3. Copy all the RPMs from the cd to the local directory
# cp /media/Packages/*.rpm /myrepo
4. Copy the xml file from the CD to the local directory
# cp /media/Server/repodata/6b21fc619d1eccd6fb49237c666f0ce4c68f-comps-rhel-Server.xml /myrepo
5. Create a YUM repository based on the cdrom. This can be done by creating the below file.
# cat > /etc/yum.repos.d/myrepo
[myrepo]
name=rhel6
baseurl=file:///media
enabled=1
gpgcheck=0
^d
Now you can install any rpm using yum command which will install the software from /media ie., your cdrom
6. Install createrepo rpm ( including its dependents)
# yum install createrepo
7. Create a local repository
# cd /myrepo
# createrepo -g 96b21fc619d1eccd6fb49237c666f0ce4c68f-comps-rhel-Server.xml -x /myrepo
8. Finally you have to change the below file
/etc/yum.repos.d/myrepo :
[myrepo]
name=rhel6
baseurl=file:///media
enabled=1
gpgcheck=0
9. Now you have finished creating a local repository on your server.
You can install any individual rpm or groups by just invoking yum command.
Here are few commands to show different ways to use yum command:
1. To install an individual rpm and also install its dependents
# yum install package-name
2. To install a group of rpms
# yum groupinstall group-name
3. To list all the packages available in the repository
# yum list
4. To list only the packages that are installed
# yum list installed
5. To list all the groups available in the repository
# yum grouplist
6. To display information of a group of packages
# yum groupinfo group-name
7. To display information of a package
# yum info package-name
8. To uninstall a package
# yum remove package-name
9. To uninstall a group of packages
# yum groupremove group-name
10. To update a package
# yum update package-name
11. To update a group of packages
# yum update group-name
12. To search for a package using a keyword
# yum search keyword
13. To know which package a file belongs to
# yum provides /usr/bin/screen
14. To list your current (enabled) yum repositories
# yum repolist
15. To list all yum repositories
# yum repolist all
Few other info,
yum conf file: /etc/yum.conf
yum repo file: /etc/yum.repos.d/
You still have a lot to learn about YUM. So keep reading.
Wednesday, August 1, 2012
Access Control List
Access Control List (ACL) is a list of permissions attached to a file or directory.
Pre-Requisite:
To set ACL for any file or directory, the underlying filesystem should be ACL enabled which you have to mention while mounting the filesystem.
To make it permanent, you need to edit /etc/fstab and add "acl" under options field for the specific filesystem.
Ex:
LABEL=/data /data ext3 defaults,acl 1 2
After modifying the /etc/fstab file, you have to remount the filesystem.
# mount -o remount /data
Now we can start setting the ACL on any file or directory located under /data filesystem.
To set full permission for a user on /data,
# setfacl -m u:user1:rwx /data
To set only read/execute permission for a user on /data/file1,
# setfacl -m u:user1:r-x /data/file1
To set full permission for dba group on /data/oracle directory,
# setfacl -m g:dba:rwx /data/oracle
To set full permission to user1 and group1 on /data directory,
# setfacl -m u:user1:rwx,g:group1:rwx /data
To revoke the ACL for a user on /data,
# setfacl -x u:user1 /data
To view the current ACL values on /data,
# getfacl /data
To revoke write access for all users and groups on a file,
# setfacl -m m::rx /data/file1
Above command will set the mask value as "r-x".
To copy the acl of one file to another,
# getfacl file1 | setfacl --set-file=- file2
You can also use the below method to copy the acl rights between files.
$ getfacl /data/file1 > acls.txt
$ setfacl -f acls.txt /data/file2
Pre-Requisite:
To set ACL for any file or directory, the underlying filesystem should be ACL enabled which you have to mention while mounting the filesystem.
To make it permanent, you need to edit /etc/fstab and add "acl" under options field for the specific filesystem.
Ex:
LABEL=/data /data ext3 defaults,acl 1 2
After modifying the /etc/fstab file, you have to remount the filesystem.
# mount -o remount /data
Now we can start setting the ACL on any file or directory located under /data filesystem.
To set full permission for a user on /data,
# setfacl -m u:user1:rwx /data
To set only read/execute permission for a user on /data/file1,
# setfacl -m u:user1:r-x /data/file1
To set full permission for dba group on /data/oracle directory,
# setfacl -m g:dba:rwx /data/oracle
To set full permission to user1 and group1 on /data directory,
# setfacl -m u:user1:rwx,g:group1:rwx /data
To revoke the ACL for a user on /data,
# setfacl -x u:user1 /data
To view the current ACL values on /data,
# getfacl /data
To revoke write access for all users and groups on a file,
# setfacl -m m::rx /data/file1
Above command will set the mask value as "r-x".
To copy the acl of one file to another,
# getfacl file1 | setfacl --set-file=- file2
You can also use the below method to copy the acl rights between files.
$ getfacl /data/file1 > acls.txt
$ setfacl -f acls.txt /data/file2
Friday, July 20, 2012
User and Group Management in Redhat Linux
Here are some configuration files which you should be familiar.
/etc/passwd :
Contains the database of information of all the users.
The format of the file is
username:password:uid:gid:gecos:directory:shell
/etc/shadow :
The actual password of every user is stored in /etc/shadow, indicated by an x in the password field.
As /etc/passwd is readable by all users, storing even encrypted passwords in it makes password guessing easier.
However, /etc/shadow is more secure because it is readable only by programs that run with root privileges, such as login and passwd.
Here is a sample line from /etc/shadow
johny:$1$EmRh1cmZ$gkXY30H43D7NtpQXjm9F01:11589:0:99999:7:::
It contains the following fields,
- The account name
- The account’s encrypted password
- The number of days since 1 January 1970 that the password was last changed
- The number of days permitted before the password can be changed
- The number of days after which the password must be changed
- The number of days before the password expires that the user is warned
- The number of days after the password expires before the account is disabled
- The number of days since 1 January 1970 after which the account is disabled
- Reserved for future use
/etc/group :
Contains the database of information of all the groups.
The format of the file is
groupname:password:gid:userlist
where
groupname is the name of the group
- password is an optional field containing the encrypted group password
- gid is the numeric group ID number
- userlist is a comma-separated list of the user account names that comprise the group
For ex,
finance:x:507:jacob,maylyn,nancy
Now lets see some commands,
Q. To create a user account with default settings,
# useradd jacob
In this case,
the home directory will be /home/jacob,
shell will be bash
uid will be the next unused UID
Q. To show the default values taken while creating a user account,
# useradd -D
Q. To set a password for the newly created user account,
# passwd jacob
Q. To change the gecos(description) of a user account,
# usermod -c "Jacob Oyden" jacob
Q. To delete a user account
# userdel jacob
Q. To delete a user account along with its home directory,
# userdel -r jacob
Q. To create a group for finance department,
# groupadd finance
Q. To create a group in a specific guid,
# groupadd -g 1000 finance
Q. To delete a group,
# groupdel finance
Q. To lock a user account,
# passwd -l jacob
Q. To unlock a user account,
# passwd -u jacob
Q. To change the user name of an existing user account,
# usermod -l joyden jacob
above command change the username from jacob to joyden.
Q. To change the 'uid' of a user account,
# usermod -u 1023 jacob
Above command will also update all files and directories rooted in the user’s home directory automatically to the new UID, but any files outside of the user’s home directory must be altered manually.
Q. To show the user account expiry information,
# chage -l jacob
Q. To change user account expiry information,
# chage jacob
Q. To list all the shells (or you can refer the file /etc/shells for the available shells),
# chsh -l
Q. To change the shell of a user,
# chsh jacob
/etc/passwd :
Contains the database of information of all the users.
The format of the file is
username:password:uid:gid:gecos:directory:shell
/etc/shadow :
The actual password of every user is stored in /etc/shadow, indicated by an x in the password field.
As /etc/passwd is readable by all users, storing even encrypted passwords in it makes password guessing easier.
However, /etc/shadow is more secure because it is readable only by programs that run with root privileges, such as login and passwd.
Here is a sample line from /etc/shadow
johny:$1$EmRh1cmZ$gkXY30H43D7NtpQXjm9F01:11589:0:99999:7:::
It contains the following fields,
- The account name
- The account’s encrypted password
- The number of days since 1 January 1970 that the password was last changed
- The number of days permitted before the password can be changed
- The number of days after which the password must be changed
- The number of days before the password expires that the user is warned
- The number of days after the password expires before the account is disabled
- The number of days since 1 January 1970 after which the account is disabled
- Reserved for future use
/etc/group :
Contains the database of information of all the groups.
The format of the file is
groupname:password:gid:userlist
where
groupname is the name of the group
- password is an optional field containing the encrypted group password
- gid is the numeric group ID number
- userlist is a comma-separated list of the user account names that comprise the group
For ex,
finance:x:507:jacob,maylyn,nancy
Now lets see some commands,
Q. To create a user account with default settings,
# useradd jacob
In this case,
the home directory will be /home/jacob,
shell will be bash
uid will be the next unused UID
Q. To show the default values taken while creating a user account,
# useradd -D
Q. To set a password for the newly created user account,
# passwd jacob
Q. To change the gecos(description) of a user account,
# usermod -c "Jacob Oyden" jacob
Q. To delete a user account
# userdel jacob
Q. To delete a user account along with its home directory,
# userdel -r jacob
Q. To create a group for finance department,
# groupadd finance
Q. To create a group in a specific guid,
# groupadd -g 1000 finance
Q. To delete a group,
# groupdel finance
Q. To lock a user account,
# passwd -l jacob
Q. To unlock a user account,
# passwd -u jacob
Q. To change the user name of an existing user account,
# usermod -l joyden jacob
above command change the username from jacob to joyden.
Q. To change the 'uid' of a user account,
# usermod -u 1023 jacob
Above command will also update all files and directories rooted in the user’s home directory automatically to the new UID, but any files outside of the user’s home directory must be altered manually.
Q. To show the user account expiry information,
# chage -l jacob
Q. To change user account expiry information,
# chage jacob
Q. To list all the shells (or you can refer the file /etc/shells for the available shells),
# chsh -l
Q. To change the shell of a user,
# chsh jacob
Monday, February 21, 2011
Managing HBAs and SAN disks in Redhat Linux 4 & 5
Redhat 5 :
To list the LUNs and their paths :
# multipath -ll
To display pv information on a multipath :
# pvdisplay /dev/mapper/mpath0
To find the server hardware details :
# dmidecode <- hardware info To scan for new LUNs: # ls /sys/class/fc_host host0 host1 # fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l
# echo "1" > /sys/class/fc_host/host0/issue_lip
# echo "- - -" > /sys/class/scsi_host/host0/scan
# echo "1" > /sys/class/fc_host/host1/issue_lip
# echo "- - -" > /sys/class/scsi_host/host1/scan
# cat /proc/scsi/scsi | egrep -i 'Host:' | wc -l
# fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l
RHEL 4.6 :
To see HBA details like firmware, wwn,etc.. :
# cat /proc/scsi/qla2xxx/0
To list the HBAs along with their HBA :
# adapter_info
To scan for new LUNs:
# hp_rescan -a
To show the WWN of a LUN :
# scsi_info /dev/sdb
To list the configured Qlogic adapters:
# lspci | grep -i qlo
To list the LUNs:
# /opt/hp/hp_fibreutils/lssd
Output will be like
sda H,B,T,L
where
H is the host number of the HBA
B is the bus number (normally 0)
T is the target number
L is the LUN number
is a string which uniquely identifies the storage array.
To remove a lun from OS:
# echo "1" > /sys/block/sd/device/delete
# echo "scsi remove-single-device H B T L" > /proc/scsi/scsi
# echo "1" > /sys/class/scsi_host/host/device/targetH:B:T:L/H:B:T:L/delete
To list the LUNs and their paths :
# multipath -ll
To display pv information on a multipath :
# pvdisplay /dev/mapper/mpath0
To find the server hardware details :
# dmidecode <- hardware info To scan for new LUNs: # ls /sys/class/fc_host host0 host1 # fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l
# echo "1" > /sys/class/fc_host/host0/issue_lip
# echo "- - -" > /sys/class/scsi_host/host0/scan
# echo "1" > /sys/class/fc_host/host1/issue_lip
# echo "- - -" > /sys/class/scsi_host/host1/scan
# cat /proc/scsi/scsi | egrep -i 'Host:' | wc -l
# fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l
RHEL 4.6 :
To see HBA details like firmware, wwn,etc.. :
# cat /proc/scsi/qla2xxx/0
To list the HBAs along with their HBA :
# adapter_info
To scan for new LUNs:
# hp_rescan -a
To show the WWN of a LUN :
# scsi_info /dev/sdb
To list the configured Qlogic adapters:
# lspci | grep -i qlo
To list the LUNs:
# /opt/hp/hp_fibreutils/lssd
Output will be like
sda H,B,T,L
where
H is the host number of the HBA
B is the bus number (normally 0)
T is the target number
L is the LUN number
To remove a lun from OS:
# echo "1" > /sys/block/sd
# echo "scsi remove-single-device H B T L" > /proc/scsi/scsi
# echo "1" > /sys/class/scsi_host/host
Subscribe to:
Posts (Atom)