Você está na página 1de 18

# cat /proc/partitions

major minor
2
8
8
8
8
11
253
253
253

#blocks

name

0
4 fd0
0 125829120 sda
1
512000 sda1
2 125316096 sda2
16 20971520 sdb
0
4139008 sr0
0
52428800 dm-0
1
2129920 dm-1
2
70754304 dm-2

# df -i
Filesystem
/dev/mapper/rhel-root
devtmpfs
tmpfs
tmpfs
tmpfs
/dev/mapper/rhel-home
/dev/sda1
/dev/sr0

Inodes
52428800
124024
126349
126349
126349
70754304
512000
0

IUsed IFree
IUse% Mounted on
106928 52321872 1% /
403
123621
1% /dev
6
126343
1% /dev/shm
545
125804
1% /run
13 126336
1% /sys/fs/cgroup
192
70754112 1% /home
328
511672
1% /boot
0
0
-

/run/media/root/RHEL-7.0 Server.x86_64

iso
# umount /dev/sr0 && eject
Insert CD
/ ISO (M)
C:\Program Files (x86)\VMware\VMware
Workstation\linux.iso
/ (C)
# dd if=/dev/sr0 of=/tmp/linux.iso
# mkdir /mnt/iso
# man fstab | grep iso
# echo /tmp/linux.iso /mnt/iso iso9660 defaults 0 0 >>
/etc/fstab
# cat /etc/fstab
...
/dev/mapper/rhel-root /

xfs

defaults 1 1

...
/tmp/linux.iso

/mnt/iso iso9660

defaults 0 0

# mount -a
mount: /dev/loop0 is write-protected, mounting read-only

# mount | grep iso


/tmp/linux.iso on /mnt/iso type iso9660 (ro,relatime)

# df -h /mnt/iso
Filesystem
/dev/loop0

Size
61M

Used Avail Use% Mounted on


61M
0 100% /mnt/iso

# ls /mnt/iso/
manifest.txt
VMwareTools-9.6.2-1688356.tar.gz
vmware-tools-upgrader-64
run_upgrader.sh vmware-tools-upgrader-32

nfs

Network File System

2049/tcp
PROTOCOL
111/udp
nfs-utils
RPMS
setup
rpcbind
CONF
/etc/exports
nfs-server
DAEMON
rpcbind
FUCTION

# rpcinfo -p 127.0.0.1
program vers proto
100000
4
tcp
100000
3
tcp

port service
111 portmapper
111 portmapper

100000
100000
100000
100000
100024
100024
100005
100005
100005
100005
100005
100005
100003
100003
100227
100003
100003
100227
100021
100021
100021
100021
100021

2
4
3
2
1
1
1
1
2
2
3
3
3
4
3
3
4
3
1
3
4
1
3

tcp
udp
udp
udp
udp
tcp
udp
tcp
udp
tcp
udp
tcp
tcp
tcp
tcp
udp
udp
udp
udp
udp
udp
tcp
tcp

111
111
111
111
37229
36332
20048
20048
20048
20048
20048
20048
2049
2049
2049
2049
2049
2049
41460
41460
41460
40302
40302

portmapper
portmapper
portmapper
portmapper
status
status
mountd
mountd
mountd
mountd
mountd
mountd
nfs
nfs
nfs_acl
nfs
nfs
nfs_acl
nlockmgr
nlockmgr
nlockmgr
nlockmgr
nlockmgr

100021
100011
100011
100011
100011

4
1
2
1
2

tcp
udp
udp
tcp
tcp

40302
875
875
875
875

nlockmgr
rquotad
rquotad
rquotad
rquotad

hostname:
ip:
physical:

Server
rh.ol.com
172.16.7.1/16
Host-only
/common

Client/Linux
172.16.7.8/16
Host-only
/pub

%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

/common

172.16.0.0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Server172.16.7.1/16 rh.ol.com
Physical
# nmtui
# service network restart
# ifconfig | grep -A1 flag
eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.7.1 netmask 255.255.0.0 broadcast 172.16.255.255
...

# hostname rh.ol.com
# hostname
rh.ol.com

# echo rh.ol.com > /etc/hostname


# cat /etc/hostname

rh.ol.com

# echo 172.16.7.1 rh.ol.com >> /etc/hosts


# cat /etc/hosts
...
172.16.7.1 rh.ol.com

# rpm q nfs-utils setup rpcbind


nfs-utils-1.3.0-0.el7.x86_64
setup-2.8.71-4.el7.noarch
rpcbind-0.2.0-23.el7.x86_64

# rpm -qc setup | grep export


/etc/exports

#
#
#
#

