设为首页 收藏本站
查看: 1196|回复: 0

[经验分享] LINUX扩展根目录磁盘空间(LINUX LVM )

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-1-25 08:46:00 | 显示全部楼层 |阅读模式
linux扩展根目录磁盘空间(linux lvm )

扩展目标分区前提:
扩展的分区必须要是linux lvm卷如下截图(分区/dev/sda1不可以扩展,分区/dev/sda2可以扩展)
1.jpg
提示:决定linux lvm的因素是磁盘第一次分区时候选择的分区格式决定的。如下图列出了linux下支持的分区格式
2.jpg
SSH Secure Shell 3.2.9 (Build 283)
Copyright (c) 2000-2003 SSH Communications Security Corp - http://www.ssh.com/
This copy of SSH Secure Shell is a non-commercial version.
This version does not include PKI and PKCS #11 functionality.
Last login: Fri Dec 18 15:51:53 2015 from 192.168.19.1
1.查看当前磁盘空间
[iyunv@mail ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 122M     0  122M   0% /dev
tmpfs                    131M     0  131M   0% /dev/shm
tmpfs                    131M  948K  130M   1% /run
tmpfs                    131M     0  131M   0% /sys/fs/cgroup
/dev/mapper/fedora-root   18G  5.2G   12G  33% /
tmpfs                    131M  8.0K  131M   1% /tmp
/dev/sda1                477M   99M  349M  23% /boot
tmpfs                     27M     0   27M   0% /run/user/0
[iyunv@mail ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 122M     0  122M   0% /dev
tmpfs                    131M     0  131M   0% /dev/shm
tmpfs                    131M  948K  130M   1% /run
tmpfs                    131M     0  131M   0% /sys/fs/cgroup
/dev/mapper/fedora-root   18G  5.2G   12G  33% /
tmpfs                    131M  8.0K  131M   1% /tmp
/dev/sda1                477M   99M  349M  23% /boot
tmpfs                     27M     0   27M   0% /run/user/0
[iyunv@mail ~]# fdisk -l
Disk /dev/sda: 30 GiB, 32212254720 bytes, 62914560 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: 0x494832b4
Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda1  *       2048  1026047  1024000  500M 83 Linux
/dev/sda2       1026048 41943039 40916992 19.5G 8e Linux LVM
Disk /dev/mapper/fedora-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
Disk /dev/mapper/fedora-root: 17.5 GiB, 18798870528 bytes, 36716544 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
[iyunv@mail ~]# pvdisplay
--- Physical volume ---
PV Name               /dev/sda2
VG Name               fedora
PV Size               19.51 GiB / not usable 3.00 MiB
Allocatable           yes (but full)
PE Size               4.00 MiB
Total PE              4994
Free PE               0
Allocated PE          4994
PV UUID               WX9LBx-nFSo-mVyM-3INs-T04v-lKg4-kXFiKk
[iyunv@mail ~]# pvcreate /dev/sd
Device /dev/sd not found (or ignored by filtering).
[iyunv@mail ~]# pvcreate /dev/sd*
Device /dev/sda not found (or ignored by filtering).
Can't open /dev/sda1 exclusively.  Mounted filesystem?
Can't initialize physical volume "/dev/sda2" of volume group "fedora" without -ff
[iyunv@mail ~]# pvcreate /dev/sdb
Device /dev/sdb not found (or ignored by filtering).
[iyunv@mail ~]# pvdisplay /dev/sda2
--- Physical volume ---
PV Name               /dev/sda2
VG Name               fedora
PV Size               19.51 GiB / not usable 3.00 MiB
Allocatable           yes (but full)
PE Size               4.00 MiB
Total PE              4994
Free PE               0
Allocated PE          4994
PV UUID               WX9LBx-nFSo-mVyM-3INs-T04v-lKg4-kXFiKk
[iyunv@mail ~]# pvdisplay /dev/sda3
Failed to find device for physical volume "/dev/sda3".
[iyunv@mail ~]# df -lh
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 122M     0  122M   0% /dev
tmpfs                    131M     0  131M   0% /dev/shm
tmpfs                    131M  948K  130M   1% /run
tmpfs                    131M     0  131M   0% /sys/fs/cgroup
/dev/mapper/fedora-root   18G  5.2G   12G  33% /
tmpfs                    131M  8.0K  131M   1% /tmp
/dev/sda1                477M   99M  349M  23% /boot
tmpfs                     27M     0   27M   0% /run/user/0
[iyunv@mail ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 122M     0  122M   0% /dev
tmpfs                    131M     0  131M   0% /dev/shm
tmpfs                    131M  948K  130M   1% /run
tmpfs                    131M     0  131M   0% /sys/fs/cgroup
/dev/mapper/fedora-root   18G  5.2G   12G  33% /
tmpfs                    131M  8.0K  131M   1% /tmp
/dev/sda1                477M   99M  349M  23% /boot
tmpfs                     27M     0   27M   0% /run/user/0
[iyunv@mail ~]# fdisk -l
Disk /dev/sda: 30 GiB, 32212254720 bytes, 62914560 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: 0x494832b4
Device     Boot   Start      End  Sectors  Size Id Type
/dev/sda1  *       2048  1026047  1024000  500M 83 Linux
/dev/sda2       1026048 41943039 40916992 19.5G 8e Linux LVM
Disk /dev/mapper/fedora-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
Disk /dev/mapper/fedora-root: 17.5 GiB, 18798870528 bytes, 36716544 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
[iyunv@mail ~]# vgextend fedora /dev/sda2
Physical volume '/dev/sda2' is already in volume group 'fedora'
Unable to add physical volume '/dev/sda2' to volume group 'fedora'.
(这里要先添加磁盘分区)
3.jpg
2.创建磁盘分区
[iyunv@mail ~]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.26.2).
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
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
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 (2 primary, 0 extended, 2 free)
e   extended (container for logical partitions)
Select (default p): p
Partition number (3,4, default 3): 3
First sector (41943040-62914559, default 41943040):
Last sector, +sectors or +size{K,M,G,T,P} (41943040-62914559, default 62914559):
Created a new partition 3 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.
Re-reading the partition table failed.: Device or resource busy
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
[iyunv@mail ~]# df -lh
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 122M     0  122M   0% /dev
tmpfs                    131M     0  131M   0% /dev/shm
tmpfs                    131M  948K  130M   1% /run
tmpfs                    131M     0  131M   0% /sys/fs/cgroup
/dev/mapper/fedora-root   18G  5.2G   12G  33% /
tmpfs                    131M  8.0K  131M   1% /tmp
/dev/sda1                477M   99M  349M  23% /boot
tmpfs                     27M     0   27M   0% /run/user/0
3./dev/sda3即是新创建的磁盘
[iyunv@mail ~]# fdisk -l
Disk /dev/sda: 30 GiB, 32212254720 bytes, 62914560 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: 0x494832b4
Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1  *        2048  1026047  1024000  500M 83 Linux
/dev/sda2        1026048 41943039 40916992 19.5G 8e Linux LVM
/dev/sda3       41943040 62914559 20971520   10G 83 Linux
Disk /dev/mapper/fedora-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
Disk /dev/mapper/fedora-root: 17.5 GiB, 18798870528 bytes, 36716544 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
4.把/dev/sda3更改成linux lvm卷(便于加入linux lvm然后空间加入根分区)
[iyunv@mail ~]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.26.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): n
To create more partitions, first replace a primary with an extended partition.
Command (m for help): p
Disk /dev/sda: 30 GiB, 32212254720 bytes, 62914560 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: 0x494832b4
Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1  *        2048  1026047  1024000  500M 83 Linux
/dev/sda2        1026048 41943039 40916992 19.5G 8e Linux LVM
/dev/sda3       41943040 62914559 20971520   10G 83 Linux
Command (m for help): 3
3: unknown command
Command (m for help):
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
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
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
To create more partitions, first replace a primary with an extended partition.
Command (m for help): t
Partition number (1-3, default 3): 3
Partition type (type L to list all types): 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.
Re-reading the partition table failed.: Device or resource busy
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
[iyunv@mail ~]# df -lh
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 122M     0  122M   0% /dev
tmpfs                    131M     0  131M   0% /dev/shm
tmpfs                    131M  948K  130M   1% /run
tmpfs                    131M     0  131M   0% /sys/fs/cgroup
/dev/mapper/fedora-root   18G  5.2G   12G  33% /
tmpfs                    131M  8.0K  131M   1% /tmp
/dev/sda1                477M   99M  349M  23% /boot
tmpfs                     27M     0   27M   0% /run/user/0
5./dev/sda3已经成功更改为linux lvm卷
[iyunv@mail ~]# fdisk -l
Disk /dev/sda: 30 GiB, 32212254720 bytes, 62914560 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: 0x494832b4
Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1  *        2048  1026047  1024000  500M 83 Linux
/dev/sda2        1026048 41943039 40916992 19.5G 8e Linux LVM
/dev/sda3       41943040 62914559 20971520   10G 8e Linux LVM
Disk /dev/mapper/fedora-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
Disk /dev/mapper/fedora-root: 17.5 GiB, 18798870528 bytes, 36716544 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
[iyunv@mail ~]# df -T
Filesystem              Type     1K-blocks    Used Available Use% Mounted on
devtmpfs                devtmpfs    124256       0    124256   0% /dev
tmpfs                   tmpfs       133964       0    133964   0% /dev/shm
tmpfs                   tmpfs       133964     948    133016   1% /run
tmpfs                   tmpfs       133964       0    133964   0% /sys/fs/cgroup
/dev/mapper/fedora-root ext4      17938864 5447232  11557336  33% /
tmpfs                   tmpfs       133964       8    133956   1% /tmp
/dev/sda1               ext4        487652  101297    356659  23% /boot
tmpfs                   tmpfs        26796       0     26796   0% /run/user/0
[iyunv@mail ~]# df -TH
Filesystem              Type      Size  Used Avail Use% Mounted on
devtmpfs                devtmpfs  128M     0  128M   0% /dev
tmpfs                   tmpfs     138M     0  138M   0% /dev/shm
tmpfs                   tmpfs     138M  971k  137M   1% /run
tmpfs                   tmpfs     138M     0  138M   0% /sys/fs/cgroup
/dev/mapper/fedora-root ext4       19G  5.6G   12G  33% /
tmpfs                   tmpfs     138M  8.2k  138M   1% /tmp
/dev/sda1               ext4      500M  104M  366M  23% /boot
tmpfs                   tmpfs      28M     0   28M   0% /run/user/0
[iyunv@mail ~]# df -lh
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 122M     0  122M   0% /dev
tmpfs                    131M     0  131M   0% /dev/shm
tmpfs                    131M  948K  130M   1% /run
tmpfs                    131M     0  131M   0% /sys/fs/cgroup
/dev/mapper/fedora-root   18G  5.2G   12G  33% /
tmpfs                    131M  8.0K  131M   1% /tmp
/dev/sda1                477M   99M  349M  23% /boot
tmpfs                     27M     0   27M   0% /run/user/0
[iyunv@mail ~]# fdisk -l
Disk /dev/sda: 30 GiB, 32212254720 bytes, 62914560 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: 0x494832b4
Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1  *        2048  1026047  1024000  500M 83 Linux
/dev/sda2        1026048 41943039 40916992 19.5G 8e Linux LVM
/dev/sda3       41943040 62914559 20971520   10G 8e Linux LVM
Disk /dev/mapper/fedora-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
Disk /dev/mapper/fedora-root: 17.5 GiB, 18798870528 bytes, 36716544 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
[iyunv@mail ~]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.26.2).
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/sda: 30 GiB, 32212254720 bytes, 62914560 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: 0x494832b4
Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1  *        2048  1026047  1024000  500M 83 Linux
/dev/sda2        1026048 41943039 40916992 19.5G 8e Linux LVM
/dev/sda3       41943040 62914559 20971520   10G 8e Linux LVM
Command (m for help): q
[iyunv@mail ~]# df -T
Filesystem              Type     1K-blocks    Used Available Use% Mounted on
devtmpfs                devtmpfs    124256       0    124256   0% /dev
tmpfs                   tmpfs       133964       0    133964   0% /dev/shm
tmpfs                   tmpfs       133964     948    133016   1% /run
tmpfs                   tmpfs       133964       0    133964   0% /sys/fs/cgroup
/dev/mapper/fedora-root ext4      17938864 5447232  11557336  33% /
tmpfs                   tmpfs       133964       8    133956   1% /tmp
/dev/sda1               ext4        487652  101297    356659  23% /boot
tmpfs                   tmpfs        26796       0     26796   0% /run/user/0
6.刷新分区
[iyunv@mail ~]# partprobe
7.格式化/dev/sda3为 ext4格式
[iyunv@mail ~]# mkfs.ext4 /dev/sda3
mke2fs 1.42.12 (29-Aug-2014)
Creating filesystem with 2621440 4k blocks and 655360 inodes
Filesystem UUID: e9cdabd2-d211-4b20-ad89-176c845d56c5
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
[iyunv@mail ~]# df -lh
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 122M     0  122M   0% /dev
tmpfs                    131M     0  131M   0% /dev/shm
tmpfs                    131M  952K  130M   1% /run
tmpfs                    131M     0  131M   0% /sys/fs/cgroup
/dev/mapper/fedora-root   18G  5.2G   12G  33% /
tmpfs                    131M  8.0K  131M   1% /tmp
/dev/sda1                477M   99M  349M  23% /boot
tmpfs                     27M     0   27M   0% /run/user/0
[iyunv@mail ~]# lvs
LV   VG     Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
root fedora -wi-ao---- 17.51g
swap fedora -wi-ao----  2.00g
8.创建  Physical volume                             
[iyunv@mail ~]# pvcreate /dev/sda3
WARNING: ext4 signature detected on /dev/sda3 at offset 1080. Wipe it? [y/n]: y
Wiping ext4 signature on /dev/sda3.
Physical volume "/dev/sda3" successfully created
9.把/dev/sda3加入 fedora 组(系统根分区默认组)
[iyunv@mail ~]# vgextend fedora /dev/sda3
Volume group "fedora" successfully extended
[iyunv@mail ~]# vgdisplay
--- Volume group ---
VG Name               fedora
System ID
Format                lvm2
Metadata Areas        2
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                2
Act PV                2
VG Size               29.50 GiB
PE Size               4.00 MiB
Total PE              7553
Alloc PE / Size       4994 / 19.51 GiB
Free  PE / Size       2559 / 10.00 GiB
VG UUID               fsrCEu-vQgr-a0Xx-hiDy-S1QR-pW9Q-2ROFlQ
  10.根分区扩展空间7.69G (命令出错)
