LVM. How to reduce size of /data and extend /homeHow can I sort du -h output by sizeHow can I resize a regular (non-LVM) partition?Restoring data from corrupted ext4 partition under LVM - fsck or repair bad blocks first?Webserver faultRescue disk is unable to see the lvm physical volumes /tmp has changed to read onlyMapping between KVM guest virtual discs and LVM logical volumesThe RAID 1 Time machineHow to enlarge the root partition on Centos 7 / ibdata1 getting too largeCan't find (inactive?) LVM (with root FS) on boot
How did students remember what to practise between lessons without any sheet music?
Preventing Employees from either switching to Competitors or Opening Their Own Business
How to build suspense or so to establish and justify xenophobia of characters in the eyes of the reader?
Is open-sourcing the code of a webapp not recommended?
Trapping Rain Water
How to chain Python function calls so the behaviour is as follows
Was there a priest on the Titanic who stayed on the ship giving confession to as many as he could?
How to officially communicate to a non-responsive colleague?
How can drunken, homicidal elves successfully conduct a wild hunt?
How does an ordinary object become radioactive?
Company did not petition for visa in a timely manner. Is asking me to work from overseas, but wants me to take a paycut
Russian equivalents of "no love lost"
Why does the Schrödinger equation work so well for the hydrogen atom despite the relativistic boundary at the nucleus?
Smooth switching between 12 V batteries, with a toggle switch
Why doesn’t a normal window produce an apparent rainbow?
Payment instructions allegedly from HomeAway look fishy to me
Average spam confidence
Frame failure sudden death?
What language is the software written in on the ISS?
What risks are there when you clear your cookies instead of logging off?
The eyes have it
How does a transformer increase voltage while decreasing the current?
Question about Jech's proof of V = L implies GCH
When conversion from Integer to Single may lose precision
LVM. How to reduce size of /data and extend /home
How can I sort du -h output by sizeHow can I resize a regular (non-LVM) partition?Restoring data from corrupted ext4 partition under LVM - fsck or repair bad blocks first?Webserver faultRescue disk is unable to see the lvm physical volumes /tmp has changed to read onlyMapping between KVM guest virtual discs and LVM logical volumesThe RAID 1 Time machineHow to enlarge the root partition on Centos 7 / ibdata1 getting too largeCan't find (inactive?) LVM (with root FS) on boot
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have a production server in which I need to move space from /data
(3.7 T
) to /home
(50G
) using lvm
, I need to move around 200G
of space.
The solution I'm thinking of is reducing the size of /data and then take the freed space and extend /home
with it.
Adding a disk is not an option as I have an abundance of space on /data
(3.7 T and only 1% of it used as shown in the df
command below)
I have one volume group and one pv
with no free space:
pvs
:
PV VG Fmt Attr PSize PFree
/dev/sda4 rhel lvm2 a-- 3.64t 4.00m
vgs
:
VG #PV #LV #SN Attr VSize VFree
rhel 1 10 0 wz--n- 3.64t 4.00m
lvs
output:
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data rhel -wi-ao---- 2.98t
home rhel -wi-ao---- 50.00g
opt rhel -wi-ao---- 30.00g
root rhel -wi-ao---- 50.00g
swap rhel -wi-ao---- 30.00g
tmp rhel -wi-ao---- 200.00g
usr rhel -wi-ao---- 100.00g
var rhel -wi-ao---- 200.00g
var_log rhel -wi-ao---- 10.00g
var_log_audit rhel -wi-ao---- 5.00g
output of df -khT
:
/dev/mapper/rhel-usr ext4 99G 8.7G 85G 10% /usr
/dev/sda2 ext4 976M 101M 808M 12% /boot
/dev/sda3 vfat 512M 0 512M 0% /boot/efi
/dev/mapper/rhel-home ext4 50G 41G 5.7G 88% /home
/dev/mapper/rhel-opt ext4 30G 11G 18G 39% /opt
/dev/mapper/rhel-tmp ext4 197G 4.2G 183G 3% /tmp
/dev/mapper/rhel-data ext4 3.0T 26G 2.8T 1% /data
/dev/sdb1 ext4 3.6T 79G 3.4T 3% /data/disk01
/dev/sdc1 ext4 3.6T 758M 3.4T 1% /data/disk02
The output of lsblk
shows that /home
and /data
are both under the same partition sda4
, although I don't exactly know how to do this. It seems that it's convenient that both /home
and /data
are under the same partition:
lsblk:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 3.7T 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 1G 0 part /boot
├─sda3 8:3 0 512M 0 part /boot/efi
└─sda4 8:4 0 3.7T 0 part
├─rhel-root 253:0 0 50G 0 lvm /
├─rhel-swap 253:1 0 30G 0 lvm [SWAP]
├─rhel-usr 253:2 0 100G 0 lvm /usr
├─rhel-tmp 253:3 0 200G 0 lvm /tmp
├─rhel-home 253:4 0 50G 0 lvm /home
├─rhel-var 253:5 0 200G 0 lvm /var
├─rhel-var_log_audit 253:6 0 5G 0 lvm /var/log/audit
├─rhel-var_log 253:7 0 10G 0 lvm /var/log
├─rhel-opt 253:8 0 30G 0 lvm /opt
└─rhel-data 253:9 0 3T 0 lvm /data
I need to do this without the loss of any data and preferably without restarting the server.
If this is possible please recommend a solution, if not please explain why.
linux redhat lvm
add a comment |
I have a production server in which I need to move space from /data
(3.7 T
) to /home
(50G
) using lvm
, I need to move around 200G
of space.
The solution I'm thinking of is reducing the size of /data and then take the freed space and extend /home
with it.
Adding a disk is not an option as I have an abundance of space on /data
(3.7 T and only 1% of it used as shown in the df
command below)
I have one volume group and one pv
with no free space:
pvs
:
PV VG Fmt Attr PSize PFree
/dev/sda4 rhel lvm2 a-- 3.64t 4.00m
vgs
:
VG #PV #LV #SN Attr VSize VFree
rhel 1 10 0 wz--n- 3.64t 4.00m
lvs
output:
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data rhel -wi-ao---- 2.98t
home rhel -wi-ao---- 50.00g
opt rhel -wi-ao---- 30.00g
root rhel -wi-ao---- 50.00g
swap rhel -wi-ao---- 30.00g
tmp rhel -wi-ao---- 200.00g
usr rhel -wi-ao---- 100.00g
var rhel -wi-ao---- 200.00g
var_log rhel -wi-ao---- 10.00g
var_log_audit rhel -wi-ao---- 5.00g
output of df -khT
:
/dev/mapper/rhel-usr ext4 99G 8.7G 85G 10% /usr
/dev/sda2 ext4 976M 101M 808M 12% /boot
/dev/sda3 vfat 512M 0 512M 0% /boot/efi
/dev/mapper/rhel-home ext4 50G 41G 5.7G 88% /home
/dev/mapper/rhel-opt ext4 30G 11G 18G 39% /opt
/dev/mapper/rhel-tmp ext4 197G 4.2G 183G 3% /tmp
/dev/mapper/rhel-data ext4 3.0T 26G 2.8T 1% /data
/dev/sdb1 ext4 3.6T 79G 3.4T 3% /data/disk01
/dev/sdc1 ext4 3.6T 758M 3.4T 1% /data/disk02
The output of lsblk
shows that /home
and /data
are both under the same partition sda4
, although I don't exactly know how to do this. It seems that it's convenient that both /home
and /data
are under the same partition:
lsblk:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 3.7T 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 1G 0 part /boot
├─sda3 8:3 0 512M 0 part /boot/efi
└─sda4 8:4 0 3.7T 0 part
├─rhel-root 253:0 0 50G 0 lvm /
├─rhel-swap 253:1 0 30G 0 lvm [SWAP]
├─rhel-usr 253:2 0 100G 0 lvm /usr
├─rhel-tmp 253:3 0 200G 0 lvm /tmp
├─rhel-home 253:4 0 50G 0 lvm /home
├─rhel-var 253:5 0 200G 0 lvm /var
├─rhel-var_log_audit 253:6 0 5G 0 lvm /var/log/audit
├─rhel-var_log 253:7 0 10G 0 lvm /var/log
├─rhel-opt 253:8 0 30G 0 lvm /opt
└─rhel-data 253:9 0 3T 0 lvm /data
I need to do this without the loss of any data and preferably without restarting the server.
If this is possible please recommend a solution, if not please explain why.
linux redhat lvm
add a comment |
I have a production server in which I need to move space from /data
(3.7 T
) to /home
(50G
) using lvm
, I need to move around 200G
of space.
The solution I'm thinking of is reducing the size of /data and then take the freed space and extend /home
with it.
Adding a disk is not an option as I have an abundance of space on /data
(3.7 T and only 1% of it used as shown in the df
command below)
I have one volume group and one pv
with no free space:
pvs
:
PV VG Fmt Attr PSize PFree
/dev/sda4 rhel lvm2 a-- 3.64t 4.00m
vgs
:
VG #PV #LV #SN Attr VSize VFree
rhel 1 10 0 wz--n- 3.64t 4.00m
lvs
output:
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data rhel -wi-ao---- 2.98t
home rhel -wi-ao---- 50.00g
opt rhel -wi-ao---- 30.00g
root rhel -wi-ao---- 50.00g
swap rhel -wi-ao---- 30.00g
tmp rhel -wi-ao---- 200.00g
usr rhel -wi-ao---- 100.00g
var rhel -wi-ao---- 200.00g
var_log rhel -wi-ao---- 10.00g
var_log_audit rhel -wi-ao---- 5.00g
output of df -khT
:
/dev/mapper/rhel-usr ext4 99G 8.7G 85G 10% /usr
/dev/sda2 ext4 976M 101M 808M 12% /boot
/dev/sda3 vfat 512M 0 512M 0% /boot/efi
/dev/mapper/rhel-home ext4 50G 41G 5.7G 88% /home
/dev/mapper/rhel-opt ext4 30G 11G 18G 39% /opt
/dev/mapper/rhel-tmp ext4 197G 4.2G 183G 3% /tmp
/dev/mapper/rhel-data ext4 3.0T 26G 2.8T 1% /data
/dev/sdb1 ext4 3.6T 79G 3.4T 3% /data/disk01
/dev/sdc1 ext4 3.6T 758M 3.4T 1% /data/disk02
The output of lsblk
shows that /home
and /data
are both under the same partition sda4
, although I don't exactly know how to do this. It seems that it's convenient that both /home
and /data
are under the same partition:
lsblk:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 3.7T 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 1G 0 part /boot
├─sda3 8:3 0 512M 0 part /boot/efi
└─sda4 8:4 0 3.7T 0 part
├─rhel-root 253:0 0 50G 0 lvm /
├─rhel-swap 253:1 0 30G 0 lvm [SWAP]
├─rhel-usr 253:2 0 100G 0 lvm /usr
├─rhel-tmp 253:3 0 200G 0 lvm /tmp
├─rhel-home 253:4 0 50G 0 lvm /home
├─rhel-var 253:5 0 200G 0 lvm /var
├─rhel-var_log_audit 253:6 0 5G 0 lvm /var/log/audit
├─rhel-var_log 253:7 0 10G 0 lvm /var/log
├─rhel-opt 253:8 0 30G 0 lvm /opt
└─rhel-data 253:9 0 3T 0 lvm /data
I need to do this without the loss of any data and preferably without restarting the server.
If this is possible please recommend a solution, if not please explain why.
linux redhat lvm
I have a production server in which I need to move space from /data
(3.7 T
) to /home
(50G
) using lvm
, I need to move around 200G
of space.
The solution I'm thinking of is reducing the size of /data and then take the freed space and extend /home
with it.
Adding a disk is not an option as I have an abundance of space on /data
(3.7 T and only 1% of it used as shown in the df
command below)
I have one volume group and one pv
with no free space:
pvs
:
PV VG Fmt Attr PSize PFree
/dev/sda4 rhel lvm2 a-- 3.64t 4.00m
vgs
:
VG #PV #LV #SN Attr VSize VFree
rhel 1 10 0 wz--n- 3.64t 4.00m
lvs
output:
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data rhel -wi-ao---- 2.98t
home rhel -wi-ao---- 50.00g
opt rhel -wi-ao---- 30.00g
root rhel -wi-ao---- 50.00g
swap rhel -wi-ao---- 30.00g
tmp rhel -wi-ao---- 200.00g
usr rhel -wi-ao---- 100.00g
var rhel -wi-ao---- 200.00g
var_log rhel -wi-ao---- 10.00g
var_log_audit rhel -wi-ao---- 5.00g
output of df -khT
:
/dev/mapper/rhel-usr ext4 99G 8.7G 85G 10% /usr
/dev/sda2 ext4 976M 101M 808M 12% /boot
/dev/sda3 vfat 512M 0 512M 0% /boot/efi
/dev/mapper/rhel-home ext4 50G 41G 5.7G 88% /home
/dev/mapper/rhel-opt ext4 30G 11G 18G 39% /opt
/dev/mapper/rhel-tmp ext4 197G 4.2G 183G 3% /tmp
/dev/mapper/rhel-data ext4 3.0T 26G 2.8T 1% /data
/dev/sdb1 ext4 3.6T 79G 3.4T 3% /data/disk01
/dev/sdc1 ext4 3.6T 758M 3.4T 1% /data/disk02
The output of lsblk
shows that /home
and /data
are both under the same partition sda4
, although I don't exactly know how to do this. It seems that it's convenient that both /home
and /data
are under the same partition:
lsblk:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 3.7T 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 1G 0 part /boot
├─sda3 8:3 0 512M 0 part /boot/efi
└─sda4 8:4 0 3.7T 0 part
├─rhel-root 253:0 0 50G 0 lvm /
├─rhel-swap 253:1 0 30G 0 lvm [SWAP]
├─rhel-usr 253:2 0 100G 0 lvm /usr
├─rhel-tmp 253:3 0 200G 0 lvm /tmp
├─rhel-home 253:4 0 50G 0 lvm /home
├─rhel-var 253:5 0 200G 0 lvm /var
├─rhel-var_log_audit 253:6 0 5G 0 lvm /var/log/audit
├─rhel-var_log 253:7 0 10G 0 lvm /var/log
├─rhel-opt 253:8 0 30G 0 lvm /opt
└─rhel-data 253:9 0 3T 0 lvm /data
I need to do this without the loss of any data and preferably without restarting the server.
If this is possible please recommend a solution, if not please explain why.
linux redhat lvm
linux redhat lvm
edited May 21 at 11:02
Dave M
4,38992428
4,38992428
asked May 21 at 10:40
Gherbi HichamGherbi Hicham
1063
1063
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
ext4 doesn't support on-line shrinking, you have to unmount the filesystem before to unmount it but the operating system can remain up.
ext4 and LVM logical volume online resize(increasing the size) instead is supported.
I'm reading that you have a RHEL, so you should have access to Red Hat knowledge base Red Hat.
This solution https://access.redhat.com/solutions/32530 describe the procedure to shrink a LVM logical volume with ext4 filesystem on it.
No I don't have access to red hat knowledge base as I am not working directly for the company that owns this server, if it's possible to include the procedure it will be appreciated.
– Gherbi Hicham
May 21 at 11:00
3
Giving an answer on serverfault that points to documentation only available to the happy few isn't useful.
– wurtel
May 21 at 11:05
RHEL server should be used only having a valid subscription for it. If you have a valid subscription, you have access to the RH Knowledge base and the link reported aboce
– NoNoNo
May 21 at 11:41
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f968205%2flvm-how-to-reduce-size-of-data-and-extend-home%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
ext4 doesn't support on-line shrinking, you have to unmount the filesystem before to unmount it but the operating system can remain up.
ext4 and LVM logical volume online resize(increasing the size) instead is supported.
I'm reading that you have a RHEL, so you should have access to Red Hat knowledge base Red Hat.
This solution https://access.redhat.com/solutions/32530 describe the procedure to shrink a LVM logical volume with ext4 filesystem on it.
No I don't have access to red hat knowledge base as I am not working directly for the company that owns this server, if it's possible to include the procedure it will be appreciated.
– Gherbi Hicham
May 21 at 11:00
3
Giving an answer on serverfault that points to documentation only available to the happy few isn't useful.
– wurtel
May 21 at 11:05
RHEL server should be used only having a valid subscription for it. If you have a valid subscription, you have access to the RH Knowledge base and the link reported aboce
– NoNoNo
May 21 at 11:41
add a comment |
ext4 doesn't support on-line shrinking, you have to unmount the filesystem before to unmount it but the operating system can remain up.
ext4 and LVM logical volume online resize(increasing the size) instead is supported.
I'm reading that you have a RHEL, so you should have access to Red Hat knowledge base Red Hat.
This solution https://access.redhat.com/solutions/32530 describe the procedure to shrink a LVM logical volume with ext4 filesystem on it.
No I don't have access to red hat knowledge base as I am not working directly for the company that owns this server, if it's possible to include the procedure it will be appreciated.
– Gherbi Hicham
May 21 at 11:00
3
Giving an answer on serverfault that points to documentation only available to the happy few isn't useful.
– wurtel
May 21 at 11:05
RHEL server should be used only having a valid subscription for it. If you have a valid subscription, you have access to the RH Knowledge base and the link reported aboce
– NoNoNo
May 21 at 11:41
add a comment |
ext4 doesn't support on-line shrinking, you have to unmount the filesystem before to unmount it but the operating system can remain up.
ext4 and LVM logical volume online resize(increasing the size) instead is supported.
I'm reading that you have a RHEL, so you should have access to Red Hat knowledge base Red Hat.
This solution https://access.redhat.com/solutions/32530 describe the procedure to shrink a LVM logical volume with ext4 filesystem on it.
ext4 doesn't support on-line shrinking, you have to unmount the filesystem before to unmount it but the operating system can remain up.
ext4 and LVM logical volume online resize(increasing the size) instead is supported.
I'm reading that you have a RHEL, so you should have access to Red Hat knowledge base Red Hat.
This solution https://access.redhat.com/solutions/32530 describe the procedure to shrink a LVM logical volume with ext4 filesystem on it.
answered May 21 at 10:52
NoNoNoNoNoNo
1,6171218
1,6171218
No I don't have access to red hat knowledge base as I am not working directly for the company that owns this server, if it's possible to include the procedure it will be appreciated.
– Gherbi Hicham
May 21 at 11:00
3
Giving an answer on serverfault that points to documentation only available to the happy few isn't useful.
– wurtel
May 21 at 11:05
RHEL server should be used only having a valid subscription for it. If you have a valid subscription, you have access to the RH Knowledge base and the link reported aboce
– NoNoNo
May 21 at 11:41
add a comment |
No I don't have access to red hat knowledge base as I am not working directly for the company that owns this server, if it's possible to include the procedure it will be appreciated.
– Gherbi Hicham
May 21 at 11:00
3
Giving an answer on serverfault that points to documentation only available to the happy few isn't useful.
– wurtel
May 21 at 11:05
RHEL server should be used only having a valid subscription for it. If you have a valid subscription, you have access to the RH Knowledge base and the link reported aboce
– NoNoNo
May 21 at 11:41
No I don't have access to red hat knowledge base as I am not working directly for the company that owns this server, if it's possible to include the procedure it will be appreciated.
– Gherbi Hicham
May 21 at 11:00
No I don't have access to red hat knowledge base as I am not working directly for the company that owns this server, if it's possible to include the procedure it will be appreciated.
– Gherbi Hicham
May 21 at 11:00
3
3
Giving an answer on serverfault that points to documentation only available to the happy few isn't useful.
– wurtel
May 21 at 11:05
Giving an answer on serverfault that points to documentation only available to the happy few isn't useful.
– wurtel
May 21 at 11:05
RHEL server should be used only having a valid subscription for it. If you have a valid subscription, you have access to the RH Knowledge base and the link reported aboce
– NoNoNo
May 21 at 11:41
RHEL server should be used only having a valid subscription for it. If you have a valid subscription, you have access to the RH Knowledge base and the link reported aboce
– NoNoNo
May 21 at 11:41
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f968205%2flvm-how-to-reduce-size-of-data-and-extend-home%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown