These commands create a single partition that fills the entire disk
# parted
In this case, the partition will be
You can then add that PV to an existing volume group:
# vgextend main
Volume group 'main' successfully extended
6.1.1.3.9. Removing a partition
The
# vgreduce
Physical volume '/dev/sdb1' still in use
In this case, an attempt to remove
# pvmove
Depending on the amount of date to be moved, this operation can take quite a while to run. When it is complete, you can remove the physical volume:
# vgreduce
Removed '/dev/sdb1' from volume group 'test'
You can then use that partition for other uses. If you want to erase the LVM disk label, use the
# pvremove
Labels on physical volume '/dev/sde1' successfully wiped
6.1.1.4. Managing LVM in single-user mode
Some filesystems, such as those containing
To use
At this shell prompt you can unmount the filesystem, then use
sh-3.1# umount
sh-3.1# fsck -f
e2fsck 1.38 (30-Jun-2005)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/main/home: 121/256000 files (2.5% non-contiguous), 12704/262144 blocks
sh-3.1# resize2fs
resize2fs 1.38 (30-Jun-2005)
Resizing the filesystem on /dev/main/home to 230400 (4k) blocks.
The filesystem on /dev/main/home is now 229376 blocks long.
sh-3.1# lvreduce
Rounding up size to full physical extent 952.00 MB
WARNING: Reducing active logical volume to 952.00 MB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce home? [y/n]: y
Reducing logical volume home to 952.00 MB
Logical volume home successfully resized
sh-3.1# resize2fs
resize2fs 1.38 (30-Jun-2005)
Resizing the filesystem on /dev/main/home to 243712 (4k) blocks.
The filesystem on /dev/main/home is now 243712 blocks long.
The warning message displayed by
If your system has the default Volume Group and Logical Volume names, substitute the correct name (such as
Note that, as before, the filesystem was resized to be slightly smaller than the desired size, then expanded to fill the LV after the LV was resized.
When you're done, type reboot or press Ctrl-Alt-Delete to restart the system.