Sie sind auf Seite 1von 15

PRACTICE 2

SAIGONLAB 83 Nguyễn Thị Nhỏ, P9, Q.Tân Bình, Tp. HCM LPI 102
Objectives
 Managing Disk Storage
 Checkinstall tool
 Network File System (NFS)

SAIGONLAB 83 Nguyễn Thị Nhỏ, P9, Q.Tân Bình, Tp. HCM LPI 102
Managing Disk Storage
 Parted tool
#parted /dev/hda
GNU Parted 1.6.19
Copyright (C) 1998 - 2004 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Using /dev/hda
(parted) print
Disk geometry for /dev/hda: 0.000-38166.679 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
1 0.031 10244.575 primary fat32 boot, lba
2 10244.575 38162.219 extended lba
7 10244.637 23242.478 logical ext3
8 23242.509 24238.696 logical ext3
6 24246.571 25242.758 logical linux-swap
5 25250.634 38162.219 logical fat32

SAIGONLAB 83 Nguyễn Thị Nhỏ, P9, Q.Tân Bình, Tp. HCM LPI 102
Managing Disk Storage

 Make partition
(parted)help mkpart
(parted)mkpart PART-TYPE START END
 Label partition
e2label /dev/hda1 /data
 Remove partition
(parted)rm minor

SAIGONLAB 83 Nguyễn Thị Nhỏ, P9, Q.Tân Bình, Tp. HCM LPI 102
Managing Disk Storage
 Resize partition
(parted) resize MINOR START END

SAIGONLAB 83 Nguyễn Thị Nhỏ, P9, Q.Tân Bình, Tp. HCM LPI 102
Checkinstall Tool

 The steps make binary package from source


 ./configure
 make
 make install
 checkinstall

SAIGONLAB 83 Nguyễn Thị Nhỏ, P9, Q.Tân Bình, Tp. HCM LPI 102
How to install checkinstall tool

 Download source from


http://asic-linux.com.mx/~izto/checkinstall/index.php
 tar xfz checkinstall-1.6.0.tar.gz
 cd checkinstall-1.6.0
 make
 make install

SAIGONLAB 83 Nguyễn Thị Nhỏ, P9, Q.Tân Bình, Tp. HCM LPI 102
Network File System (NFS)

 A Network File System (NFS)


 allows remote hosts to mount file systems over a network and interact
with those file systems as though they are mounted locally. This
enables system administrators to consolidate resources onto
centralized servers on the network.
 Three versions of NFS
 NFS version 2 (NFSv2)
 NFS version 3 (NFSv3)
 NFS version 4 (NFSv4)

SAIGONLAB 83 Nguyễn Thị Nhỏ, P9, Q.Tân Bình, Tp. HCM LPI 102
Network File System (NFS)

 NFSv2 and NFSv3 use UDP protocol port 2049


 nfs — Starts the appropriate RPC processes to service requests
for shared NFS file systems.
 nfslock — An optional service that starts the appropriate RPC
processes to allow NFS clients to lock files on the server.
 portmap — The RPC service for Linux; it responds to requests
for RPC services and sets up connections to the requested RPC
service.

SAIGONLAB 83 Nguyễn Thị Nhỏ, P9, Q.Tân Bình, Tp. HCM LPI 102
Network File System (NFS)

 Starting and Stopping NFS


 /etc/init.d/portmap status
 /sbin/service nfs start
 /etc/init.d/nfs stop
 /etc/init.d/nfs restart

SAIGONLAB 83 Nguyễn Thị Nhỏ, P9, Q.Tân Bình, Tp. HCM LPI 102
Network File System (NFS)

 NFS Server Configuration


 The /etc/exports Configuration File
 <export> <host1>(<options>) <hostN>(<options>)...
 replace <export> with the directory being exported
 replace <host1> with the host or network to which the export is being
shared
 replace <options> with the options for that host or network
 Hosts1:
 Single host: hostname or ip
 Ip network: 192.168.1.0/24 …
 Examples:
 /data1 host1
 /data2 192.168.2.0/24

SAIGONLAB 83 Nguyễn Thị Nhỏ, P9, Q.Tân Bình, Tp. HCM LPI 102
Network File System (NFS)

 Default options:
 ro
 wdelay: opposite of it is no_wdelay
 root_squash: opposite of it is no_root_squash
 Different two line
 /home bob.example.com(rw)
 /home bob.example.com (rw)

SAIGONLAB 83 Nguyễn Thị Nhỏ, P9, Q.Tân Bình, Tp. HCM LPI 102
Network File System (NFS)

 The exportfs Command (/usr/sbin/exportfs)


 Update direct /var/lib/nfs/xtab

SAIGONLAB 83 Nguyễn Thị Nhỏ, P9, Q.Tân Bình, Tp. HCM LPI 102
Network File System (NFS)

 NFS Client Configuration Files


 Use mount command
 mount -t <nfs-type> -o <options> <host>:</remote/export> </local/directory>
 Edit /etc/fstab
 server>:</remote/export> </local/directory> <nfs-type> <options> 0 0
 autofs
 The autofs service is used to control the automount command through the
/etc/auto.master primary configuration file
 /etc/auto.master
 <mount-point> <map-type>
 Map-type: full path auto.<mount-point>
 </local/directory> -<options> <server>:</remote/export>

SAIGONLAB 83 Nguyễn Thị Nhỏ, P9, Q.Tân Bình, Tp. HCM LPI 102
Setup ACL for File System

 Mount file system with acl option


 mount –o acl /dev/hda1 /data
 Use setfacl, getfacl tool1
 Examples

SAIGONLAB 83 Nguyễn Thị Nhỏ, P9, Q.Tân Bình, Tp. HCM LPI 102

Das könnte Ihnen auch gefallen