root でログイン
# userdel -r xxxxx /home以下のユーザを削除
# ls -l /home
total 0 確認
# umount /home
# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
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
Building a new DOS disklabel with disk identifier 0xab90547f.
The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.
コマンド (m でヘルプ): m
コマンドの動作
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
コマンド (m でヘルプ): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
パーティション番号 (1-4, default 1):
最初 sector (2048-976773167, 初期値 2048):
初期値 2048 を使います
Last sector, +sectors or +size{K,M,G} (2048-976773167, 初期値 976773167):
初期値 976773167 を使います
Partition 1 of type Linux and of size 465.8 GiB is set
コマンド (m でヘルプ): t
Selected partition 1
Hex code (type L to list all codes): L
0 空 24 NEC DOS 81 Minix / 古い Li bf Solaris
1 FAT12 27 Hidden NTFS Win 82 Linux スワップ c1 DRDOS/sec (FAT-
2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-
3 XENIX usr 3c PartitionMagic 84 OS/2 隠し C: ド c6 DRDOS/sec (FAT-
4 FAT16 <32M 40 Venix 80286 85 Linux 拡張領域 c7 Syrinx
5 拡張領域 41 PPC PReP Boot 86 NTFS ボリューム da 非 FS データ
6 FAT16 42 SFS 87 NTFS ボリューム db CP/M / CTOS / .
7 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux プレーン de Dell ユーティリ
8 AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt
9 AIX ブート可能 4f QNX4.x 3rd part 93 Amoeba e1 DOS access
a OS/2 ブートマネ 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 ハ eb BeOS fs
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD ee GPT
f W95 拡張領域 (L 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/
10 OPUS 55 EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC
11 隠し FAT12 56 Golden Bow a8 Darwin UFS f1 SpeedStor
12 Compaq 診断 5c Priam Edisk a9 NetBSD f4 SpeedStor
14 隠し FAT16 <32M 61 SpeedStor ab Darwin ブート f2 DOS セカンダリ
16 隠し FAT16 63 GNU HURD または af HFS / HFS+ fb VMware VMFS
17 隠し HPFS/NTFS 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
18 AST SmartSleep 65 Novell Netware b8 BSDI スワップ fd Linux raid 自動
1b 隠し W95 FAT32 70 DiskSecure Mult bb 隠し Boot Wizar fe LANstep
1c 隠し W95 FAT32 75 PC/IX be Solaris ブート ff BBT
1e 隠し W95 FAT16 80 古い Minix
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'
コマンド (m でヘルプ): w
パーティションテーブルは変更されました!
ioctl() を呼び出してパーティションテーブルを再読込みします。
ディスクを同期しています。
# fdisk -l /dev/sdb
Disk /dev/sdb: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O サイズ (最小 / 推奨): 4096 バイト / 4096 バイト
Disk label type: dos
ディスク識別子: 0xab90547f
デバイス ブート 始点 終点 ブロック Id システム
/dev/sdb1 2048 976773167 488385560 8e Linux LVM
# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created.
# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name centos
PV Size <222.57 GiB / not usable 3.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 56977
Free PE 1
Allocated PE 56976
PV UUID IbFRgF-14az-CyYG-Vq0o-JRll-rEPl-TwfdZA
"/dev/sdb1" is a new physical volume of "465.76 GiB"
--- NEW Physical volume ---
PV Name /dev/sdb1
VG Name
PV Size 465.76 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID wSOMkJ-a57d-M5Ko-F5PG-TktP-Gm6g-KkozMu
# vgcreate lvguserdata /dev/sdb1
/dev/sdc: open failed: メディアが見つかりません
/dev/sdd: open failed: メディアが見つかりません
/dev/sde: open failed: メディアが見つかりません
/dev/sdf: open failed: メディアが見つかりません
Volume group "lvguserdata" successfully created
# vgdisplay
--- Volume group ---
VG Name lvguserdata
System ID
Format lvm2
Metadata Areas 1
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 1
Act PV 1
VG Size <465.76 GiB
PE Size 4.00 MiB
Total PE 119234
Alloc PE / Size 0 / 0
Free PE / Size 119234 / <465.76 GiB
VG UUID 8CFNUB-wlEk-JOA2-LtDn-YzBN-dL0U-mDiQKM
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 1
Act PV 1
VG Size <222.57 GiB
PE Size 4.00 MiB
Total PE 56977
Alloc PE / Size 56976 / 222.56 GiB
Free PE / Size 1 / 4.00 MiB
VG UUID ZUzbN5-dx4i-qR5d-wNxD-ejeB-9syW-aRtbgC
# vgscan
Reading volume groups from cache.
Found volume group "lvguserdata" using metadata type lvm2
Found volume group "centos" using metadata type lvm2
[root@localhost dev]# lvcreate --name home -l 100%FREE lvguserdata
Logical volume "home" created.
[root@localhost dev]# lvdisplay lvguserdata
--- Logical volume ---
LV Path /dev/lvguserdata/home
LV Name home
VG Name lvguserdata
LV UUID oatwnX-vjXB-hgXp-DNfo-zc1W-wUJO-rBJwGH
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2019-08-15 19:58:48 +0900
LV Status available
# open 0
LV Size <465.76 GiB
Current LE 119234
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:3
# mkfs.xfs /dev/lvguserdata/home
meta-data=/dev/lvguserdata/home isize=512 agcount=4, agsize=30523904 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=122095616, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=59617, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
# vi /etc/fstab
/dev/mapper/lvguserdata-home /home xfs defaults 0 0
# ls -l /dev/centos
合計 0
lrwxrwxrwx. 1 root root 7 8月 15 19:21 home -> ../dm-2
lrwxrwxrwx. 1 root root 7 8月 15 19:21 root -> ../dm-0
lrwxrwxrwx. 1 root root 7 8月 15 19:21 swap -> ../dm-1
# lvremove /dev/centos/home
# lvdisplay centos
# lvextend -l +100%FREE /dev/centos/root
# df
# xfs_growfs /dev/centos/root
# df
2019年8月15日木曜日
登録:
コメントの投稿 (Atom)
zabbix7 amazon linux2023 インストール postgres15
【postgres】 dnf -y install postgresql15-server postgresql15-server-devel postgresql-setup initdb passwd postgres vi `find / -name pg_hba.con...
-
# mount /dev/nvme0n1p3 /mnt/m2 mount: /mnt/m2: 未知のファイルシステムタイプ 'LVM2_member' です. # fdisk -l /dev/nvme0n1 ディスク /dev/nvme0n1: 953....
-
【snmp/snmptrap】 # yum -y install net-snmp # yum -y install net-snmp-utils # yum -y install snmptt # yum install perl-Sys-Syslog # fi...
-
※Status code: 404 for https://dlm.mariadb.com/repo/mariadb-server/10.7.... → Ver.10 サポート切れ!! # dnf remove MareaDB-client # curl -sS https:...
0 件のコメント:
コメントを投稿