Você está na página 1de 18

Question RHCSA

1. Set your system as Examiner can login your system as root user
and password is TomBigBee.
restart vm machne
On boot tme press any key
Press e for edt
Seect kerne /LVnuz-***** and press e
Type 1 and press enter
Press b (then t w boot snge user mood)
Sh # setenforce 0
Sh # passwd
Sh # redhat
Sh # nt 5
2. ou read t!e "ile #root#networ$ and c!ec$ your %&C con"iguration.
Souton:
#cat /root/network
# vm /etc/hosts (Set Host name)
# setup
# (Check ONBOOT=yes from foowng ocaton)
#system-confg-network or vm /etc/sysconfg/network-scrpt/fcfg-eth0
# servce network restart (Restart Network)
N.B: NetworkManager (Dsabe from ntsysv)
'. (ig ser)er1.example.com success"ully resol)es t!at !ostname
using (%S.
Souton:
To set DNS
#v /etc/resov.conf
(exampe: nameserver 192.168.1.1)
Question
*. All rpms are a)aila+le in #)ar#"tp#pu+#r!el,#Ser)er#-ac$ages and
#)ar#"tp#pu+#update directory on t!e ser)er ser)er1.example.com
or 1.2.1,/.1.20*. &nstall dialog pac$age
Souton:
# vm /etc/yum.repos.d/base.repo
|base|
name=Red Hat Lnux 6
baseur=ftp://server1.exampe.com/pub/rhe6/Server
enabed=1
gpgcheck=0
# yum nsta daog* -y
yum related command
# yum st daog
# yum st a
# rpm -qa | grep httpd* (Fnd out f httpd package nstaed or
not)
# yum st nstaed httpd (Fnd out f httpd package nstaed or
not)
# yum st httpd (to search for package by name)
# yum nsta httpd (to nsta the package )
# yum remove httpd (to remove the package)
# yum nfo httpd 1Fnd nformaton about a package2
# yum cean a (too cear cash)
0. Create a user wit! id '*0,
useradd -u 3456 arms
d username (Check)
useradd -u 105 -s /bn/bash (wth she)
,. Create t!ree users and a group t!at3
4ser $!alid is a mem+er o" group o""icestu"" as secondary group
4ser ru!ul is a mem+er o" group o""icestu"" as a secondary group
4ser neo not a mem+er o" group o""icestu""
4ser neo !as no interacti)e s!ell.
-assword o" all users must +e password
Souton:
# groupadd offcestuff
# adduser G offcestuff khad
# adduser G offcestuff ruhu
# adduser s /sbn/noogn neo
# cat /etc/passwd
# passwd khad
# passwd ruhu
# passwd neo
5. 6a$e sure t!e permission on t!e #o""icedata directory t!at3
All mem+er o" group o""icestu"" can create a "ile or directory in t!at
directory
6em+er o" group o""icestu"" can modi"y eac! ot!er "ile in t!at
directory
7t!er user can only read "ile or access su+directory in t!at
directory
Souton:
# mkdr /offcedata
# chgrp offcestuff /offcedata
# chmod 2775 /offcedata
# s d /offcedata
/. Copy t!e "ile #etc#"sta+ in to t!e directory #)ar#tmp t!at3
T!is "ile !as no execution permission
T!e "ile owners!ip must +e root3root
4ser $!alid can read and modi"y t!is "ile
4ser ru!ul can read t!is "ile
7t!er user neit!er read or write t!is "ile
Souton:
# cp /etc/fstab /var/tmp 1AC82 1SE8&%49
E::ECT2
# s a /var/tmp/fstab
# vm /etc/fstab
/var ext4 defauts,ac 1 2
# mount o remount,ac /var
# getfac /var/tmp/fstab (chek permson)
# setfac m u:khad:rw- /var/tmp/fstab
# setfac m u:ruhu:r-- /var/tmp/fstab
# setfac m o::0 /var/tmp/fstab
# getfac /var/tmp/fstab (conform permson)
.. Create a new logical )olume si;e '<< 6B called myswap "rom t!e
existing )olume group. And ma$e a swap partition using myswap.
Also ma$e sure it will +e a)aila+le a"ter re+oot.
Souton:
# vgs
# vcreate -L 300M -n myswap vg_name
# mkswap /dev/vg_name/myswap |create the swap fe system|
# swapon /dev/vg_name/myswap |mount the swap|
# free |check |
# vm /etc/fstab |/dev/vname/myswap swap swap defauts 0 0|
10. Extend logical )olume )ar"s 2=B to 2.'=B.
Souton:
# vextend L 2.3G /dev/vgname/vname
#resze2fs /dev/vo0/varfs
11. ou must export #!ome#new to t!e example.com networ$. Test t!e
+elow command to c!ec$ t!e exported s!are "or local!ost.
s!owmount >e local!ost
Souton:
# yum nsta nfs* rpcbnd*
#chkconfg rpcbnd on
# chkconfg nfs on
# vm /etc/exports
/home/new *.exampe.com(rw)
#servce rpcbnd start
# servce nfs start
# showmount e ocahost
Test output
12. Ena+le &- "orwarding
Souton:
# vm /etc/sysct.conf
net.pv4.p_forward = 1
1'. %etwor$ Time -roticol3
Station9 must sync!roni;e its time )ia %T- Ser)er
ser)er1.example.com or 1.2.1,/.1.20*
Souton:
# chkconfg ntpd on
# system-confg-date
# synchronze system date and tme over the network
# add server1.exampe.com ok
1*. To update installation your 7S $ernel t!at3
(ownload t!e update $ernel t!at is a)aila+le on
"tp3##ser)er1.example.com#pu+#r!el,#update directory "or
anonymous
Bot! $ernels are listed in t!e gru+ menu.
System will run automatically wit! t!e new $ernel
Examiner !as 0 second to switc! old $ernel at t!e gru+ menu
Answer:
# wget ftp://server1.exampe.com/pub/rhe6/update
# uname r or uname ra or cat /etc/grub.conf (check present kerne
veron)
# rpm vh kerne*
10. ou must install t!e s!are printer on your system to connect
s!ared printer using &-- t!at 8ocation o" t!e demo print ser)er is
ser)er1.eample.com
%etwor$ printer name is station9 and ?ueue type is =eneric Text
only
ou can con"orm t!e printer setup )ia 4R8
!ttp3##ser)er11.example.com#printers#station9
Here 9 is your station num+er
Souton:
# yum nsta system-confg-prnter* cups* -y
# servce cups start
# system-confg-prnter
new Network prnter IPP
Host server1.exampe.com
Oueue /prnters/statonX
Forward contnue anyway -> nsta Generc forward
Prnter name (staton101) forward
Prnt a test page (yes)
Set as defaut (v)
How to check
1,. Cron @o+s3
6a$e a sc!edule tas$ only "or user neo 1except root2 to run t!e
command #+in#ec!o Hello station9.example.com at any output
terminal at 123<,
Souton:
# cat /etc/crontab
# crontab e u neo
6 12 * * * /bn/echo Heo staton101
# servce crond restart
# crontab - -u Khad
_____________________________________________________________________
For 1 mn
|root@staton101 -|# s /dev/pts/
0 ptmx
|root@staton101 -|# s - /dev/pts/0
crw--w----. 1 root tty 136, 0 Sep 26 17:28 /dev/pts/0
|root@staton101 -|# chmod o+w /dev/pts/0
|root@staton101 -|# s - /dev/pts/0
crw--w--w-. 1 root tty 136, 0 Sep 26 17:28 /dev/pts/0
*/1 * * * * /bn/echo Heo > /dev/pts/0\
_____________________________________________________________________
17. natas!a una+le to write cronta+
Souton:
vm /etc/cron.deny
Type user name natasha then save & cose
ogn user
crontab -e (Check)
18. To con"igure "tp ser)ice "or t!e networ$ example.com t!at3
Anonymous user can access to your system )ia "tp wit!in t!e
networ$ example.com
Souton:
# yum nsta vsftpd* -y
# chkconfg vsftpd on
# servce vsftpd start
# getseboo a |grep ftp 1SE8&%49 E::ECT2
# setseboo P ftp_home_dr on
# setseboo P aow_ftpd_anon_wrte on
# getseboo a |grep ftp (check se effect)
# servce vsftpd restart
%eed to C!ec$
19. To con"igure apac!e ser)ice "or t!e station9.example.com t!at3
(ownload station.!tml "ile "rom
"tp3##ser)er1.example.com#pu+#station9
Copy station.!tml "ile into t!e #)ar#www#!tml as index.!tml
Remem+er t!at you cannot modi"y t!is "ile.
Here 9 is your station num+er.
Souton:
# yum nsta httpd* -y
# chkconfg httpd on
# servce httpd start
# cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bac
# vm /etc/httpd/conf/httpd.conf
: set nu
Lne 262: Serveradmn root@ocahost (f need to change the admn)
Lne 276: Servername staton101.exampe.com: 80 1uncomment2
Save and ext :x
# cd /var/www/htm
# wget "tp3##ser)er1.example.com#pu+#station1<5.!tml
# mv staton.htm ndex.htm
# s Z /var/www/htm/ndex.htm
httpd_sys_content_t (f show ths ndex then ok)
# httpd -t
# servce httpd restart
To check go to the browser and type staton101.exampe.com
2<. A!en user Ro+ert typeB 1His password is CpasswordD2
dd i"E#de)#;ero o"E"ile +sE1<2* countE5< $+ !e successed
dd i"E#de)#;ero o"E"ile +sE1<2* countE1<< $+ !e "ailed
Souton:
# vm /etc/fstab
/home ext3 defauts,usrquota 1 2
# mount o remount,usrquota /home
# mount |to show home type ext3 (rw,quota,quota)|
# quotacheck cM /home
# chcon t quota_db_t /home/aquota.user 1SE8&%49
E:ECT2
# quotaon /home
# edquota robart
Bocks soft hard
70 100
# repquota v /home
Testing
21. Con"igure a system to use an existing 8(A- directory ser)ice "or
user and group in"ormation.
Answer:
# yum nsta -y opendap nss_dap
# authconfg-tu
check 'USE LDAP' and 'USE LDAP Authentcaton'
Press 'NEXT'
Specfy the correct doman settngs
check 'use TLS'
server: dap://192.168.1.254/
base DN: dc=doman10,dc=exampe,dc=com
Press 'OK'
Then t w ask u for a ts certfcate n a ocaton. Remember that ocaton
and downoad certfcate fe from desred ftp ocaton provded by examner
and put n that ocaton.
press 'ok'
Testing3
# getent passwd (Last ne u w see the dap user wth encrypted
password)
# su - dapusr
22. 6ount ldap user !ome directory using auto"s.
Answer:
# yum nsta autofs* -y
# chkconfg autofs on
# v /etc/auto.master
/home/doman101 /etc/auto.dap
# v /etc/auto.dap
* -fstype=nfs,rw,soft 192.168.1.201:/home/dap/&
# servce autofs restart
Testing3
# su dapuser (you w get correct prompt once t s confgured
correcty.)
Script
2'. Arite a script in #root#script.s! to gi)e t!e "ollowing output
sample output3
Souton:
#/root/scrpt.sh PERL
THIS IS PYTHON
#/root/scrpt.sh PYTHON
THIS IS PERL
#/root/scrpt.sh
/root/scrpt.sh PERL|PYTHON
# vm /root/scrpt.sh
#!/bn/sh
case "$1" n
'PERL')
echo "THIS IS PYTHON"
;;
'PYTHON')
echo "THIS IS PERL"
;;
*)
echo "usage:$0 PERL|PYTHON"
ext 1
;;
esac
# chmod 775 /root/scrpt.sh (permsson)
# /root/sctp.sh PERL (check output)
# /root/sctp.sh PYTHON (check outpu t)
# /root/sctp.sh (check output)
RHCE F Con"iguration
1. To con"igure !ttps ser)ice "or t!e networ$ example.com t!at3
Con"igure a !ttps site called www9.example.com. 6a$e sure ot!ers
networ$ cannot access t!is site.
Souton:
# yum nsta mod_ss* -y
# cd /etc/httpd/conf.d
# cp ss.conf ss. conf.bak
# vm ss.conf
: set nu
Lne 77: DocumentRoot "/var/www/htm" 1uncomment2
Lne 78: ServerName www101.exampe.com:443 1uncomment G modi"y2
Save and ext :x
# servce httpd restart
2. To con"igure apac!e ser)ice "or user ru!ul. %o one can access t!is
we+ page.
Souton:
# vm /etc/httpd/conf/httpd.conf
# <Drectory> "/var/vhost"
Order deny,aow
Deny from a
Aow from 172.24.254.50 14ser &-2
<Drectory>
3. To con"igure apac!e ser)ice as )irtual !osting "or t!e
www.9.example.com t!at3
(ownload www.!tml "ile "rom "tp3##ser)er1.example.com #pu+#r!el,
Copy www.!tml "ile into t!e #)ar#)!ost as index.!tml
4ser $!alid can modi"y t!e #)ar#)!ost#index.!tml "ile.
Here 9 is your station num+er
Souton:
# mkdr /var/vhost p
# cd /var/vhost
# wget ftp://server1.exampe.com/pub/rhe6/www.htm
# mv www.htm ndex.htm
# vm /etc/httpd/conf/httpd.conf
: set nu
Lne 990: NameVrtuaHost *:80 1uncomment2
Copy 1003 to 1009 (7yy)
Paste (p)
<VrtuaHost *:80>
DocumentRoot /var/www/htm
ServerName staton101.exampe.com
</VrtuaHost>
<VrtuaHost *:80>
DocumentRoot /var/vhost
ServerName www101.exampe.com
</VrtuaHost>
# chcon R --reference=/var/www/htm /var/vhost
# s Z /var/vhost
# servce httpd restart
AC8 "or $!alid
setface m u:khad:rw /var/vhost
setface m u::0 /var/vhost
4. Here example.com or 1.2.1,/.1.20* is your trusted networ$ and
your system is +ased on example.com domain t!ere anot!er
networ$ mig2''.org or 1.2.1,/.2.<#2*. T!is networ$ mig2''.org or
1.2.1,/.2.< is not trusted.
Souton:
# ptabes -F
# ptabes -I INPUT -s 192.168.2.0/24 -| RE|ECT
# ptabes nL (show ptabe status)
# servce ptabes save
# servce ptabes restart
5. To con"igure ss! ser)ice "or t!e networ$ example.com t!at3
4ser $!aled can access to your system )ia ss! wit! in t!e networ$
example.com Any user or t!e networ$ mig2''.org canHt access to
your system )ia ss!.
Souton:
# yum nsta openssh* -y
# chkconfg sshd on
# servce sshd start
# vm /etc/ssh/sshd_confg
Lne 22 AowUsers khaed (end of the ne)
# servce sshd restart
ssh khad@staton101.exampe.com (check access)
6. To con"igure %etwor$ :ile S!aring ser)ice t!at3
T!e s!ared directory #o""icedata is a)aila+le "or all mem+ers o" t!e
networ$ example.com
T!e s!ared directory s!ould a)aila+le in read and write to all t!e
mem+ers o" example.com domain.
6a$e sure t!e networ$ mig2''.org canHt access %:S s!ared
directory.
Souton:
# vm /etc/exports
/offcedata *.exampe.com(rw,sync)
Save and ext :x
# servce rpcbnd restart
# servce nfs restart
# showmount -e
Test output
7. To con"igure sam+a ser)ice "or t!e networ$ example.com t!at3
Sam+a ser)er wor$igroup name must +e :edora
T!e s!ared directory #o""icedata as s!ared name allaccess
7nly user ru!ul can access t!at directory wit! password password
7nly example.com networ$ can access sam+a s!ared directory
Souton:
# yum nsta samba* -y
# chkconfg smb on
# cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
# vm /etc/samba/smb.conf
74: workgroup = Fedora 1uncomment2
79: nterfaces = 192.168.1.0/24 1uncomment2
Shft+g
248: copy 7 nes (7 yy)
254: paste (v)
254 |aaccess|
255 comment = Home Drectores
256 path = /offcedata
257 browseabe = yes
258 wrtabe = yes
259 I vad users = ruhu (keep comment)
260 I vad users = MYDOMAIN\%S (Keep comment)
Save and ext
# getseboo -a | grep samba 1SE8&%49 E::ECT2
# setseboo P samba_enabe_home_drs on
# setseboo P samba_export_a_rw on
# chcon -t samba_share_t /offcedata
# s Z /offcedata (check senux)
# smbpasswd a ruhu
# servce smb start
To check the SAMBA share s workng:
Open My Computer Edt menu Preference Behavor tab Cck the
(Aways open n browser wndow)
Cose and Open agan My Computer
Type smb://staton101.exampe.com/aowaccess
- Username = ruhu
- Doman = Fedora (case sensetve)
- Password = password
/. 6ount an &S7 "ile during startup on #mnt#d)d#iso. &S7 "ile is located
at #tmp#xy;.iso
Souton:
#mkdr p /mnt/dev/so
#v /etc/rc.oca
mount o oop /tmp/xyz.so /mnt/dvd/so 1add t!is line to rc.local2
Save and ext
To mount manuay
# mount o oop /tmp/xyz.so /mnt/dvd/so
#df h (check)
.. Copy all t!e lines "rom #root#wordd+.dict "iles t!at contains t!e
word J+lueJ and put t!ose lines in #root#sorted.dict
#root#wordd+.dict contains3
T!e s$y is +lue.
Red cap wit! +lue +u++le.
Red cad.
souton:
#cat /root/worddb.dct | grep - bue (-i = case insensitive) OR
#cat /root/worddb.dict | grep i blue > /root/sorted.dict (-i = case insensitive)
#cat /root/worddb.dct | grep bue > /root/sorted.dct
Output contans:
cat /root/sorted.dct
The sky s bue.
Red cap wth bue bubbe.
1<. Create an l) wit! minimum 0< extend "rom data)g. T!e -E is
si;e o" t!e data)g is 1, and mount it on #mnt#d)d#new"s during
startup.
Souton:
# system-confg-vm
# vgdspay
# vgdspay datavg
# vcreate - 50 -n datav /dev/datavg
# mkfs.ext4 /dev/datavg/datav
# vdspay datav
# vdspay /dev/datavg/datav
11. To con"igure smtp ser)ice "or t!e networ$ example.com t!at3
4ser ru!ul can send or recei)ed mail wit!in t!e networ$
example.com.
6a$e sure any user o" t!e networ$ mig2''.org canHt access at 20
port address
Souton:
# yum nsta postfx* -y ----- (Sendma shoud be off)
# chkconfg postfx on
# servce postfx start
# cp /etc/postfx/man.cf /etc/postfx/man.cf.bac
# vm /etc/postfx/man.cf
# :set nu
Go to the foowng ne and uncomments
75: myhostname = staton101.exampe.com 1uncomment G type !ost
name2
83: mydoman = exampe.com 1uncomment G type domain
name2
98: myorgn = $myhostname 1uncomment2
113: net_nterfaces = a 1uncomment2
116: net_nterfaces = ocahost 1c!ec$ uncomment2
119: net_protocos = a 1c!ec$ uncomment2
164: mydestnaton = $myhostname, ocahost.$mydoman, ocahost
1c!ec$ uncomment2
250: mynetworks_stye = subnet 1uncomment2
264: mynetworks = 192.168.1.0/24, 127.0.0.0/8 1uncomment G add ip2
Save and ext
# servce postfx restart
C!ec$ing 6ail Sending G Recei)ing
# su ruhu
$ ma v khad@staton107.exampe.com
$ Sub|ect: MSG00
$ type somethng as a body of text.
$ .
$ su khaed
$ ma (to read ma)
12. To con"igure pop ser)ice "or t!e networ$ example.com t!at3
1Extra2
4ser $!alid can retrie)e mail "rom t!e mail "ile
#)ar#spool#mail#$!alid
6a$e sure any user o" t!e networ$ mig2''.org canHt use pop
ser)ice.
Souton:
# yum nsta dovecot* -y
# chkconfg dovecot on
# vm /etc/dovecot/dovecot.conf
25: protocos = map pop3 mtp 1uncomment2
# vm /etc/dovecot/conf.d/10-ma.conf
24: ma_ocaton = madr:-/f /var/spoo/ma 1uncomment2
25: ma_ocaton = mbox:-/ma:INBOX=/var/ma/%u 1uncomment2
Save and ext :x
# servce dovecot restart
C!ec$ing
# su ruhu
$ ma v khad@staton107.exampe.com
$ Sub|ect: MSG00
$ type somethng as a body of text.
$ .
$ su khaed
# mutt -f pop://ruhu@staton101.exampe.com
# password
# space for show the message
13. To con"igure any 6TA ser)ice "or t!e networ$ example.com t!at3
4ser root can send mail to ru!ul user wit!in t!e networ$
example.com
6a$e sure t!at t!e mail o" user root s!ould get +y t!e $!alid user
Souton:
# vm /etc/aases
End of the ne (shft+g)
root: root,khad
Save and ext :x
# newaases
14. To con"igure imaps ser)ice "or t!e networ$ example.com t!at3
To ma$e a demo certi"icateB
T!e certi"icate in"ormation is
- 7rgani;ation name3 RedHat &nc.
- 7rgani;ation unit name3 RHCE
- Hostname3 station9.example.com
- Email3 rootKstation9.example.com
And ot!er in"ormation must +e de"ault.
Here 9 is your station num+er
Souton:
# yum nsta make* ade* -y
#fnd / -name dovecot.pem exec rm f {} \;
# make -C /etc/pk/ts/certs dovecot.pem
Country Name (2 etter code) |XX|:
State or Provnce Name (fu name) ||:
Locaty Name (eg, cty) |Defaut Cty|:
Organzaton Name (eg, company) |Defaut Company Ltd|:RedHat Inc.
Organzatona Unt Name (eg, secton) ||:RHCE
Common Name (eg, your name or your server's hostname)
||:staton101.exampe.com
Ema Address ||:root@staton101.exampe.com
make: Leavng drectory `/etc/pk/ts/certs'
# cd /etc/dovevot/conf.d
# cp 10-ss.conf 10-ss.com.bak
# vm 10-ss.conf
12: ss_cert = </ etc/pk/ts/certs/dovecot.pem 1Con"orm t!is pat!2
13: ss_key = </ etc/pk/ts/certs/dovecot.pem 1Con"orm t!is pat!2
Save and ext :x
# servce dovecot restart
1C!ec$ing system2
# mutt f map://khaed@staton101.exampe.com
# y
# vsua
# a (for accept)
# passwd
15. -ermanent mount &SCS& dis$.
#fdsk (Remember the current dsk status)
# yum nsta scs* -y
# chkconfg scsd on
# servce scsd start
# scsadm -m dscovery -t st -p 172.16.1.254 (server p) or
# scsadm -m dscovery -t st -p 172.16.1.254 -
# fdsk (to show scs status)
# servce scsd restart
# fdsk
# create partton & by fdsk
# fu restart the machne
# mkfs.ext4 /dev/sdb1 (format )
# mkdr /scs (queston requred)
# bkd /dev/sdb1 (show devce d)
# vm /etc/fstab |UIUD. /scs ext4 _netdev 0 0|
16. :ind all "iles o" user &RA and put t!ose "iles #root#"ind"iles
# fnd / -user IRA
# fnd / -user IRA -exec cp -rp {} /tmp/coected/ \;
# s -rt | grep fe (check)
1. !odi"# $ernstac$ value to 1 and it s%uld visible b# /proc/c&dline

# vi& /etc/grub.con"
# at the end of the kernel line type $ernstac$=1
# cat /proc/c&dline (to verify whether it how the para!eter"
#.$% it will not a&tive 'ntil re(oot the !a&hine
**Configure apache service that your local system user can only brows your page.**
[root@domain9 vhost]# vim /etc/httpd/conf/httpd.conf
!irtual"ost *#$%&
'irectory (/var/vhost/(&
)rder deny*allow
'eny from all
+llow from ,-..,/.,%%.9 #your local system 01.
/'irectory&
2erver+dmin webmaster@e3ample.com
'ocument4oot /var/vhost
2erver5ame vhost.e3ample.com
6rror7og logs/www.e3ample.com8error9log
Custom7og logs/www.e3ample.com8access9log common
/!irtual"ost&
#m:die /var/vhost
#chcon 84 88reference;/var/www/ /var/vhost
*****************************<esting
apache*****************************************
0nstall elin:s
#yum install elin:s*
[root@domain9 vhost]# elin:s vhost.e3ample.com
[root@domain9 vhost]# elin:s www.e3ample.com
[root@domain9 vhost]# elin:s domain9.e3ample.com
ISCSI
**=ou get a lun as iscsi device from the server host.domain>%.e3ample.com * ma:e a
file system si?e ,,%%@ib and mount it
to /mnt/data* download data.t3t file from host.domain>%.e3ample.com and change the
permission of the file that only harry
read and write the file. [note. root user always get read write permission]
#yum install iscsi
#fdis: 8l && /filesystem.t3t
#[root@station> 'es:top]# iscsiadm 8m discovery 8t st 8p ,9..,/$.%..>A
2tarting iscsid# [ )B ]
,9..,/$.%..>A#C./%*, iDn..%%$8%9.com.e3ample#server,.station>
[root@station> 'es:top]# service iscsi restart
2topping iscsi# [ )B ]
2tarting iscsi# [ )B ]
[root@station> 'es:top]# ch:config iscsi on
[root@station> 'es:top]# fdis: 8l
'is: /dev/sda# C.%., EF* C.%%-.9CCC-/ bytes
.>> heads* /C sectors/trac:* C$9,C cylinders
Gnits ; cylinders of ,/%/> * >,. ; $..>.$% bytes
2ector si?e Hlogical/physicalI# >,. bytes / >,. bytes
0/) si?e Hminimum/optimalI# >,. bytes / >,. bytes
'is: identifier# %3%%%.%-c$
'evice Foot 2tart 6nd Floc:s 0d 2ystem
/dev/sda, * , ./ .%A$%% $C 7inu3
1artition , does not end on cylinder boundary.
/dev/sda. ./ .>-/ .%A$%%%% $C 7inu3
/dev/sdaC .>-/ AA$$ ,>C/%%%% $C 7inu3
/dev/sdaA AA$$ C$9,A .-/>.>%>/ > 63tended
/dev/sda> AA$$ A/,9 ,%A$>-/ $. 7inu3 swap / 2olaris
/dev/sda/ A/,9 A-A/ ,%.A%%% $C 7inu3
'is: /dev/sdb# >C/ @F* >C/$-%9,. bytes
,- heads* /, sectors/trac:* ,%,, cylinders
Gnits ; cylinders of ,%C- * >,. ; >C%9AA bytes
2ector si?e Hlogical/physicalI# >,. bytes / >,. bytes
0/) si?e Hminimum/optimalI# >,. bytes / >,. bytes
'is: identifier# %3%%%%%%%%
'is: /dev/sdb doesnJt contain a valid partition table
[root@station> 'es:top]# fdis: /dev/sdb
'evice contains neither a valid ')2 partition table* nor 2un* 2E0 or )2K dis:label
Fuilding a new ')2 dis:label with dis: identifier %3f,,Cfbb%.
Changes will remain in memory only* until you decide to write them.
+fter that* of course* the previous content wonJt be recoverable.
Larning# invalid flag %3%%%% of partition table A will be corrected by wHriteI
L+4505E# ')28compatible mode is deprecated. 0tJs strongly recommended to
switch off the mode Hcommand JcJI and change display units to
sectors Hcommand JuJI.
Command Hm for helpI# p
'is: /dev/sdb# >C/ @F* >C/$-%9,. bytes
,- heads* /, sectors/trac:* ,%,, cylinders
Gnits ; cylinders of ,%C- * >,. ; >C%9AA bytes
2ector si?e Hlogical/physicalI# >,. bytes / >,. bytes
0/) si?e Hminimum/optimalI# >,. bytes / >,. bytes
'is: identifier# %3f,,Cfbb%
'evice Foot 2tart 6nd Floc:s 0d 2ystem
Command Hm for helpI# n
Command action
e e3tended
p primary partition H,8AI
p
1artition number H,8AI# ,
Kirst cylinder H,8,%,,* default ,I#
Gsing default value ,
7ast cylinder* Mcylinders or Msi?eNB*@*EO H,8,%,,* default ,%,,I#
Gsing default value ,%,,
Command Hm for helpI# p
'is: /dev/sdb# >C/ @F* >C/$-%9,. bytes
,- heads* /, sectors/trac:* ,%,, cylinders
Gnits ; cylinders of ,%C- * >,. ; >C%9AA bytes
2ector si?e Hlogical/physicalI# >,. bytes / >,. bytes
0/) si?e Hminimum/optimalI# >,. bytes / >,. bytes
'is: identifier# %3f,,Cfbb%
'evice Foot 2tart 6nd Floc:s 0d 2ystem
/dev/sdb, , ,%,, >.A,-C $C 7inu3
Command Hm for helpI# w
<he partition table has been alteredP
Calling ioctlHI to re8read partition table.
2yncing dis:s.
[root@station> 'es:top]# partprobe
Larning# L+4505E# the :ernel failed to re8read the partition table on /dev/sda
H'evice or resource busyI. +s a result* it may not reflect all of your changes
until after reboot.
[root@station> 'es:top]# cd /dev/sd
sda sda, sda. sdaC sdaA sda> sda/ sdb sdb,
[root@station> 'es:top]# m:fs.e3tA /dev/sdb,
m:e.fs ,.A,.,. H,-8@ay8.%,%I
Kilesystem label;
)2 type# 7inu3
Floc: si?e;,%.A Hlog;%I
Kragment si?e;,%.A Hlog;%I
2tride;% bloc:s* 2tripe width;% bloc:s
,C,%-. inodes* >.A,-. bloc:s
./.%$ bloc:s H>.%%QI reserved for the super user
Kirst data bloc:;,
@a3imum filesystem bloc:s;/-/CC,>.
/A bloc: groups
$,9. bloc:s per group* $,9. fragments per group
.%A$ inodes per group
2uperbloc: bac:ups stored on bloc:s#
$,9C* .A>--* A%9/,* >-CA>* -C-.9* .%A$%,* ..,,$>* A%,A%9
Lriting inode tables# done
Creating Rournal H$,9. bloc:sI# done
Lriting superbloc:s and filesystem accounting information# done
<his filesystem will be automatically chec:ed every ./ mounts or
,$% days* whichever comes first. Gse tune.fs 8c or 8i to override.
[root@station> 'es:top]# vim /etc/fstab
/dev/sdb, /mnt/02C20> e3tA 9netdev % %
[root@station> 'es:top]# mount 8a
[root@station> 'es:top]# df 8h
Kilesystem 2i?e Gsed +vail GseQ @ounted on
/dev/sdaC ,>E ..%E ,.E ,>Q /
tmpfs ,.AE ./%B ,.AE ,Q /dev/shm
/dev/sda, ,9A@ ./@ ,>9@ ,AQ /boot
/dev/sda/ 9$>@ ,9@ 9,/@ .Q /home
/dev/sda. .%E ,,E -.9E >-Q /var
//,9..,/$.,...,%>/testshare/
>.$E ..%E C./E C>Q /mnt/samba
/dev/sdb, A9/@ ,,@ A/%@ CQ /mnt/02C20>

Você também pode gostar