mkdir /common
man exports
echo /common 172.16.0.0/16(rw,sync) >> /etc/exports
cat /etc/exports

/common 172.16.0.0/16(rw,sync)

# systemctl status rpcbind | grep -iE 'load|active'


Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; enabled)
Active: active (running) since Thu 2014-08-07 10:11:49 CST; 1h 59min
ago

# service nfs-server restart

Redirecting to /bin/systemctl restart

nfs-server.service

# chkconfig nfs-server on
Note: Forwarding request to 'systemctl enable nfs-server.service'.
ln -s '/usr/lib/systemd/system/nfs-server.service'
'/etc/systemd/system/nfs.target.wants/nfs-server.service'

# firewall-cmd --list-all
# firewall-cmd --permanent --add-service=nfs
success

# firewall-cmd --permanent --add-port=111/tcp


success

# firewall-cmd --permanent --add-port=111/udp


success

# firewall-cmd --permanent --add-port=20048/tcp


success

# firewall-cmd --permanent --add-port=20048/udp


success

# service firewalld restart


Redirecting to /bin/systemctl restart

# showmount -e 172.16.7.1
Export list for 172.16.7.1:
/common 172.16.0.0/16

firewalld.service

Client
Physical
# nmtui
# service network restart
# ping -c1 172.16.7.1
PING 172.16.7.1 (172.16.7.1) 56(84) bytes of data.
64 bytes from 172.16.7.1: icmp_seq=1 ttl=64 time=0.569 ms
...

# showmount -e 172.16.7.1
Export list for 172.16.7.1:
/common 172.16.0.0/16

# mkdir /pub
# echo 172.16.7.1:/common /pub nfs soft 0 0 >> /etc/fstab
# cat /etc/fstab
...
/dev/mapper/rhel-root
/
xfs
defaults
1
UUID=65b3b11d-46de-4fa5-9e0e-e0717393b28e /boot xfs
defaults
/dev/mapper/rhel-home
/home
xfs
defaults
1
/dev/mapper/rhel-swap
swap
swap
defaults
0
172.16.7.1:/common
/pub
nfs
soft
0

1
1 2
2
0
0

# mount -a
# findmnt /pub
TARGET SOURCE
FSTYPE OPTIONS
/pub
172.16.7.1:/common nfs4
rw,relatime,vers=4.0,rsize=131072,wsize=13

# shutdown -r 0
# findmnt /pub
TARGET SOURCE
FSTYPE OPTIONS
/pub
172.16.7.1:/common nfs4
rw,relatime,vers=4.0,rsize=131072,wsize=13

%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
no_root_squash
root root

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Client
# cp /etc/fstab /pub
cp: cannot create regular file /pub/fstab: Permission denied

# id
uid=0(root) gid=0(root) groups=0(root)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

# ssh 172.16.7.1 ls -ld /common


root@172.16.7.1's password:
drwxr-xr-x. 2 root root 6 Aug

7 11:50 /common

Server
# sed -i 's/)/,no_root_squash)/' /etc/exports
# service nfs-server restart
Client
# cp /etc/fstab /pub
# ssh 172.16.7.1 ls -l /common
root@172.16.7.1's password:
total 4
-rw-r--r--. 1 root root 580 Aug

7 14:59 fstab

autofs
FUCTION

PROTOCOL
RPMS
autofs
/etc/auto.master
/etc/auto.misc
CONF
/etc/auto.net
/etc/auto.smb
DAEMON
autofs

%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/misc/cd
/net/ip hostname

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Client
# rpm -q autofs
package autofs is not installed

# yum -y install autofs


# service autofs start
Redirecting to /bin/systemctl start

autofs.service

# chkconfig autofs on
Note: Forwarding request to 'systemctl enable autofs.service'.
ln -s '/usr/lib/systemd/system/autofs.service'
'/etc/systemd/system/multi-user.target.wants/autofs.service'

# ls /misc/
# ls /misc/cd
addons images
Packages
RPM-GPG-KEY-redhat-release
EFI
isolinux
release-notes
TRANS.TBL
EULA
LiveOS
repodata
GPL
media.repo RPM-GPG-KEY-redhat-beta

# echo 172.16.7.1 rh.ol.com >> /etc/hosts


# ls /net
# ls /net/rh.ol.com
common

# ls /net/rh.ol.com/common/
fstab

# grep -v ^$ /etc/auto.master | grep -v "#"


/misc
/etc/auto.misc
/net
-hosts
+dir:/etc/auto.master.d
+auto.master

# grep -v ^$ /etc/auto.misc | grep -v "#"


cd

-fstype=iso9660,ro,nosuid,nodev :/dev/cdrom

# ls /etc/auto.master.d/

Você também pode gostar