Linux扩展磁盘空间
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 28 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@postgresql ~]# mkfs -t ext4 /dev/sdb2
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1313760 inodes, 5245222 blocks
262261 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
161 block groups
32768 blocks per group, 32768 fragments per group
8160 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 39 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@postgresql ~]# mkfs -t ext4 /dev/sdb3
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1313760 inodes, 5245222 blocks
262261 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
161 block groups
32768 blocks per group, 32768 fragments per group
8160 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@postgresql ~]# mkfs -t ext4 /dev/sdb4
mke2fs 1.41.12 (17-May-2010)
mkfs.ext4: inode_size (128) * inodes_count (0) too big for a
filesystem with 0 blocks, specify higher inode_ratio (-i)
or lower inode count (-N).
[root@postgresql ~]# mkfs -t ext4 /dev/sdb5
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1313760 inodes, 5245214 blocks
262260 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
161 block groups
32768 blocks per group, 32768 fragments per group
8160 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 35 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@postgresql ~]# mkfs -t ext4 /dev/sdb6
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1310720 inodes, 5233165 blocks
261658 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
160 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 35 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@postgresql ~]# mkfs -t ext4 /dev/sdb7
mke2fs 1.41.12 (17-May-2010)
Could not stat /dev/sdb7 --- No such file or directory
The device apparently does not exist; did you specify it correctly?
[root@postgresql ~]#
[root@postgresql ~]#
[root@postgresql ~]#
[root@postgresql ~]#
[root@postgresql ~]# blkid /dev/sdb1
/dev/sdb1: UUID="3f091041-92ce-413d-9ef2-2d4364d9b967" TYPE="ext4"
[root@postgresql ~]# blkid /dev/sdb2
/dev/sdb2: UUID="46f8650e-15b2-4fa9-afa9-5139f6520a13" TYPE="ext4"
[root@postgresql ~]# blkid /dev/sdb3
/dev/sdb3: UUID="4d83dbda-b050-467c-8e39-e37198db9dde" TYPE="ext4"
[root@postgresql ~]# blkid /dev/sdb4
[root@postgresql ~]# blkid /dev/sdb5
/dev/sdb5: UUID="e693a72b-9248-4837-ba90-ddc206a4d6fe" TYPE="ext4"
[root@postgresql ~]# blkid /dev/sdb6
/dev/sdb6: UUID="85517940-6832-40a5-9b59-b6238cf1ea25" TYPE="ext4"
[root@postgresql ~]# blkid /dev/sdb7
[root@postgresql ~]# vim /etc/fstab
/etc/fstab
Created by anaconda on Sat Oct 24 18:13:22 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
/dev/mapper/vg_postgresql-lv_root / ext4 defaults 1 1
UUID=8e8ea395-a163-4165-9269-d6070e2dde69 /boot ext4 defaults 1 2
/dev/mapper/vg_postgresql-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
UUID=3f091041-92ce-413d-9ef2-2d4364d9b967/postgresql ext4 defaults 0 2
UUID=46f8650e-15b2-4fa9-afa9-5139f6520a13/postgresql ext4 defaults 0 2
UUID=4d83dbda-b050-467c-8e39-e37198db9dde/postgresql ext4 defaults 0 2
UUID=e693a72b-9248-4837-ba90-ddc206a4d6fe/postgresql ext4 defaults 0 2
UUID=85517940-6832-40a5-9b59-b6238cf1ea25/postgresql ext4 defaults 0 2
~
~
~
~
~
~
~
"/etc/fstab" 24L, 1153C written
[root@postgresql ~]# mount -a
mount: mount point ext4 does not exist
mount: mount point ext4 does not exist
mount: mount point ext4 does not exist
mount: mount point ext4 does not exist
mount: mount point ext4 does not exist
[root@postgresql ~]# vim /etc/fstab
/etc/fstab
Created by anaconda on Sat Oct 24 18:13:22 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
/dev/mapper/vg_postgresql-lv_root / ext4 defaults 1 1
UUID=8e8ea395-a163-4165-9269-d6070e2dde69 /boot ext4 defaults 1 2
/dev/mapper/vg_postgresql-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
UUID=3f091041-92ce-413d-9ef2-2d4364d9b967 /postgresql ext4 defaults 0 2
UUID=46f8650e-15b2-4fa9-afa9-5139f6520a13 /postgresql ext4 defaults 0 2
UUID=4d83dbda-b050-467c-8e39-e37198db9dde /postgresql ext4 defaults 0 2
UUID=e693a72b-9248-4837-ba90-ddc206a4d6fe /postgresql ext4 defaults 0 2
UUID=85517940-6832-40a5-9b59-b6238cf1ea25 /postgresql ext4 defaults 0 2
~
~
~
~
~
~
~
"/etc/fstab" 24L, 1326C written
[root@postgresql ~]# mount -a
[root@postgresql ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_postgresql-lv_root
35G 13G 21G 38% /
tmpfs 932M 76K 932M 1% /dev/shm
/dev/sda1 477M 34M 418M 8% /boot
/dev/sdb1 20G 44M 19G 1% /postgresql
/dev/sdb2 20G 44M 19G 1% /postgresql
/dev/sdb3 20G 44M 19G 1% /postgresql
/dev/sdb5 20G 44M 19G 1% /postgresql
/dev/sdb6 20G 44M 19G 1% /postgresql
[root@postgresql ~]# umount /postgresql
[root@postgresql ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_postgresql-lv_root
35G 13G 21G 38% /
tmpfs 932M 76K 932M 1% /dev/shm
/dev/sda1 477M 34M 418M 8% /boot
/dev/sdb1 20G 44M 19G 1% /postgresql
/dev/sdb2 20G 44M 19G 1% /postgresql
/dev/sdb3 20G 44M 19G 1% /postgresql
/dev/sdb5 20G 44M 19G 1% /postgresql
[root@postgresql ~]# um
umask umount.ecryptfs umount.hal umount.nfs4
umount umount.ecryptfs_private umount.nfs umount.udisks
[root@postgresql ~]# umount /postgresql/
[root@postgresql ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_postgresql-lv_root
35G 13G 21G 38% /
tmpfs 932M 76K 932M 1% /dev/shm
/dev/sda1 477M 34M 418M 8% /boot
/dev/sdb1 20G 44M 19G 1% /postgresql
/dev/sdb2 20G 44M 19G 1% /postgresql
/dev/sdb3 20G 44M 19G 1% /postgresql
[root@postgresql ~]# umount /postgresql/
[root@postgresql ~]# umount /postgresql/
[root@postgresql ~]# umount /postgresql/
[root@postgresql ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_postgresql-lv_root
35G 13G 21G 38% /
tmpfs 932M 76K 932M 1% /dev/shm
/dev/sda1 477M 34M 418M 8% /boot
[root@postgresql ~]#
[root@postgresql ~]#
[root@postgresql ~]# fdisk /dev/sdb
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): ^C
[root@postgresql ~]# fdisk -l /dev/sdb
Disk /dev/sdb: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7d387b2e
Device Boot Start End Blocks Id System
/dev/sdb1 1 2612 20980858+ 83 Linux
/dev/sdb2 2613 5224 20980890 83 Linux
/dev/sdb3 5225 7836 20980890 83 Linux
/dev/sdb4 7837 13054 41913585 5 Extended
/dev/sdb5 7837 10448 20980858+ 83 Linux
/dev/sdb6 10449 13054 20932663+ 83 Linux
[root@postgresql ~]# pvcreate /dev/sdb1 /dev/sdb2 /dev/sdb3 /dev/sdb5 /dev/sdb6
Physical volume "/dev/sdb1" successfully created
Physical volume "/dev/sdb2" successfully created
Physical volume "/dev/sdb3" successfully created
Physical volume "/dev/sdb5" successfully created
Physical volume "/dev/sdb6" successfully created
[root@postgresql ~]# vgcreate postgre /dev/sdb1 /dev/sdb2 /dev/sdb3 /dev/sdb5 /dev/sdb6
Volume group "postgre" successfully created
[root@postgresql ~]# lvcreate -n postgresql_lv 100G postgre
Please specify either size or extents
Run lvcreate --help' for more information. [root@postgresql ~]# lvcreate -n postgresql_lv 99.1G postgre Please specify either size or extents Run
lvcreate --help' for more information.
[root@postgresql ~]# lvcreate -n postgresql_lv 99G postgre
Please specify either size or extents
Run lvcreate --help' for more information. [root@postgresql ~]# lvcreate -n postgresql_lv 98G postgre Please specify either size or extents Run
lvcreate --help' for more information.
[root@postgresql ~]# lvcreate -n postgresql_lv 97G postgre
Please specify either size or extents
Run `lvcreate --help' for more information.
[root@postgresql ~]# lvcreate -n postgresql_lv -L 100G postgre
Volume group "postgre" has insufficient free space (25598 extents): 25600 required.
[root@postgresql ~]# lvcreate -n postgresql_lv -L 99.9G postgre
Rounding up size to full physical extent 99.90 GiB
Logical volume "postgresql_lv" created
[root@postgresql ~]# lvdisplay
--- Logical volume ---
LV Path /dev/postgre/postgresql_lv
LV Name postgresql_lv
VG Name postgre
LV UUID 6IdanN-1dPR-s20P-65dn-JeCY-T3Ec-IPY8NX
LV Write Access read/write
LV Creation host, time postgresql, 2020-10-24 23:43:14 +0800
LV Status available
open 0
LV Size 99.90 GiB
Current LE 25575
Segments 5
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
--- Logical volume ---
LV Path /dev/vg_postgresql/lv_root
LV Name lv_root
VG Name vg_postgresql
LV UUID 2Kb88y-dbLB-7hpf-imsW-sO4Z-HOGT-qV1Yqx
LV Write Access read/write
LV Creation host, time postgresql, 2020-10-24 18:06:49 +0800
LV Status available
open 1
LV Size 35.60 GiB
Current LE 9114
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Path /dev/vg_postgresql/lv_swap
LV Name lv_swap
VG Name vg_postgresql
LV UUID w4rJpn-rhjt-cOc2-iTd8-Inft-bqcT-BGqqWu
LV Write Access read/write
LV Creation host, time postgresql, 2020-10-24 18:06:53 +0800
LV Status available
open 1
LV Size 3.91 GiB
Current LE 1000
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
[root@postgresql ~]# vgdisplay
--- Volume group ---
VG Name postgre
System ID
Format lvm2
Metadata Areas 5
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 5
Act PV 5
VG Size 99.99 GiB
PE Size 4.00 MiB
Total PE 25598
Alloc PE / Size 25575 / 99.90 GiB
Free PE / Size 23 / 92.00 MiB
VG UUID gacwOu-8CsH-cnTg-68wq-5Goq-Yevj-vYKT3r
--- Volume group ---
VG Name vg_postgresql
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 39.51 GiB
PE Size 4.00 MiB
Total PE 10114
Alloc PE / Size 10114 / 39.51 GiB
Free PE / Size 0 / 0
VG UUID 6QOWDx-YVmi-2mYc-WP2e-m6m1-K7hT-2Tkvfd
[root@postgresql ~]# mkfs -t ext4 /dev/postgre/postgresql_lv
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
6553600 inodes, 26188800 blocks
1309440 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
800 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@postgresql ~]# vim /etc/fstab
/etc/fstab
Created by anaconda on Sat Oct 24 18:13:22 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
/dev/mapper/vg_postgresql-lv_root / ext4 defaults 1 1
UUID=8e8ea395-a163-4165-9269-d6070e2dde69 /boot ext4 defaults 1 2
/dev/mapper/vg_postgresql-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/postgre/postgresql_lv /postgresql ext4 defaults 0 0
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"/etc/fstab" 16L, 865C written
[root@postgresql ~]# mount -a
[root@postgresql ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_postgresql-lv_root
35G 13G 21G 38% /
tmpfs 932M 76K 932M 1% /dev/shm
/dev/sda1 477M 34M 418M 8% /boot
/dev/mapper/postgre-postgresql_lv
99G 60M 94G 1% /postgresql
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· .NET Core 中如何实现缓存的预热?
· 三行代码完成国际化适配,妙~啊~
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?