Can I divide part of the /dev/sda/home?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have a CentOS7.2 server, and when I install the system, I did not take notice of the disk, now I have a big /dev/centos/home
:
[root@controller dev]# lvdisplay
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID WofWvD-KQEG-hyaf-TSvf-bLxW-d6Gh-onWriz
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2017-08-30 12:40:47 +0800
LV Status available
# open 2
LV Size 7.88 GiB
Current LE 2016
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
--- Logical volume ---
LV Path /dev/centos/home
LV Name home
VG Name centos
LV UUID gZlLHM-bWuj-8lXu-8ete-VpZI-zz1w-3AC5rP
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2017-08-30 12:40:47 +0800
LV Status available
# open 1
LV Size 873.08 GiB
Current LE 223509
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID PKqlOW-SIa8-df24-AVbl-BZMG-n0dn-89kjB3
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2017-08-30 12:40:51 +0800
LV Status available
# open 1
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
Now, I want to divide the /dev/centos/home
, isolate part of it to be a VG, so I can use it as other usage. Such as use it to pvcreate
.
I don't know whether I can divide the /dev/centos/home
, because I scare loss data, or break the operate system. But I really need a VG from there to pvcreate
, or if there is a other method to do that.
centos lvm
add a comment |Â
up vote
1
down vote
favorite
I have a CentOS7.2 server, and when I install the system, I did not take notice of the disk, now I have a big /dev/centos/home
:
[root@controller dev]# lvdisplay
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID WofWvD-KQEG-hyaf-TSvf-bLxW-d6Gh-onWriz
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2017-08-30 12:40:47 +0800
LV Status available
# open 2
LV Size 7.88 GiB
Current LE 2016
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
--- Logical volume ---
LV Path /dev/centos/home
LV Name home
VG Name centos
LV UUID gZlLHM-bWuj-8lXu-8ete-VpZI-zz1w-3AC5rP
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2017-08-30 12:40:47 +0800
LV Status available
# open 1
LV Size 873.08 GiB
Current LE 223509
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID PKqlOW-SIa8-df24-AVbl-BZMG-n0dn-89kjB3
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2017-08-30 12:40:51 +0800
LV Status available
# open 1
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
Now, I want to divide the /dev/centos/home
, isolate part of it to be a VG, so I can use it as other usage. Such as use it to pvcreate
.
I don't know whether I can divide the /dev/centos/home
, because I scare loss data, or break the operate system. But I really need a VG from there to pvcreate
, or if there is a other method to do that.
centos lvm
What filesystem is in place (XFS/Ext4/different?).
â Jaroslav Kucera
Oct 16 '17 at 8:28
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a CentOS7.2 server, and when I install the system, I did not take notice of the disk, now I have a big /dev/centos/home
:
[root@controller dev]# lvdisplay
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID WofWvD-KQEG-hyaf-TSvf-bLxW-d6Gh-onWriz
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2017-08-30 12:40:47 +0800
LV Status available
# open 2
LV Size 7.88 GiB
Current LE 2016
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
--- Logical volume ---
LV Path /dev/centos/home
LV Name home
VG Name centos
LV UUID gZlLHM-bWuj-8lXu-8ete-VpZI-zz1w-3AC5rP
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2017-08-30 12:40:47 +0800
LV Status available
# open 1
LV Size 873.08 GiB
Current LE 223509
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID PKqlOW-SIa8-df24-AVbl-BZMG-n0dn-89kjB3
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2017-08-30 12:40:51 +0800
LV Status available
# open 1
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
Now, I want to divide the /dev/centos/home
, isolate part of it to be a VG, so I can use it as other usage. Such as use it to pvcreate
.
I don't know whether I can divide the /dev/centos/home
, because I scare loss data, or break the operate system. But I really need a VG from there to pvcreate
, or if there is a other method to do that.
centos lvm
I have a CentOS7.2 server, and when I install the system, I did not take notice of the disk, now I have a big /dev/centos/home
:
[root@controller dev]# lvdisplay
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID WofWvD-KQEG-hyaf-TSvf-bLxW-d6Gh-onWriz
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2017-08-30 12:40:47 +0800
LV Status available
# open 2
LV Size 7.88 GiB
Current LE 2016
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
--- Logical volume ---
LV Path /dev/centos/home
LV Name home
VG Name centos
LV UUID gZlLHM-bWuj-8lXu-8ete-VpZI-zz1w-3AC5rP
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2017-08-30 12:40:47 +0800
LV Status available
# open 1
LV Size 873.08 GiB
Current LE 223509
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID PKqlOW-SIa8-df24-AVbl-BZMG-n0dn-89kjB3
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2017-08-30 12:40:51 +0800
LV Status available
# open 1
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
Now, I want to divide the /dev/centos/home
, isolate part of it to be a VG, so I can use it as other usage. Such as use it to pvcreate
.
I don't know whether I can divide the /dev/centos/home
, because I scare loss data, or break the operate system. But I really need a VG from there to pvcreate
, or if there is a other method to do that.
centos lvm
asked Oct 16 '17 at 4:24
244boy
1203
1203
What filesystem is in place (XFS/Ext4/different?).
â Jaroslav Kucera
Oct 16 '17 at 8:28
add a comment |Â
What filesystem is in place (XFS/Ext4/different?).
â Jaroslav Kucera
Oct 16 '17 at 8:28
What filesystem is in place (XFS/Ext4/different?).
â Jaroslav Kucera
Oct 16 '17 at 8:28
What filesystem is in place (XFS/Ext4/different?).
â Jaroslav Kucera
Oct 16 '17 at 8:28
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
Close all programs that use this volume. In the system must be only the root user (safest way might be to comment out /home
in /etc/fstab
, then have a reboot, log as root as Archemar has mentioned below. See more in comments)
First you need to unmount partition:
umount /dev/centos/home
Then check filesystem (if you skip this step the there may be data loss):
e2fsck -fy /dev/centos/home
Resize partition:
resize2fs /dev/centos/home 50G
where 50g
is desired size after shrinking. This size must be greather then used space on partition (see output of df -h
and set up size a bit more of used space ).
Reduce logical partition:
lvreduce -L 51G /dev/centos/home
pay attention: partition size with lvreduce
more than with resize2fs
.
Run resize2fs
again (to use remaining of ~1G space):
resize2fs /dev/centos/home
Mount volume:
mount -a
You need to backup all data before this changes!
close all programs that use this volume
, what do you mean of it? I don't know what processes on this/dev/centos/home
, how to close?
â 244boy
Oct 16 '17 at 7:47
@244boy, it's just a caution. Useps -aux
to list all running proccesses and in the last column you'll see where proccess are placed. Also uselsof
to see what files are in used currently. If you do not installed some unstandard software earlier you do not need to care about it
â Egor Vasilyev
Oct 16 '17 at 8:00
@EgorVasilyev safest way might be to comment out/home
in/etc/fstab
, then have a reboot, log as root (or alternative sodu-able user having$HOME
in a temporary directory), and proceed as you instruct.
â Archemar
Oct 16 '17 at 8:55
alos note that OP want to create a new PG, your method will allow new LV.
â Archemar
Oct 16 '17 at 8:57
@Archemar, I supplemented my answer with your recommendations
â Egor Vasilyev
Oct 16 '17 at 10:44
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Close all programs that use this volume. In the system must be only the root user (safest way might be to comment out /home
in /etc/fstab
, then have a reboot, log as root as Archemar has mentioned below. See more in comments)
First you need to unmount partition:
umount /dev/centos/home
Then check filesystem (if you skip this step the there may be data loss):
e2fsck -fy /dev/centos/home
Resize partition:
resize2fs /dev/centos/home 50G
where 50g
is desired size after shrinking. This size must be greather then used space on partition (see output of df -h
and set up size a bit more of used space ).
Reduce logical partition:
lvreduce -L 51G /dev/centos/home
pay attention: partition size with lvreduce
more than with resize2fs
.
Run resize2fs
again (to use remaining of ~1G space):
resize2fs /dev/centos/home
Mount volume:
mount -a
You need to backup all data before this changes!
close all programs that use this volume
, what do you mean of it? I don't know what processes on this/dev/centos/home
, how to close?
â 244boy
Oct 16 '17 at 7:47
@244boy, it's just a caution. Useps -aux
to list all running proccesses and in the last column you'll see where proccess are placed. Also uselsof
to see what files are in used currently. If you do not installed some unstandard software earlier you do not need to care about it
â Egor Vasilyev
Oct 16 '17 at 8:00
@EgorVasilyev safest way might be to comment out/home
in/etc/fstab
, then have a reboot, log as root (or alternative sodu-able user having$HOME
in a temporary directory), and proceed as you instruct.
â Archemar
Oct 16 '17 at 8:55
alos note that OP want to create a new PG, your method will allow new LV.
â Archemar
Oct 16 '17 at 8:57
@Archemar, I supplemented my answer with your recommendations
â Egor Vasilyev
Oct 16 '17 at 10:44
add a comment |Â
up vote
2
down vote
accepted
Close all programs that use this volume. In the system must be only the root user (safest way might be to comment out /home
in /etc/fstab
, then have a reboot, log as root as Archemar has mentioned below. See more in comments)
First you need to unmount partition:
umount /dev/centos/home
Then check filesystem (if you skip this step the there may be data loss):
e2fsck -fy /dev/centos/home
Resize partition:
resize2fs /dev/centos/home 50G
where 50g
is desired size after shrinking. This size must be greather then used space on partition (see output of df -h
and set up size a bit more of used space ).
Reduce logical partition:
lvreduce -L 51G /dev/centos/home
pay attention: partition size with lvreduce
more than with resize2fs
.
Run resize2fs
again (to use remaining of ~1G space):
resize2fs /dev/centos/home
Mount volume:
mount -a
You need to backup all data before this changes!
close all programs that use this volume
, what do you mean of it? I don't know what processes on this/dev/centos/home
, how to close?
â 244boy
Oct 16 '17 at 7:47
@244boy, it's just a caution. Useps -aux
to list all running proccesses and in the last column you'll see where proccess are placed. Also uselsof
to see what files are in used currently. If you do not installed some unstandard software earlier you do not need to care about it
â Egor Vasilyev
Oct 16 '17 at 8:00
@EgorVasilyev safest way might be to comment out/home
in/etc/fstab
, then have a reboot, log as root (or alternative sodu-able user having$HOME
in a temporary directory), and proceed as you instruct.
â Archemar
Oct 16 '17 at 8:55
alos note that OP want to create a new PG, your method will allow new LV.
â Archemar
Oct 16 '17 at 8:57
@Archemar, I supplemented my answer with your recommendations
â Egor Vasilyev
Oct 16 '17 at 10:44
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Close all programs that use this volume. In the system must be only the root user (safest way might be to comment out /home
in /etc/fstab
, then have a reboot, log as root as Archemar has mentioned below. See more in comments)
First you need to unmount partition:
umount /dev/centos/home
Then check filesystem (if you skip this step the there may be data loss):
e2fsck -fy /dev/centos/home
Resize partition:
resize2fs /dev/centos/home 50G
where 50g
is desired size after shrinking. This size must be greather then used space on partition (see output of df -h
and set up size a bit more of used space ).
Reduce logical partition:
lvreduce -L 51G /dev/centos/home
pay attention: partition size with lvreduce
more than with resize2fs
.
Run resize2fs
again (to use remaining of ~1G space):
resize2fs /dev/centos/home
Mount volume:
mount -a
You need to backup all data before this changes!
Close all programs that use this volume. In the system must be only the root user (safest way might be to comment out /home
in /etc/fstab
, then have a reboot, log as root as Archemar has mentioned below. See more in comments)
First you need to unmount partition:
umount /dev/centos/home
Then check filesystem (if you skip this step the there may be data loss):
e2fsck -fy /dev/centos/home
Resize partition:
resize2fs /dev/centos/home 50G
where 50g
is desired size after shrinking. This size must be greather then used space on partition (see output of df -h
and set up size a bit more of used space ).
Reduce logical partition:
lvreduce -L 51G /dev/centos/home
pay attention: partition size with lvreduce
more than with resize2fs
.
Run resize2fs
again (to use remaining of ~1G space):
resize2fs /dev/centos/home
Mount volume:
mount -a
You need to backup all data before this changes!
edited Oct 16 '17 at 9:09
answered Oct 16 '17 at 6:53
Egor Vasilyev
1,792129
1,792129
close all programs that use this volume
, what do you mean of it? I don't know what processes on this/dev/centos/home
, how to close?
â 244boy
Oct 16 '17 at 7:47
@244boy, it's just a caution. Useps -aux
to list all running proccesses and in the last column you'll see where proccess are placed. Also uselsof
to see what files are in used currently. If you do not installed some unstandard software earlier you do not need to care about it
â Egor Vasilyev
Oct 16 '17 at 8:00
@EgorVasilyev safest way might be to comment out/home
in/etc/fstab
, then have a reboot, log as root (or alternative sodu-able user having$HOME
in a temporary directory), and proceed as you instruct.
â Archemar
Oct 16 '17 at 8:55
alos note that OP want to create a new PG, your method will allow new LV.
â Archemar
Oct 16 '17 at 8:57
@Archemar, I supplemented my answer with your recommendations
â Egor Vasilyev
Oct 16 '17 at 10:44
add a comment |Â
close all programs that use this volume
, what do you mean of it? I don't know what processes on this/dev/centos/home
, how to close?
â 244boy
Oct 16 '17 at 7:47
@244boy, it's just a caution. Useps -aux
to list all running proccesses and in the last column you'll see where proccess are placed. Also uselsof
to see what files are in used currently. If you do not installed some unstandard software earlier you do not need to care about it
â Egor Vasilyev
Oct 16 '17 at 8:00
@EgorVasilyev safest way might be to comment out/home
in/etc/fstab
, then have a reboot, log as root (or alternative sodu-able user having$HOME
in a temporary directory), and proceed as you instruct.
â Archemar
Oct 16 '17 at 8:55
alos note that OP want to create a new PG, your method will allow new LV.
â Archemar
Oct 16 '17 at 8:57
@Archemar, I supplemented my answer with your recommendations
â Egor Vasilyev
Oct 16 '17 at 10:44
close all programs that use this volume
, what do you mean of it? I don't know what processes on this /dev/centos/home
, how to close?â 244boy
Oct 16 '17 at 7:47
close all programs that use this volume
, what do you mean of it? I don't know what processes on this /dev/centos/home
, how to close?â 244boy
Oct 16 '17 at 7:47
@244boy, it's just a caution. Use
ps -aux
to list all running proccesses and in the last column you'll see where proccess are placed. Also use lsof
to see what files are in used currently. If you do not installed some unstandard software earlier you do not need to care about itâ Egor Vasilyev
Oct 16 '17 at 8:00
@244boy, it's just a caution. Use
ps -aux
to list all running proccesses and in the last column you'll see where proccess are placed. Also use lsof
to see what files are in used currently. If you do not installed some unstandard software earlier you do not need to care about itâ Egor Vasilyev
Oct 16 '17 at 8:00
@EgorVasilyev safest way might be to comment out
/home
in /etc/fstab
, then have a reboot, log as root (or alternative sodu-able user having $HOME
in a temporary directory), and proceed as you instruct.â Archemar
Oct 16 '17 at 8:55
@EgorVasilyev safest way might be to comment out
/home
in /etc/fstab
, then have a reboot, log as root (or alternative sodu-able user having $HOME
in a temporary directory), and proceed as you instruct.â Archemar
Oct 16 '17 at 8:55
alos note that OP want to create a new PG, your method will allow new LV.
â Archemar
Oct 16 '17 at 8:57
alos note that OP want to create a new PG, your method will allow new LV.
â Archemar
Oct 16 '17 at 8:57
@Archemar, I supplemented my answer with your recommendations
â Egor Vasilyev
Oct 16 '17 at 10:44
@Archemar, I supplemented my answer with your recommendations
â Egor Vasilyev
Oct 16 '17 at 10:44
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f398326%2fcan-i-divide-part-of-the-dev-sda-home%23new-answer', 'question_page');
);
Post as a guest
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
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
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
What filesystem is in place (XFS/Ext4/different?).
â Jaroslav Kucera
Oct 16 '17 at 8:28