[root@linux1 ~]# cat -n /etc/passwd | tail
40 gdm:x:42:42::/var/lib/gdm:/sbin/nologin
41 rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
42 gnome-initial-setup:x:977:975::/run/gnome-initial-setup/:/sbin/nologin
43 sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
44 avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin
45 rngd:x:976:974:Random Number Generator Daemon:/var/lib/rngd:/sbin/nologin
46 tcpdump:x:72:72::/:/sbin/nologin
47 student:x:1000:1000:student:/home/student:/bin/bash
48 user1:x:1001:1001::/home/user1:/bin/bash
49 user2:x:1002:1002::/home/user2:/bin/bash
[root@linux1 ~]#
[root@linux1 ~]# cat -n /etc/passwd | tail
40 gdm:x:42:42::/var/lib/gdm:/sbin/nologin
41 rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
42 gnome-initial-setup:x:977:975::/run/gnome-initial-setup/:/sbin/nologin
43 sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
44 avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin
45 rngd:x:976:974:Random Number Generator Daemon:/var/lib/rngd:/sbin/nologin
46 tcpdump:x:72:72::/:/sbin/nologin
47 student:x:1000:1000:student:/home/student:/bin/bash
48 user1:x:1001:1001::/home/user1:/bin/bash
49 user2:x:1002:1002::/home/user2:/bin/bash
[root@linux1 ~]# userdel -r user2
[root@linux1 ~]# cat -n /etc/passwd | tail
39 colord:x:978:976:User for colord:/var/lib/colord:/sbin/nologin
40 gdm:x:42:42::/var/lib/gdm:/sbin/nologin
41 rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
42 gnome-initial-setup:x:977:975::/run/gnome-initial-setup/:/sbin/nologin
43 sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
44 avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin
45 rngd:x:976:974:Random Number Generator Daemon:/var/lib/rngd:/sbin/nologin
46 tcpdump:x:72:72::/:/sbin/nologin
47 student:x:1000:1000:student:/home/student:/bin/bash
48 user1:x:1001:1001::/home/user1:/bin/bash
[root@linux1 ~]#
[root@linux1 ~]# mkdir -pv /test
mkdir: created directory '/test'
[root@linux1 ~]# ll
합계 36
-rw-r--r--. 1 root root 24 8월 22 18:13 abc.txt
-rw-------. 1 root root 1386 8월 22 15:24 anaconda-ks.cfg
-rw-r--r--. 1 root root 65 8월 22 17:44 err1.txt
-rw-r--r--. 1 root root 20 8월 22 15:53 f1
-rw-r--r--. 1 root root 0 8월 22 16:16 file-16-16.txt
-rw-r--r--. 1 root root 0 8월 22 16:18 file-16-18.txt
-rw-r--r--. 1 root root 13 8월 31 11:09 file1
-rw-r--r--. 1 root root 32 8월 31 11:09 file2
-rw-r--r--. 1 root root 1496 8월 22 15:27 initial-setup-ks.cfg
drwxr-xr-x. 3 root root 17 9월 6 16:39 linux_ex
-rw-r--r--. 1 root root 777 8월 22 17:43 list0.txt
drwxr-xr-x. 3 root root 17 9월 6 16:08 temp
-rw-r--r--. 1 root root 43 8월 22 17:50 test1.txt
drwxr-xr-x. 2 root root 6 9월 6 16:04 tmp1
drwxr-xr-x. 2 root root 6 9월 6 16:04 tmp2
drwxr-xr-x. 2 root root 6 9월 5 13:16 user1
drwxr-xr-x. 2 root root 6 8월 22 15:28 공개
drwxr-xr-x. 2 root root 6 8월 22 15:28 다운로드
drwxr-xr-x. 2 root root 6 8월 22 15:28 문서
drwxr-xr-x. 2 root root 6 8월 22 15:28 바탕화면
drwxr-xr-x. 2 root root 6 8월 22 15:28 비디오
drwxr-xr-x. 2 root root 141 8월 31 11:54 사진
drwxr-xr-x. 2 root root 6 8월 22 15:28 서식
drwxr-xr-x. 2 root root 6 8월 22 15:28 음악
[root@linux1 ~]#
[root@linux1 ~]# ls -l /test
합계 0
[root@linux1 ~]# ls -ld /test
drwxr-xr-x. 2 root root 6 9월 19 10:04 /test
[root@linux1 ~]#
[root@linux1 ~]# chmod o+w -Rv /test
mode of '/test' changed from 0755 (rwxr-xr-x) to 0757 (rwxr-xrwx)
[root@linux1 ~]#
[root@linux1 test]# useradd user1
[root@linux1 test]# useradd user2
[root@linux1 test]# passwd user1
user1 사용자의 비밀 번호 변경 중
새 암호:
새 암호 재입력:
passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.
[root@linux1 test]# passwd user2
user2 사용자의 비밀 번호 변경 중
새 암호:
새 암호 재입력:
passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.
[root@linux1 test]#
[root@linux1 test]# mkdir -pv dir1
mkdir: created directory 'dir1'
[root@linux1 test]# ls -l
합계 0
drwxr-xr-x. 2 root root 6 9월 19 10:11 dir1
[root@linux1 test]#
[root@linux1 test]# su user1
[user1@linux1 test]$
[user1@linux1 test]$ ls -l
합계 0
drwxr-xr-x. 2 root root 6 9월 19 10:11 dir1
[user1@linux1 test]$ cd dir1
[user1@linux1 dir1]$ pwd
/test/dir1
[user1@linux1 dir1]$ mkdir aaa
mkdir: `aaa' 디렉토리를 만들 수 없습니다: 허가 거부
[user1@linux1 dir1]$
[user1@linux1 dir1]$ exit
exit
[root@linux1 test]#
[root@linux1 test]# chmod -Rv o+w dir1
mode of 'dir1' changed from 0755 (rwxr-xr-x) to 0757 (rwxr-xrwx)
[root@linux1 test]# ls -l
합계 0
drwxr-xrwx. 2 root root 6 9월 19 10:11 dir1
[root@linux1 test]# su user1
[user1@linux1 test]$ cd dir1/
[user1@linux1 dir1]$ mkdir aaa
[user1@linux1 dir1]$ ls -l
합계 0
drwxrwxr-x. 2 user1 user1 6 9월 19 10:15 aaa
[user1@linux1 dir1]$ su user2
암호:
[user2@linux1 dir1]$
[user2@linux1 dir1]$ mkdir bbb
[user2@linux1 dir1]$ ls -l
합계 0
drwxrwxr-x. 2 user1 user1 6 9월 19 10:15 aaa
drwxrwxr-x. 2 user2 user2 6 9월 19 10:16 bbb
[user2@linux1 dir1]$
[root@linux1 test]# chmod g+w dir1
[root@linux1 test]# ls -l
합계 0
drwxrwxr-x. 4 root root 28 9월 19 10:16 dir1
[root@linux1 test]# grep root /etc/group
root:x:0:
[root@linux1 test]# usermod -G root user1
[root@linux1 test]# grep root /etc/group
root:x:0:user1
[root@linux1 test]#
[root@linux1 test]# su user1
[user1@linux1 test]$ cd dir1/
[user1@linux1 dir1]$ mkdir ccc
[user1@linux1 dir1]$ ll
합계 0
drwxrwxr-x. 2 user1 user1 6 9월 19 10:15 aaa
drwxrwxr-x. 2 user2 user2 6 9월 19 10:16 bbb
drwxrwxr-x. 2 user1 user1 6 9월 19 10:20 ccc
[user1@linux1 dir1]$ su user2
암호:
[user2@linux1 dir1]$ mkdir ddd
mkdir: `ddd' 디렉토리를 만들 수 없습니다: 허가 거부
[user2@linux1 dir1]$
[root@linux1 test]# getfacl dir1
# file: dir1
# owner: root
# group: root
user::rwx
group::rwx
other::r-x
[root@linux1 test]# chmod g-w dir1
[root@linux1 test]# getfacl dir1
# file: dir1
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
[root@linux1 test]# getfacl dir1
# file: dir1
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
[root@linux1 test]# setfacl -m u:user1:rwx dir1
[root@linux1 test]# getfacl dir1
# file: dir1
# owner: root
# group: root
user::rwx
user:user1:rwx
group::r-x
mask::rwx
other::r-x
[root@linux1 test]# setfacl -m u:user2:rwx dir1
[root@linux1 test]# getfacl dir1
# file: dir1
# owner: root
# group: root
user::rwx
user:user1:rwx
user:user2:rwx
group::r-x
mask::rwx
other::r-x
[root@linux1 test]#
[root@linux1 test]# su - user1
[user1@linux1 ~]$ pwd
/home/user1
[user1@linux1 ~]$
[root@linux1 dir1]$ su user1
암호:
[user1@linux1 dir1]$ su user3
암호:
[user3@linux1 dir1]$ mkdir hhh
mkdir: `hhh' 디렉토리를 만들 수 없습니다: 허가 거부
[user3@linux1 dir1]$
[root@linux1 test]# groupadd admins
[root@linux1 test]# groupadd sales
[root@linux1 test]# useradd -G admins a1
[root@linux1 test]# useradd -G admins a2
[root@linux1 test]# useradd -G sales s1
[root@linux1 test]# useradd -G sales s2
[root@linux1 test]# passwd a1
a1 사용자의 비밀 번호 변경 중
새 암호:
새 암호 재입력:
passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.
[root@linux1 test]# passwd a2
a2 사용자의 비밀 번호 변경 중
새 암호:
새 암호 재입력:
passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.
[root@linux1 test]# passwd s1
s1 사용자의 비밀 번호 변경 중
새 암호:
새 암호 재입력:
passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.
[root@linux1 test]# passwd s2
s2 사용자의 비밀 번호 변경 중
새 암호:
새 암호 재입력:
passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.
[root@linux1 test]# grep sales /etc/group
sales:x:1005:s1,s2
[root@linux1 test]# grep admins /etc/group
admins:x:1004:a1,a2
[root@linux1 test]#
[root@linux1 test]# chmod -Rv 750 dir1
mode of 'dir1' changed from 0775 (rwxrwxr-x) to 0750 (rwxr-x---)
mode of 'dir1/aaa' changed from 0775 (rwxrwxr-x) to 0750 (rwxr-x---)
mode of 'dir1/bbb' changed from 0775 (rwxrwxr-x) to 0750 (rwxr-x---)
mode of 'dir1/ccc' changed from 0775 (rwxrwxr-x) to 0750 (rwxr-x---)
mode of 'dir1/kkk' changed from 0775 (rwxrwxr-x) to 0750 (rwxr-x---)
[root@linux1 test]# ll
합계 0
drwxr-x---+ 6 root root 50 9월 19 10:48 dir1
[root@linux1 test]#
[root@linux1 test]# getfacl dir1
# file: dir1
# owner: root
# group: root
user::rwx
user:user1:rwx #effective:r-x
user:user2:rwx #effective:r-x
group::r-x
mask::r-x
other::---
[root@linux1 test]# setfacl -x u:user1 dir1
[root@linux1 test]# setfacl -x u:user2 dir1
[root@linux1 test]# getfacl dir1
# file: dir1
# owner: root
# group: root
user::rwx
group::r-x
mask::r-x
other::---
[root@linux1 test]#
[root@linux1 test]# getfacl dir1
# file: dir1
# owner: root
# group: root
user::rwx
group::r-x
mask::r-x
other::---
[root@linux1 test]# setfacl -m g:sales:r-x dir1
[root@linux1 test]# setfacl -m g:admins:rwx dir1
[root@linux1 test]# getfacl dir1
# file: dir1
# owner: root
# group: root
user::rwx
group::r-x
group:admins:rwx
group:sales:r-x
mask::rwx
other::---
[root@linux1 test]# su a1
[a1@linux1 test]$ mkdir dir1/mmm
[root@linux1 test]# su s1
[s1@linux1 test]$ mkdir dir1/nnn
mkdir: `dir1/nnn' 디렉토리를 만들 수 없습니다: 허가 거부
[s1@linux1 test]$ ll dir1
합계 0
drwxr-x---. 2 user1 user1 6 9월 19 10:15 aaa
drwxr-x---. 2 user2 user2 6 9월 19 10:16 bbb
drwxr-x---. 2 user1 user1 6 9월 19 10:20 ccc
drwxr-x---. 2 user1 user1 6 9월 19 10:48 kkk
drwxrwxr-x. 2 a1 a1 6 9월 19 11:01 mmm
[s1@linux1 test]$ cd dir1
[s1@linux1 dir1]$
[root@linux1 ~]# cd /boot/grub2
[root@linux1 grub2]# ll
합계 32
-rw-r--r--. 1 root root 64 8월 22 15:22 device.map
drwxr-xr-x. 2 root root 4096 8월 22 15:22 fonts
-rw-r--r--. 1 root root 5132 8월 22 15:22 grub.cfg
-rw-r--r--. 1 root root 1024 8월 22 15:22 grubenv
drwxr-xr-x. 2 root root 12288 8월 22 15:22 i386-pc
[root@linux1 grub2]# pwd
/boot/grub2
[root@linux1 grub2]# vim grub.cfg
63 if [ x$feature_timeout_style = xy ] ; then
64 set timeout_style=menu
65 set timeout=50
66 # Fallback normal timeout code in case the timeout_style feature is
67 # unavailable.
68 else
69 set timeout=50
70 fi
[root@linux1 ~]# ll /dev/sd?
brw-rw----. 1 root disk 8, 0 9월 19 12:53 /dev/sda
brw-rw----. 1 root disk 8, 16 9월 19 12:53 /dev/sdb
brw-rw----. 1 root disk 8, 32 9월 19 12:53 /dev/sdc
[root@linux1 ~]#
[root@linux1 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 19G 0 part
├─cl-root 253:0 0 17G 0 lvm /
└─cl-swap 253:1 0 2G 0 lvm [SWAP]
sdb 8:16 0 20G 0 disk
sdc 8:32 0 20G 0 disk
sr0 11:0 1 7.7G 0 rom /run/media/root/CentOS-8-2-2004-x86_64-dvd
[root@linux1 ~]#
[root@linux1 ~]# fdisk -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0344937f
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 2099199 2097152 1G 83 Linux
/dev/sda2 2099200 41943039 39843840 19G 8e Linux LVM
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sdc: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/cl-root: 17 GiB, 18249416704 bytes, 35643392 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/cl-swap: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@linux1 ~]#
[root@linux1 ~]# fdisk -l /dev/sdb
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@linux1 ~]#
[root@linux1 ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xbd0cdd77.
Command (m for help): m
Help:
DOS (MBR)
a toggle a bootable flag
b edit nested BSD disklabel
c toggle the dos compatibility flag
Generic
d delete a partition
F list free unpartitioned space
l list known partition types
n add a new partition
p print the partition table
t change a partition type
v verify the partition table
i print information about a partition
Misc
m print this menu
u change display/entry units
x extra functionality (experts only)
Script
I load disk layout from sfdisk script file
O dump disk layout to sfdisk script file
Save & Exit
w write table to disk and exit
q quit without saving changes
Create a new label
g create a new empty GPT partition table
G create a new empty SGI (IRIX) partition table
o create a new empty DOS partition table
s create a new empty Sun partition table
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (1-4, default 1):
First sector (2048-41943039, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039): +100M
Created a new partition 1 of type 'Linux' and of size 100 MiB.
Command (m for help): p
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbd0cdd77
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 206847 204800 100M 83 Linux
Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (2-4, default 2):
First sector (206848-41943039, default 206848):
Last sector, +sectors or +size{K,M,G,T,P} (206848-41943039, default 41943039): +100M
Created a new partition 2 of type 'Linux' and of size 100 MiB.
Command (m for help): p
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbd0cdd77
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 206847 204800 100M 83 Linux
/dev/sdb2 206848 411647 204800 100M 83 Linux
Command (m for help): n
Partition type
p primary (2 primary, 0 extended, 2 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (3,4, default 3):
First sector (411648-41943039, default 411648):
Last sector, +sectors or +size{K,M,G,T,P} (411648-41943039, default 41943039): +100M
Created a new partition 3 of type 'Linux' and of size 100 MiB.
Command (m for help): p
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbd0cdd77
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 206847 204800 100M 83 Linux
/dev/sdb2 206848 411647 204800 100M 83 Linux
/dev/sdb3 411648 616447 204800 100M 83 Linux
Command (m for help): n
Partition type
p primary (3 primary, 0 extended, 1 free)
e extended (container for logical partitions)
Select (default e):
Using default response e.
Selected partition 4
First sector (616448-41943039, default 616448):
Last sector, +sectors or +size{K,M,G,T,P} (616448-41943039, default 41943039):
Created a new partition 4 of type 'Extended' and of size 19.7 GiB.
Command (m for help): p
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbd0cdd77
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 206847 204800 100M 83 Linux
/dev/sdb2 206848 411647 204800 100M 83 Linux
/dev/sdb3 411648 616447 204800 100M 83 Linux
/dev/sdb4 616448 41943039 41326592 19.7G 5 Extended
Command (m for help): n
All primary partitions are in use.
Adding logical partition 5
First sector (618496-41943039, default 618496):
Last sector, +sectors or +size{K,M,G,T,P} (618496-41943039, default 41943039): +100M
Created a new partition 5 of type 'Linux' and of size 100 MiB.
Command (m for help): p
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbd0cdd77
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 206847 204800 100M 83 Linux
/dev/sdb2 206848 411647 204800 100M 83 Linux
/dev/sdb3 411648 616447 204800 100M 83 Linux
/dev/sdb4 616448 41943039 41326592 19.7G 5 Extended
/dev/sdb5 618496 823295 204800 100M 83 Linux
Command (m for help): n
All primary partitions are in use.
Adding logical partition 6
First sector (825344-41943039, default 825344):
Last sector, +sectors or +size{K,M,G,T,P} (825344-41943039, default 41943039): +100M
Created a new partition 6 of type 'Linux' and of size 100 MiB.
Command (m for help): p
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbd0cdd77
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 206847 204800 100M 83 Linux
/dev/sdb2 206848 411647 204800 100M 83 Linux
/dev/sdb3 411648 616447 204800 100M 83 Linux
/dev/sdb4 616448 41943039 41326592 19.7G 5 Extended
/dev/sdb5 618496 823295 204800 100M 83 Linux
/dev/sdb6 825344 1030143 204800 100M 83 Linux
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[root@linux1 ~]# ll /dev/sdb?
brw-rw----. 1 root disk 8, 17 9월 19 13:19 /dev/sdb1
brw-rw----. 1 root disk 8, 18 9월 19 13:19 /dev/sdb2
brw-rw----. 1 root disk 8, 19 9월 19 13:19 /dev/sdb3
brw-rw----. 1 root disk 8, 20 9월 19 13:19 /dev/sdb4
brw-rw----. 1 root disk 8, 21 9월 19 13:19 /dev/sdb5
brw-rw----. 1 root disk 8, 22 9월 19 13:19 /dev/sdb6
[root@linux1 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 19G 0 part
├─cl-root 253:0 0 17G 0 lvm /
└─cl-swap 253:1 0 2G 0 lvm [SWAP]
sdb 8:16 0 20G 0 disk
├─sdb1 8:17 0 100M 0 part
├─sdb2 8:18 0 100M 0 part
├─sdb3 8:19 0 100M 0 part
├─sdb4 8:20 0 1K 0 part
├─sdb5 8:21 0 100M 0 part
└─sdb6 8:22 0 100M 0 part
sdc 8:32 0 20G 0 disk
sr0 11:0 1 7.7G 0 rom /run/media/root/CentOS-8-2-2004-x86_64-dvd
[root@linux1 ~]# lsblk /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 20G 0 disk
├─sdb1 8:17 0 100M 0 part
├─sdb2 8:18 0 100M 0 part
├─sdb3 8:19 0 100M 0 part
├─sdb4 8:20 0 1K 0 part
├─sdb5 8:21 0 100M 0 part
└─sdb6 8:22 0 100M 0 part
[root@linux1 ~]#
[root@linux1 ~]# ls -l /dev/sdb*
brw-rw----. 1 root disk 8, 16 9월 19 13:19 /dev/sdb
brw-rw----. 1 root disk 8, 17 9월 19 13:19 /dev/sdb1
brw-rw----. 1 root disk 8, 18 9월 19 13:19 /dev/sdb2
brw-rw----. 1 root disk 8, 19 9월 19 13:19 /dev/sdb3
brw-rw----. 1 root disk 8, 20 9월 19 13:19 /dev/sdb4
brw-rw----. 1 root disk 8, 21 9월 19 13:19 /dev/sdb5
brw-rw----. 1 root disk 8, 22 9월 19 13:19 /dev/sdb6
[root@linux1 ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): m
Help:
DOS (MBR)
a toggle a bootable flag
b edit nested BSD disklabel
c toggle the dos compatibility flag
Generic
d delete a partition
F list free unpartitioned space
l list known partition types
n add a new partition
p print the partition table
t change a partition type
v verify the partition table
i print information about a partition
Misc
m print this menu
u change display/entry units
x extra functionality (experts only)
Script
I load disk layout from sfdisk script file
O dump disk layout to sfdisk script file
Save & Exit
w write table to disk and exit
q quit without saving changes
Create a new label
g create a new empty GPT partition table
G create a new empty SGI (IRIX) partition table
o create a new empty DOS partition table
s create a new empty Sun partition table
Command (m for help): p
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbd0cdd77
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 206847 204800 100M 83 Linux
/dev/sdb2 206848 411647 204800 100M 83 Linux
/dev/sdb3 411648 616447 204800 100M 83 Linux
/dev/sdb4 616448 41943039 41326592 19.7G 5 Extended
/dev/sdb5 618496 823295 204800 100M 83 Linux
/dev/sdb6 825344 1030143 204800 100M 83 Linux
Command (m for help): d
Partition number (1-6, default 6): 6
Partition 6 has been deleted.
Command (m for help): p
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbd0cdd77
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 206847 204800 100M 83 Linux
/dev/sdb2 206848 411647 204800 100M 83 Linux
/dev/sdb3 411648 616447 204800 100M 83 Linux
/dev/sdb4 616448 41943039 41326592 19.7G 5 Extended
/dev/sdb5 618496 823295 204800 100M 83 Linux
Command (m for help): d
Partition number (1-5, default 5):
Partition 5 has been deleted.
Command (m for help): p
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbd0cdd77
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 206847 204800 100M 83 Linux
/dev/sdb2 206848 411647 204800 100M 83 Linux
/dev/sdb3 411648 616447 204800 100M 83 Linux
/dev/sdb4 616448 41943039 41326592 19.7G 5 Extended
Command (m for help): d
Partition number (1-4, default 4):
Partition 4 has been deleted.
Command (m for help): d
Partition number (1-3, default 3):
Partition 3 has been deleted.
Command (m for help): d
Partition number (1,2, default 2):
Partition 2 has been deleted.
Command (m for help): d
Selected partition 1
Partition 1 has been deleted.
Command (m for help): p
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbd0cdd77
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[root@linux1 ~]# lsblk /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 20G 0 disk
[root@linux1 ~]#
[root@linux1 ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-41943039, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039): +10G
Created a new partition 1 of type 'Linux' and of size 10 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[root@linux1 ~]# lsblk /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 20G 0 disk
└─sdb1 8:17 0 10G 0 part
[root@linux1 ~]#
[root@linux1 ~]# lsblk /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 20G 0 disk
└─sdb1 8:17 0 10G 0 part
[root@linux1 ~]# lsblk -f /dev/sdb
NAME FSTYPE LABEL UUID MOUNTPOINT
sdb
└─sdb1
[root@linux1 ~]#
[root@linux1 ~]# mkfs.xfs /dev/sdb1
meta-data=/dev/sdb1 isize=512 agcount=4, agsize=655360 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=2621440, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@linux1 ~]# mkfs.xfs -f /dev/sdb1
meta-data=/dev/sdb1 isize=512 agcount=4, agsize=655360 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=2621440, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@linux1 ~]# lsblk -f /dev/sdb
NAME FSTYPE LABEL UUID MOUNTPOINT
sdb
└─sdb1 xfs 5356c54b-8f35-4f42-a3e8-cc6deb7d9588
[root@linux1 ~]#
[root@linux1 ~]# mount /dev/sdb1 /mnt
[root@linux1 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 892464 0 892464 0% /dev
tmpfs 921916 0 921916 0% /dev/shm
tmpfs 921916 9920 911996 2% /run
tmpfs 921916 0 921916 0% /sys/fs/cgroup
/dev/mapper/cl-root 17811456 4657868 13153588 27% /
/dev/sda1 999320 197196 733312 22% /boot
tmpfs 184380 1180 183200 1% /run/user/42
tmpfs 184380 4648 179732 3% /run/user/0
/dev/sr0 8037456 8037456 0 100% /run/media/root/CentOS-8-2-2004-x86_64-dvd
/dev/sdb1 10475520 106088 10369432 2% /mnt
[root@linux1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 872M 0 872M 0% /dev
tmpfs 901M 0 901M 0% /dev/shm
tmpfs 901M 9.7M 891M 2% /run
tmpfs 901M 0 901M 0% /sys/fs/cgroup
/dev/mapper/cl-root 17G 4.5G 13G 27% /
/dev/sda1 976M 193M 717M 22% /boot
tmpfs 181M 1.2M 179M 1% /run/user/42
tmpfs 181M 4.6M 176M 3% /run/user/0
/dev/sr0 7.7G 7.7G 0 100% /run/media/root/CentOS-8-2-2004-x86_64-dvd
/dev/sdb1 10G 104M 9.9G 2% /mnt
[root@linux1 ~]# df -h /mnt
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 10G 104M 9.9G 2% /mnt
[root@linux1 ~]# df -h /dev/sdb1
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 10G 104M 9.9G 2% /mnt
[root@linux1 ~]#
[root@linux1 ~]# df -h /mnt
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/cl-root 17G 4.5G 13G 27% /
[root@linux1 ~]# cd /mnt
[root@linux1 mnt]# pwd
/mnt
[root@linux1 mnt]# ls
hgfs
[root@linux1 mnt]# cd
[root@linux1 ~]# mount /dev/sdb1 /mnt
mount: /mnt: /dev/sdb1 already mounted on /mnt.
[root@linux1 ~]# ll /mnt
합계 0
drwxr-xr-x. 2 root root 6 9월 19 15:05 data2020
[root@linux1 ~]# df -h /mnt
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 10G 104M 9.9G 2% /mnt
[root@linux1 ~]#
[root@linux1 ~]# umount -v /mnt
umount: /mnt unmounted
[root@linux1 ~]# df -h /mnt
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/cl-root 17G 4.5G 13G 27% /
[root@linux1 ~]# lsblk /dev/sdb1
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb1 8:17 0 10G 0 part
[root@linux1 ~]#
[root@linux1 ~]# mkdir -pv /mnt/hdd1
mkdir: created directory '/mnt/hdd1'
[root@linux1 ~]# vim /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sat Aug 22 14:58:37 2020
#
# 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.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/mapper/cl-root / xfs defaults 0 0
UUID=dce9f36a-ed85-4eab-9b4e-4a04dcd04692 /boot ext4 defaults 1 2
/dev/mapper/cl-swap swap swap defaults 0 0
/dev/sdb1 /mnt/hdd1 xfs defaults 0 0
[root@linux1 ~]#
[root@linux1 ~]# mount -a
[root@linux1 ~]# lsblk /dev/sdb1
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb1 8:17 0 10G 0 part /mnt/hdd1
[root@linux1 ~]#
[root@linux1 ~]# fdisk /dev/sdc
Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x129d5524.
Command (m for help): p
Disk /dev/sdc: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x129d5524
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (1-4, default 1):
First sector (2048-41943039, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039):
Created a new partition 1 of type 'Linux' and of size 20 GiB.
Command (m for help): p
Disk /dev/sdc: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x129d5524
Device Boot Start End Sectors Size Id Type
/dev/sdc1 2048 41943039 41940992 20G 83 Linux
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[root@linux1 ~]# mkdir /mnt/hdd2
[root@linux1 ~]# mount /dev/sdc1 /mnt/hdd2
mount: /mnt/hdd2: wrong fs type, bad option, bad superblock on /dev/sdc1, missing codepage or helper program, or other error.
[root@linux1 ~]#
[root@linux1 ~]# mkfs.xfs /dev/sdc1
meta-data=/dev/sdc1 isize=512 agcount=4, agsize=1310656 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=5242624, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@linux1 ~]# mount /dev/sdc1 /mnt/hdd2
[root@linux1 ~]# umount -v /dev/sdc1
umount: /mnt/hdd2 (/dev/sdc1) unmounted
[root@linux1 ~]# mount /dev/sdc1 /mnt/hdd3
mount: /mnt/hdd3: mount point does not exist.
[root@linux1 ~]#
[root@linux1 ~]# blkid
/dev/sda1: UUID="dce9f36a-ed85-4eab-9b4e-4a04dcd04692" TYPE="ext4" PARTUUID="0344937f-01"
/dev/sda2: UUID="X5WQ1u-b0GP-hA0r-UGwq-AO6E-wFd2-0Uk6kr" TYPE="LVM2_member" PARTUUID="0344937f-02"
/dev/sdb1: UUID="5356c54b-8f35-4f42-a3e8-cc6deb7d9588" TYPE="xfs" PARTUUID="bd0cdd77-01"
/dev/sdc1: UUID="cdf3dc51-d1d3-45e8-9f14-379167fb5f99" TYPE="xfs" PARTUUID="129d5524-01"
/dev/sr0: UUID="2020-06-08-22-08-25-00" LABEL="CentOS-8-2-2004-x86_64-dvd" TYPE="iso9660" PTUUID="545ce9a4" PTTYPE="dos"
/dev/mapper/cl-root: UUID="d3824d05-88ac-407f-8e37-c9783f3d3e0f" TYPE="xfs"
/dev/mapper/cl-swap: UUID="03ada4f7-c5c3-41d7-94b3-1bdad0495b15" TYPE="swap"
[root@linux1 ~]# blkid /dev/sdc1
/dev/sdc1: UUID="cdf3dc51-d1d3-45e8-9f14-379167fb5f99" TYPE="xfs" PARTUUID="129d5524-01"
[root@linux1 ~]#
[root@linux1 ~]# lsblk -f /dev/sdc1
NAME FSTYPE LABEL UUID MOUNTPOINT
sdc1 xfs cdf3dc51-d1d3-45e8-9f14-379167fb5f99
[root@linux1 ~]# vim /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sat Aug 22 14:58:37 2020
#
# 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.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/mapper/cl-root / xfs defaults 0 0
UUID=dce9f36a-ed85-4eab-9b4e-4a04dcd04692 /boot ext4 defaults 1 2
/dev/mapper/cl-swap swap swap defaults 0 0
# /dev/sdb1 /mnt/hdd1 xfs defaults 0 0
UUID=cdf3dc51-d1d3-45e8-9f14-379167fb5f99 /mnt/hdd2 xfs defaults 0 0
[root@linux1 ~]# mount -a
[root@linux1 ~]# df -hT /mnt/hdd2
Filesystem Type Size Used Avail Use% Mounted on
/dev/sdc1 xfs 20G 175M 20G 1% /mnt/hdd2
[root@linux1 ~]# cd /mnt/hdd2
[root@linux1 hdd2]# ll
합계 0
[root@linux1 hdd2]#
[root@linux1 hdd2]# umount /mnt/hdd2
umount: /mnt/hdd2: target is busy.
[root@linux1 hdd2]# cd
[root@linux1 ~]# umount /mnt/hdd2
[root@linux1 ~]# cp /etc/fstab /etc/fstab.old
[root@linux1 ~]# blkid /dev/sdc1 >> /etc/fstab
[root@linux1 ~]# vim /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sat Aug 22 14:58:37 2020
#
# 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.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/mapper/cl-root / xfs defaults 0 0
UUID=dce9f36a-ed85-4eab-9b4e-4a04dcd04692 /boot ext4 defaults 1 2
/dev/mapper/cl-swap swap swap defaults 0 0
# /dev/sdb1 /mnt/hdd1 xfs defaults 0 0
UUID=cdf3dc51-d1d3-45e8-9f14-379167fb5f99 /mnt/hdd2 xfs defaults 0 0
/dev/sdc1: UUID="cdf3dc51-d1d3-45e8-9f14-379167fb5f99" TYPE="xfs" PARTUUID="129d5524-01"
[root@linux1 ~]# lsblk -f /dev/sdb
NAME FSTYPE LABEL UUID MOUNTPOINT
sdb
└─sdb1 xfs 5356c54b-8f35-4f42-a3e8-cc6deb7d9588 /mnt/hdd1
[root@linux1 ~]# lsblk -f /dev/sdc
NAME FSTYPE LABEL UUID MOUNTPOINT
sdc
└─sdc1 xfs cdf3dc51-d1d3-45e8-9f14-379167fb5f99
[root@linux1 ~]# umount -v /dev/sdb1
umount: /mnt/hdd1 (/dev/sdb1) unmounted
[root@linux1 ~]#
[root@linux1 ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (1-4, default 1):
First sector (2048-41943039, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039): +10G
Created a new partition 1 of type 'Linux' and of size 10 GiB.
Partition #1 contains a xfs signature.
Do you want to remove the signature? [Y]es/[N]o: y
The signature will be removed by a write command.
Command (m for help): p
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbd0cdd77
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 20973567 20971520 10G 83 Linux
Filesystem/RAID signature on partition 1 will be wiped.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[root@linux1 ~]# mkfs.xfs /dev/sdb1
meta-data=/dev/sdb1 isize=512 agcount=4, agsize=655360 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=2621440, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@linux1 ~]# mkdir -pv /abc/m1
mkdir: created directory '/abc'
mkdir: created directory '/abc/m1'
[root@linux1 ~]# mount /dev/sdb1 /abc/m1
[root@linux1 ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbd0cdd77
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 20973567 20971520 10G 83 Linux
Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (2-4, default 2):
First sector (20973568-41943039, default 20973568):
Last sector, +sectors or +size{K,M,G,T,P} (20973568-41943039, default 41943039):
Created a new partition 2 of type 'Linux' and of size 10 GiB.
Command (m for help): p
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xbd0cdd77
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 20973567 20971520 10G 83 Linux
/dev/sdb2 20973568 41943039 20969472 10G 83 Linux
Command (m for help): w
The partition table has been altered.
Syncing disks.
[root@linux1 ~]# partprobe /dev/sdb
[root@linux1 ~]# mkfs.xfs /dev/sdb2
meta-data=/dev/sdb2 isize=512 agcount=4, agsize=655296 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=2621184, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@linux1 ~]#
시나리오>
디스크 30기가를 2개 사용하고 싶으나 시장에는 20기가뿐이 없다.
1. 디스크 20 기가 3개를 type 8e 로 변경(LVM)
[root@linux1 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 19G 0 part
├─cl-root 253:0 0 17G 0 lvm /
└─cl-swap 253:1 0 2G 0 lvm [SWAP]
sdb 8:16 0 20G 0 disk
├─sdb1 8:17 0 10G 0 part
└─sdb2 8:18 0 10G 0 part
sdc 8:32 0 20G 0 disk
sdd 8:48 0 20G 0 disk
sde 8:64 0 20G 0 disk
sdf 8:80 0 20G 0 disk
sr0 11:0 1 7.7G 0 rom /run/media/root/CentOS-8-2-2004-x86_64-dvd
[root@linux1 ~]# fdisk /dev/sdd
Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x0fcd937f.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (1-4, default 1):
First sector (2048-41943039, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039):
Created a new partition 1 of type 'Linux' and of size 20 GiB.
Command (m for help): p
Disk /dev/sdd: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0fcd937f
Device Boot Start End Sectors Size Id Type
/dev/sdd1 2048 41943039 41940992 20G 83 Linux
Command (m for help): l
0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris
1 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT-
2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-
3 XENIX usr 3c PartitionMagic 84 OS/2 hidden or c6 DRDOS/sec (FAT-
4 FAT16 <32M 40 Venix 80286 85 Linux extended c7 Syrinx
5 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data
6 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / .
7 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility
8 AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt
9 AIX bootable 4f QNX4.x 3rd part 93 Amoeba e1 DOS access
a OS/2 Boot Manag 50 OnTrack DM 94 Amoeba BBT e3 DOS R/O
b W95 FAT32 51 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor
c W95 FAT32 (LBA) 52 CP/M a0 IBM Thinkpad hi ea Rufus alignment
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD eb BeOS fs
f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ee GPT
10 OPUS 55 EZ-Drive a7 NeXTSTEP ef EFI (FAT-12/16/
11 Hidden FAT12 56 Golden Bow a8 Darwin UFS f0 Linux/PA-RISC b
12 Compaq diagnost 5c Priam Edisk a9 NetBSD f1 SpeedStor
14 Hidden FAT16 <3 61 SpeedStor ab Darwin boot f4 SpeedStor
16 Hidden FAT16 63 GNU HURD or Sys af HFS / HFS+ f2 DOS secondary
17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fb VMware VMFS
18 AST SmartSleep 65 Novell Netware b8 BSDI swap fc VMware VMKCORE
1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fd Linux raid auto
1c Hidden W95 FAT3 75 PC/IX bc Acronis FAT32 L fe LANstep
1e Hidden W95 FAT1 80 Old Minix be Solaris boot ff BBT
Command (m for help): m
Help:
DOS (MBR)
a toggle a bootable flag
b edit nested BSD disklabel
c toggle the dos compatibility flag
Generic
d delete a partition
F list free unpartitioned space
l list known partition types
n add a new partition
p print the partition table
t change a partition type
v verify the partition table
i print information about a partition
Misc
m print this menu
u change display/entry units
x extra functionality (experts only)
Script
I load disk layout from sfdisk script file
O dump disk layout to sfdisk script file
Save & Exit
w write table to disk and exit
q quit without saving changes
Create a new label
g create a new empty GPT partition table
G create a new empty SGI (IRIX) partition table
o create a new empty DOS partition table
s create a new empty Sun partition table
Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'.
Command (m for help): p
Disk /dev/sdd: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0fcd937f
Device Boot Start End Sectors Size Id Type
/dev/sdd1 2048 41943039 41940992 20G 8e Linux LVM
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[root@linux1 ~]# fdisk /dev/sde
Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x34d33ef5.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (1-4, default 1):
First sector (2048-41943039, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039):
Created a new partition 1 of type 'Linux' and of size 20 GiB.
Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'.
Command (m for help): p
Disk /dev/sde: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x34d33ef5
Device Boot Start End Sectors Size Id Type
/dev/sde1 2048 41943039 41940992 20G 8e Linux LVM
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[root@linux1 ~]# fdisk /dev/sdf
Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x8d7417a1.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (1-4, default 1):
First sector (2048-41943039, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039):
Created a new partition 1 of type 'Linux' and of size 20 GiB.
Command (m for help):
Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'.
Command (m for help): p
Disk /dev/sdf: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8d7417a1
Device Boot Start End Sectors Size Id Type
/dev/sdf1 2048 41943039 41940992 20G 8e Linux LVM
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[root@linux1 ~]#
2. pvcreate 생성
[root@linux1 ~]# pvcreate /dev/{sdd1,sde1,sdf1}
Physical volume "/dev/sdd1" successfully created.
Physical volume "/dev/sde1" successfully created.
Physical volume "/dev/sdf1" successfully created.
[root@linux1 ~]#
3. vg1 vgcreate 생성
[root@linux1 ~]# vgcreate vg1 /dev/{sdd1,sde1,sdf1}
Volume group "vg1" successfully created
[root@linux1 ~]#
4. vgdisplay로 확인
[root@linux1 ~]# vgdisplay /dev/vg1
--- Volume group ---
VG Name vg1
System ID
Format lvm2
Metadata Areas 3
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 3
Act PV 3
VG Size <59.99 GiB
PE Size 4.00 MiB
Total PE 15357
Alloc PE / Size 0 / 0
Free PE / Size 15357 / <59.99 GiB
VG UUID lBcfvh-YI31-kQkC-GLyh-uOW6-mZMn-11Zvq3
[root@linux1 ~]#
5. vg1 용량 나누기
[root@linux1 ~]# lvcreate -n lvm1 -l 50%FREE /dev/vg1
Logical volume "lvm1" created.
[root@linux1 ~]# lvcreate -n lvm2 -l 100%FREE /dev/vg1
Logical volume "lvm2" created.
[root@linux1 ~]#
6. 확인작업
[root@linux1 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 19G 0 part
├─cl-root 253:0 0 17G 0 lvm /
└─cl-swap 253:1 0 2G 0 lvm [SWAP]
sdb 8:16 0 20G 0 disk
├─sdb1 8:17 0 10G 0 part
└─sdb2 8:18 0 10G 0 part
sdc 8:32 0 20G 0 disk
sdd 8:48 0 20G 0 disk
└─sdd1 8:49 0 20G 0 part
└─vg1-lvm1 253:2 0 30G 0 lvm
sde 8:64 0 20G 0 disk
└─sde1 8:65 0 20G 0 part
├─vg1-lvm1 253:2 0 30G 0 lvm
└─vg1-lvm2 253:3 0 30G 0 lvm
sdf 8:80 0 20G 0 disk
└─sdf1 8:81 0 20G 0 part
└─vg1-lvm2 253:3 0 30G 0 lvm
sr0 11:0 1 7.7G 0 rom /run/media/root/CentOS-8-2-2004-x86_64-dvd
[root@linux1 ~]# vgdisplay /dev/vg1
--- Volume group ---
VG Name vg1
System ID
Format lvm2
Metadata Areas 3
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 0
Max PV 0
Cur PV 3
Act PV 3
VG Size <59.99 GiB
PE Size 4.00 MiB
Total PE 15357
Alloc PE / Size 15357 / <59.99 GiB
Free PE / Size 0 / 0
VG UUID lBcfvh-YI31-kQkC-GLyh-uOW6-mZMn-11Zvq3
[root@linux1 ~]# lvdisplay /dev/vg1
--- Logical volume ---
LV Path /dev/vg1/lvml
LV Name lvml
VG Name vg1
LV UUID KDsCFO-EyFc-ntiy-fxQs-DT41-7rRk-pGYvj0
LV Write Access read/write
LV Creation host, time linux1.example.com, 2020-09-19 17:26:42 +0900
LV Status available
# open 0
LV Size 29.99 GiB
Current LE 7678
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:2
--- Logical volume ---
LV Path /dev/vg1/lvm2
LV Name lvm2
VG Name vg1
LV UUID RhZEet-lUGB-EWwA-ILuY-G1nW-JZYA-szDOLQ
LV Write Access read/write
LV Creation host, time linux1.example.com, 2020-09-19 17:27:40 +0900
LV Status available
# open 0
LV Size <30.00 GiB
Current LE 7679
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:3
[root@linux1 ~]# lvdisplay
--- Logical volume ---
LV Path /dev/vg1/lvml
LV Name lvml
VG Name vg1
LV UUID KDsCFO-EyFc-ntiy-fxQs-DT41-7rRk-pGYvj0
LV Write Access read/write
LV Creation host, time linux1.example.com, 2020-09-19 17:26:42 +0900
LV Status available
# open 0
LV Size 29.99 GiB
Current LE 7678
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:2
--- Logical volume ---
LV Path /dev/vg1/lvm2
LV Name lvm2
VG Name vg1
LV UUID RhZEet-lUGB-EWwA-ILuY-G1nW-JZYA-szDOLQ
LV Write Access read/write
LV Creation host, time linux1.example.com, 2020-09-19 17:27:40 +0900
LV Status available
# open 0
LV Size <30.00 GiB
Current LE 7679
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:3
--- Logical volume ---
LV Path /dev/cl/swap
LV Name swap
VG Name cl
LV UUID bCCyhg-kZpI-urmF-CZ2g-gSB0-3Jr0-gOdR0W
LV Write Access read/write
LV Creation host, time localhost, 2020-08-22 14:58:34 +0900
LV Status available
# open 2
LV Size 2.00 GiB
Current LE 512
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1
--- Logical volume ---
LV Path /dev/cl/root
LV Name root
VG Name cl
LV UUID XYcTGn-mCpQ-ekzM-EBBm-nXCW-HciB-o5WjIS
LV Write Access read/write
LV Creation host, time localhost, 2020-08-22 14:58:34 +0900
LV Status available
# open 1
LV Size <17.00 GiB
Current LE 4351
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0
[root@linux1 ~]#
7. 디스크 포맷작업
[root@linux1 ~]# mkfs.xfs /dev/vg1/lvm1
meta-data=/dev/vg1/lvm1 isize=512 agcount=4, agsize=1965568 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=7862272, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=3839, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@linux1 ~]# mkfs.xfs /dev/vg1/lvm2
meta-data=/dev/vg1/lvm2 isize=512 agcount=4, agsize=1965824 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=7863296, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=3839, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@linux1 ~]#
8. 마운트 작업
[root@linux1 ~]# mkdir -pv /mnt/{lv1,lv2}
mkdir: created directory '/mnt/lv1'
mkdir: created directory '/mnt/lv2'
[root@linux1 ~]# blkid /dev/vg1/lvm1 >> /etc/fstab
[root@linux1 ~]# blkid /dev/vg1/lvm2 >> /etc/fstab
[root@linux1 ~]# vim /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sat Aug 22 14:58:37 2020
#
# 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.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/mapper/cl-root / xfs defaults 0 0
UUID=dce9f36a-ed85-4eab-9b4e-4a04dcd04692 /boot ext4 defaults 1 2
/dev/mapper/cl-swap swap swap defaults 0 0
UUID="e1528ed1-07dc-40c2-b6ab-46441e948454" /mnt/lv1 xfs defaults 0 0
UUID="8cc13045-f13f-4fa8-bf0d-9693a5367cb0" /mnt/lv2 xfs defaults 0 0
[root@linux1 ~]# mount -a
[root@linux1 ~]# reboot
[root@linux1 ~]#
9. 하드 추가 후 용량 증가(lvm1에 10기가 / lvm2에 10기가 추가하기)
[root@linux1 ~]# fdisk /dev/sdg
Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x9162bcf9.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (1-4, default 1):
First sector (2048-41943039, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039):
Created a new partition 1 of type 'Linux' and of size 20 GiB.
Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[root@linux1 ~]# pvc
pvchange pvck pvcreate
[root@linux1 ~]# pvcreate /dev/sdg1
Physical volume "/dev/sdg1" successfully created.
[root@linux1 ~]# vgextend vg1 /dev/sdg1
Volume group "vg1" successfully extended
[root@linux1 ~]# vgdisplay
--- Volume group ---
VG Name vg1
System ID
Format lvm2
Metadata Areas 4
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 4
Act PV 4
VG Size 79.98 GiB
PE Size 4.00 MiB
Total PE 20476
Alloc PE / Size 15357 / <59.99 GiB
Free PE / Size 5119 / <20.00 GiB
VG UUID lBcfvh-YI31-kQkC-GLyh-uOW6-mZMn-11Zvq3
--- Volume group ---
VG Name cl
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size <19.00 GiB
PE Size 4.00 MiB
Total PE 4863
Alloc PE / Size 4863 / <19.00 GiB
Free PE / Size 0 / 0
VG UUID uIHWK2-wfzD-6BdQ-uU58-a2r8-Aqpd-789j0s
[root@linux1 ~]# lvextend -L +10G /dev/vg1/lvm1
Size of logical volume vg1/lvm1 changed from 29.99 GiB (7678 extents) to 39.99 GiB (10238 extents).
Logical volume vg1/lvm1 successfully resized.
[root@linux1 ~]# lvextend -l +100%FREE /dev/vg1/lvm2
Size of logical volume vg1/lvm2 changed from <30.00 GiB (7679 extents) to 39.99 GiB (10238 extents).
Logical volume vg1/lvm2 successfully resized.
[root@linux1 ~]#
10. 확인작업
[root@linux1 ~]# lsblk /dev/vg1/lvm1
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vg1-lvm1 253:2 0 40G 0 lvm /mnt/lv1
[root@linux1 ~]# lsblk /dev/vg1/lvm2
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vg1-lvm2 253:3 0 40G 0 lvm /mnt/lv2
[root@linux1 ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 872M 0 872M 0% /dev
tmpfs tmpfs 901M 0 901M 0% /dev/shm
tmpfs tmpfs 901M 9.8M 891M 2% /run
tmpfs tmpfs 901M 0 901M 0% /sys/fs/cgroup
/dev/mapper/cl-root xfs 17G 4.5G 13G 27% /
/dev/mapper/vg1-lvm1 xfs 30G 247M 30G 1% /mnt/lv1
/dev/mapper/vg1-lvm2 xfs 30G 247M 30G 1% /mnt/lv2
/dev/sda1 ext4 976M 193M 717M 22% /boot
tmpfs tmpfs 181M 1.2M 179M 1% /run/user/42
tmpfs tmpfs 181M 4.6M 176M 3% /run/user/0
/dev/sr0 iso9660 7.7G 7.7G 0 100% /run/media/root/CentOS-8-2-2004-x86_64-dvd
[root@linux1 ~]# df -hT /mnt/lv1
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/vg1-lvml xfs 30G 247M 30G 1% /mnt/lv1
[root@linux1 ~]#
11. 리플래시작업
[root@linux1 ~]# xfs_growfs /dev/vg1/lvm1
meta-data=/dev/mapper/vg1-lvm1 isize=512 agcount=4, agsize=1965568 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=7862272, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=3839, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 7862272 to 10483712
[root@linux1 ~]# xfs_growfs /dev/vg1/lvm2
meta-data=/dev/mapper/vg1-lvm2 isize=512 agcount=4, agsize=1965824 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=7863296, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=3839, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 7863296 to 10483712
[root@linux1 ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 872M 0 872M 0% /dev
tmpfs tmpfs 901M 0 901M 0% /dev/shm
tmpfs tmpfs 901M 9.8M 891M 2% /run
tmpfs tmpfs 901M 0 901M 0% /sys/fs/cgroup
/dev/mapper/cl-root xfs 17G 4.5G 13G 27% /
/dev/mapper/vg1-lvm1 xfs 40G 318M 40G 1% /mnt/lv1
/dev/mapper/vg1-lvm2 xfs 40G 318M 40G 1% /mnt/lv2
/dev/sda1 ext4 976M 193M 717M 22% /boot
tmpfs tmpfs 181M 1.2M 179M 1% /run/user/42
tmpfs tmpfs 181M 4.6M 176M 3% /run/user/0
/dev/sr0 iso9660 7.7G 7.7G 0 100% /run/media/root/CentOS-8-2-2004-x86_64-dvd
[root@linux1 ~]#
'CentOS > Study' 카테고리의 다른 글
[Linux]Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist (0) | 2022.02.05 |
---|---|
[리눅스]01. 23 교육 정리 (0) | 2022.01.23 |
[리눅스]01. 15 교육 정리 (0) | 2022.01.16 |
[리눅스]01. 08 교육 정리 (0) | 2022.01.08 |
[리눅스]12.18 교육 정리 2 (0) | 2021.12.19 |