[iyunv@mail ~]# lvextend -L +7.96G /dev/VolGroup00/LogVol00 /dev/sda3
Volume group "VolGroup00" not found
[iyunv@mail ~]# df -lh
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 122M     0  122M   0% /dev
tmpfs                    131M     0  131M   0% /dev/shm
tmpfs                    131M  952K  130M   1% /run
tmpfs                    131M     0  131M   0% /sys/fs/cgroup
/dev/mapper/fedora-root   18G  5.2G   12G  33% /
tmpfs                    131M  8.0K  131M   1% /tmp
/dev/sda1                477M   99M  349M  23% /boot
tmpfs                     27M     0   27M   0% /run/user/0
  11.根分区扩展空间10G (出错,可供扩展的空间不足)
[iyunv@mail ~]# lvextend -L +10G /dev/mapper/fedora-root /dev/sda3
Insufficient free space: 2560 extents needed, but only 2559 available
  12.根分区扩展空间9.8G (成功)
[iyunv@mail ~]# lvextend -L +9.8G /dev/mapper/fedora-root /dev/sda3
Rounding size to boundary between physical extents: 9.80 GiB
Size of logical volume fedora/root changed from 17.51 GiB (4482 extents) to 27.31 GiB (6991 extents).
Logical volume root successfully resized
[iyunv@mail ~]# vim /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sat Jul  4 17:58:53 2015
#
# 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/fedora-root /       ext4    usrquota,grpquota       0       1
UUID=94aed458-ec42-4303-a893-c6effa398adc /boot                   ext4    defaults        1 2
/dev/mapper/fedora-swap swap                    swap    defaults        0 0
~
~
~
~
[iyunv@mail ~]#
[iyunv@mail ~]#
[iyunv@mail ~]# e2fsck -f /dev/mapper/fedora-root
e2fsck 1.42.12 (29-Aug-2014)
/dev/mapper/fedora-root is mounted.
e2fsck: Cannot continue, aborting.
[iyunv@mail ~]# e2fsck -f /dev/mapper/fedora
e2fsck 1.42.12 (29-Aug-2014)
e2fsck: No such file or directory while trying to open /dev/mapper/fedora
Possibly non-existent device?
[iyunv@mail ~]# df -lh
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 122M     0  122M   0% /dev
tmpfs                    131M     0  131M   0% /dev/shm
tmpfs                    131M  952K  130M   1% /run
tmpfs                    131M     0  131M   0% /sys/fs/cgroup
/dev/mapper/fedora-root   18G  5.2G   12G  33% /
tmpfs                    131M  8.0K  131M   1% /tmp
/dev/sda1                477M   99M  349M  23% /boot
tmpfs                     27M     0   27M   0% /run/user/0
13.文件系统重定义分区大小
[iyunv@mail ~]# resize2fs /dev/mapper/fedora-root
resize2fs 1.42.12 (29-Aug-2014)
Filesystem at /dev/mapper/fedora-root is mounted on /; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 2
The filesystem on /dev/mapper/fedora-root is now 7158784 (4k) blocks long.
14.查看磁盘根目录空间已经成功扩展(18G变为27G)
[iyunv@mail ~]# df -lh
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 122M     0  122M   0% /dev
tmpfs                    131M     0  131M   0% /dev/shm
tmpfs                    131M  952K  130M   1% /run
tmpfs                    131M     0  131M   0% /sys/fs/cgroup
/dev/mapper/fedora-root   27G  5.2G   21G  21% /
tmpfs                    131M  8.0K  131M   1% /tmp
/dev/sda1                477M   99M  349M  23% /boot
tmpfs                     27M     0   27M   0% /run/user/0
[iyunv@mail ~]#
15.LINUX lvm 卷 根分区扩展结束


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-169026-1-1.html 上篇帖子: Unix , Linux 修改locale 下篇帖子: 设置linux环境变量 LINUX 根目录 空间
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表