Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Wiki Replica
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
TPA
Wiki Replica
Commits
7b7d1766
Unverified
Commit
7b7d1766
authored
4 years ago
by
anarcat
Browse files
Options
Downloads
Patches
Plain Diff
document shrinking LVMs
parent
4dea39d2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
howto/lvm.md
+51
-0
51 additions, 0 deletions
howto/lvm.md
with
51 additions
and
0 deletions
howto/lvm.md
+
51
−
0
View file @
7b7d1766
...
...
@@ -156,3 +156,54 @@ should do the following:
mount /srv
service apache2 start
# Shrinking
1.
unmount the filesystem:
umount /mnt
If that's not possible because the filesystem is in use, you'll
need to stop processes using it. If that's possible (for example
when resizing
`/`
), you'll need to reboot in a separate operating
system first.
2.
forcibly check the filesystem:
e2fsck -fy /dev/sdX
3.
shrink the filesystem:
resize2fs /dev/sdX 5G
4.
shrink the logical volume, to reduce
*to*
5G:
lvreduce -L 5G vg/mnt
to reduce *by* 5G:
lvreduce -L -5G vg/mnt
WARNING: make sure the resulting size matches exactly the one
specified in the `resize2fs` command above.
5.
tell ext to resize the filesystem
*again*
:
resize2fs /dev/sdX
NOTE: no size argument here!
6.
check the filesystem again:
e2fsck -fy /dev/sdX
7.
if you want to resize the underlying device (for example, if this
is a LVM inside a virtual machine on top of another LVM), you can
also shrink the parent logical volume, physical volume, and crypto
device (if relevant) at this point.
lvreduce -L 5G vg/hostname
pvresize /dev/sdY
cryptsetup resize DEVICE_LABEL
WARNING: this last step has not been tested.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment