ETC/자격증
[리눅스마스터]제1702회 리눅스마스터 1급 2차 시험 단답식 풀이 2
AnKiWoong
2022. 4. 7. 07:57
반응형
4. 다음은 RPM 패키지를 삭제하는 과정이다. ( 괄호 ) 안에 알맞은 옵션을 넣으시오.
[root@ihd ~]# rpm ( ① ) httpd
error: Failed dependencies:
httpd-mmn = 20051115 is needed by (installed) mod_nss-1.0.10-1.el6.x86_64
httpd-mmn = 20051115 is needed by (installed) mod_perl-2.0.4-11.el6_5.x86_64
httpd-mmn = 20051115 is needed by (installed) mod_wsgi-3.2-7.el6.x86_64
httpd-mmn = 20051115 is needed by (installed) mod_authnz_pam-0.9.2-1.el6.x86_64
httpd-mmn = 20051115 is needed by (installed) mod_auth_kerb-5.4-13.el6.x86_64
[root@ihd ~]# rpm ( ① ) httpd ( ② )
<조 건>
- RPM 명령으로 httpd 패키지를 삭제하려고 한다.
- httpd 패키지와 의존성 패키지를 무시하고 삭제한다.
[root@server1 ~]# man rpm
ERASE OPTIONS
The general form of an rpm erase command is
rpm {-e|--erase} [--allmatches] [--justdb] [--nodeps] [--noscripts] [--notriggers] [--test] PACKAGE_NAME
...
The following options may also be used:
--allmatches
Remove all versions of the package which match PACKAGE_NAME. Normally an error is issued if PACK‐
AGE_NAME matches multiple packages.
--justdb
Update only the database, not the filesystem.
--nodeps
Don't check dependencies before uninstalling the packages.
--noscripts
--nopreun
--nopostun
Don't execute the scriptlet of the same name. The --noscripts option during package erase is
equivalent to
--nopreun --nopostun
and turns off the execution of the corresponding %preun, and %postun scriptlet(s).
--notriggers
--notriggerun
--notriggerpostun
Don't execute any trigger scriptlet of the named type. The --notriggers option is equivalent to
--notriggerun --notriggerpostun
and turns off execution of the corresponding %triggerun, and %triggerpostun scriptlet(s).
--test Don't really uninstall anything, just go through the motions. Useful in conjunction with the -vv
option for debugging.
① -e
② --nodeps
5. 다음은 디바이스 장치 추가 내용 이다. ( 괄호 ) 안에 알맞은 옵션을 넣으시오.
[root@ihd ~]# vi /etc/fstab
( ① ) ( ② ) ext4 defaults ( ➂ ) ( ➃ )
<조 건>
- /dev/sdb1 을 /data 디렉터리에 ext4 으로 자동 마운트되도록 설정한다.
- 부팅시 /dev/sdb1 디바이스의 파일시스템 점검하고 dump를 사용을 하지 않는다.
[root@server1 ~]# find / -name fstab
/etc/fstab
[root@server1 ~]# vi /etc/fstab
#
# /etc/fstab
# Created by anaconda on Mon Mar 14 11:42:35 2022
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root / xfs defaults 1 1
UUID=6a56e2c4-ca18-466e-8213-3520a7311d47 /boot xfs defaults 1 2
/dev/mapper/centos-swap swap swap defaults 0 0
DESCRIPTION
The file fstab contains descriptive information about the various file systems. fstab is only read by
programs, and not written; it is the duty of the system administrator to properly create and maintain
this file. Each filesystem is described on a separate line; fields on each line are separated by tabs
or spaces. Lines starting with '#' are comments, blank lines are ignored. The order of records in fstab
is important because fsck(8), mount(8), and umount(8) sequentially iterate through fstab doing their
thing.
The first field (fs_spec).
This field describes the block special device or remote filesystem to be mounted.
For ordinary mounts it will hold (a link to) a block special device node (as created by mknod(8))
for the device to be mounted, like `/dev/cdrom' or `/dev/sdb7'. For NFS mounts one will have
<host>:<dir>, e.g., `knuth.aeb.nl:/'. For procfs, use `proc'.
Instead of giving the device explicitly, one may indicate the filesystem that is to be mounted by
its UUID or LABEL (cf. e2label(8) or xfs_admin(8)), writing LABEL=<label> or UUID=<uuid>, e.g.,
`LABEL=Boot' or `UUID=3e6be9de-8139-11d1-9106-a43f08d823a6'.
It's also possible to use PARTUUID= and PARTLABEL=. These partitions identifiers are supported
for GUID Partition Table (GPT) and MAC partition table only.
See blkid(8) or lsblk(8) for more details about devices identifiers.
Note that mount(8) uses UUIDs as strings. The string representation of the UUID should be based
on lower case characters.
The second field (fs_file).
This field describes the mount point for the filesystem. For swap partitions, this field should
be specified as `none'. If the name of the mount point contains spaces these can be escaped as
`\040'.
The third field (fs_vfstype).
This field describes the type of the filesystem. Linux supports lots of filesystem types, such
as adfs, affs, autofs, coda, coherent, cramfs, devpts, efs, ext2, ext3, hfs, hpfs, iso9660, jfs,
minix, msdos, ncpfs, nfs, ntfs, proc, qnx4, reiserfs, romfs, smbfs, sysv, tmpfs, udf, ufs, ums‐
dos, vfat, xenix, xfs, and possibly others. For more details, see mount(8).
For the filesystems currently supported by the running kernel, see /proc/filesystems.
An entry swap denotes a file or partition to be used for swapping, cf. swapon(8). An entry none
is useful for bind or move mounts.
mount(8) and umount(8) support filesystem subtypes. The subtype is defined by '.subtype' suffix.
For example 'fuse.sshfs'. It's recommended to use subtype notation rather than add any prefix to
the first fstab field (for example 'sshfs#example.com' is deprecated).
The fourth field (fs_mntops).
This field describes the mount options associated with the filesystem.
It is formatted as a comma separated list of options. It contains at least the type of mount
plus any additional options appropriate to the filesystem type. For documentation on the avail‐
able mount options, see mount(8). For documentation on the available swap options, see
swapon(8).
Basic file system independent options are:
defaults
use default options: rw, suid, dev, exec, auto, nouser, and async.
noauto do not mount when "mount -a" is given (e.g., at boot time)
user allow a user to mount
owner allow device owner to mount
comment
or x-<name> for use by fstab-maintaining programs
nofail do not report errors for this device if it does not exist.
The fifth field (fs_freq).
This field is used for these filesystems by the dump(8) command to determine which filesystems
need to be dumped. If the fifth field is not present, a value of zero is returned and dump will
assume that the filesystem does not need to be dumped.
The sixth field (fs_passno).
This field is used by the fsck(8) program to determine the order in which filesystem checks are
done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other
filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequen‐
tially, but filesystems on different drives will be checked at the same time to utilize parallel‐
ism available in the hardware. If the sixth field is not present or zero, a value of zero is
returned and fsck will assume that the filesystem does not need to be checked.
① /dev/sdb1
② /data
③ 0
④ 1
6. 다음은 하드디스크 관리에 대한 내용이다. 아래의 조건에 맞게 ( 괄호 ) 안에 알맞은 내용을 적으시오.
가. 디스크 파티션 UUID를 출력한다.
# ( ① )
/dev/sda1: UUID="debcbb0b-706a-4094-ba09-1089488d1688" TYPE="ext4" PARTUUID="5572c833-01"
/dev/sda2: UUID="0EiQcQ-xVyg-vscf-Z9u1-7Zdv-lS7J-VQOdAQ" TYPE="LVM2_member" PARTUUID="5572c833-02"
/dev/mapper/swap: UUID="ea0e4ddc-43a2-4876-b85c-7fa93507e201" TYPE="swap"
/dev/mapper/root: UUID="7db65424-e63a-4307-80c5-53438592ecee" TYPE="ext4"
나. /dev/sda1의 I/O 제한 정보를 출력한다.
# ( ① ) ( ② )
<조 건>
- ① 은 블록 디바이스 속성과 UUID를 출력해주는 명령어를 사용한다.
- ➁ 는 ➀ 명령어의 옵션을 기재한다.
blkid : 블록 디바이스 정보 조회 / 파일시스템의 UUID 확인
[root@server1 ~]# blkid
/dev/sda1: UUID="6a56e2c4-ca18-466e-8213-3520a7311d47" TYPE="xfs"
/dev/sda2: UUID="QoaGsn-dkAD-hNAY-hlcA-cpi1-hO8w-Xp7SXU" TYPE="LVM2_member"
/dev/mapper/centos-swap: UUID="ca4117a3-2ffe-47aa-af85-e31e8ffc6c1e" TYPE="swap"
/dev/mapper/centos-root: UUID="ce44fd25-f9d1-4713-ae82-85ecc1b7dfb2" TYPE="xfs"
[root@server1 ~]# blkid -help
blkid from util-linux 2.23.2 (libblkid 2.23.0, 25-Apr-2013)
Usage:
blkid -L <label> | -U <uuid>
blkid [-c <file>] [-ghlLv] [-o <format>] [-s <tag>]
[-t <token>] [<dev> ...]
blkid -p [-s <tag>] [-O <offset>] [-S <size>]
[-o <format>] <dev> ...
blkid -i [-s <tag>] [-o <format>] <dev> ...
Options:
-c <file> read from <file> instead of reading from the default
cache file (-c /dev/null means no cache)
-d don't encode non-printing characters
-h print this usage message and exit
-g garbage collect the blkid cache
-o <format> output format; can be one of:
value, device, export or full; (default: full)
-k list all known filesystems/RAIDs and exit
-s <tag> show specified tag(s) (default show all tags)
-t <token> find device with a specific token (NAME=value pair)
-l look up only first device with token specified by -t
-L <label> convert LABEL to device name
-U <uuid> convert UUID to device name
-V print version and exit
<dev> specify device(s) to probe (default: all devices)
Low-level probing options:
-p low-level superblocks probing (bypass cache)
-i gather information about I/O limits
-S <size> overwrite device size
-O <offset> probe at the given offset
-u <list> filter by "usage" (e.g. -u filesystem,raid)
-n <list> filter by filesystem type (e.g. -n vfat,ext3)
[root@server1 ~]# blkid -i /dev/sda1
DEVNAME=/dev/sda1
MINIMUM_IO_SIZE=512
PHYSICAL_SECTOR_SIZE=512
LOGICAL_SECTOR_SIZE=512
① blkid
② -i /dev/sda1
반응형