linux + how to convert VMDK disk to LVM disk
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
we have linux machine
with sdb disk
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 150G 0 disk
âÂÂâÂÂsda1 8:1 0 500M 0 part /boot
âÂÂâÂÂsda2 8:2 0 149.5G 0 part
âÂÂâÂÂlp55-lv_root 253:0 0 40G 0 lvm /
âÂÂâÂÂlp55-lv_swap 253:1 0 7.7G 0 lvm [SWAP]
âÂÂâÂÂlp55-lv_var 253:2 0 100.9G 0 lvm /var
sdb 8:16 0 100G 0 disk
for now sdb isnt LVM
we want to create the sdb to LVM with new VG group as new1
so we can increase the sdb as we want later
what is the procedure to convert sdb to LVM
# pvs
# lvdisplay
No volume groups found
# pvdisplay
# vgdisplay
No volume groups found
#
rpm -qa | grep -i lvm
lvm2-2.02.100-8.el6.x86_64
lvm2-libs-2.02.100-8.el6.x86_64
linux rhel lvm vmware
add a comment |Â
up vote
1
down vote
favorite
we have linux machine
with sdb disk
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 150G 0 disk
âÂÂâÂÂsda1 8:1 0 500M 0 part /boot
âÂÂâÂÂsda2 8:2 0 149.5G 0 part
âÂÂâÂÂlp55-lv_root 253:0 0 40G 0 lvm /
âÂÂâÂÂlp55-lv_swap 253:1 0 7.7G 0 lvm [SWAP]
âÂÂâÂÂlp55-lv_var 253:2 0 100.9G 0 lvm /var
sdb 8:16 0 100G 0 disk
for now sdb isnt LVM
we want to create the sdb to LVM with new VG group as new1
so we can increase the sdb as we want later
what is the procedure to convert sdb to LVM
# pvs
# lvdisplay
No volume groups found
# pvdisplay
# vgdisplay
No volume groups found
#
rpm -qa | grep -i lvm
lvm2-2.02.100-8.el6.x86_64
lvm2-libs-2.02.100-8.el6.x86_64
linux rhel lvm vmware
Do you need to save any data onsdb
or can it be wiped?
â Stephen Harris
7 hours ago
wiped - like a new disk
â yael
7 hours ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
we have linux machine
with sdb disk
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 150G 0 disk
âÂÂâÂÂsda1 8:1 0 500M 0 part /boot
âÂÂâÂÂsda2 8:2 0 149.5G 0 part
âÂÂâÂÂlp55-lv_root 253:0 0 40G 0 lvm /
âÂÂâÂÂlp55-lv_swap 253:1 0 7.7G 0 lvm [SWAP]
âÂÂâÂÂlp55-lv_var 253:2 0 100.9G 0 lvm /var
sdb 8:16 0 100G 0 disk
for now sdb isnt LVM
we want to create the sdb to LVM with new VG group as new1
so we can increase the sdb as we want later
what is the procedure to convert sdb to LVM
# pvs
# lvdisplay
No volume groups found
# pvdisplay
# vgdisplay
No volume groups found
#
rpm -qa | grep -i lvm
lvm2-2.02.100-8.el6.x86_64
lvm2-libs-2.02.100-8.el6.x86_64
linux rhel lvm vmware
we have linux machine
with sdb disk
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 150G 0 disk
âÂÂâÂÂsda1 8:1 0 500M 0 part /boot
âÂÂâÂÂsda2 8:2 0 149.5G 0 part
âÂÂâÂÂlp55-lv_root 253:0 0 40G 0 lvm /
âÂÂâÂÂlp55-lv_swap 253:1 0 7.7G 0 lvm [SWAP]
âÂÂâÂÂlp55-lv_var 253:2 0 100.9G 0 lvm /var
sdb 8:16 0 100G 0 disk
for now sdb isnt LVM
we want to create the sdb to LVM with new VG group as new1
so we can increase the sdb as we want later
what is the procedure to convert sdb to LVM
# pvs
# lvdisplay
No volume groups found
# pvdisplay
# vgdisplay
No volume groups found
#
rpm -qa | grep -i lvm
lvm2-2.02.100-8.el6.x86_64
lvm2-libs-2.02.100-8.el6.x86_64
linux rhel lvm vmware
linux rhel lvm vmware
edited 7 hours ago
asked 7 hours ago
yael
2,1851650
2,1851650
Do you need to save any data onsdb
or can it be wiped?
â Stephen Harris
7 hours ago
wiped - like a new disk
â yael
7 hours ago
add a comment |Â
Do you need to save any data onsdb
or can it be wiped?
â Stephen Harris
7 hours ago
wiped - like a new disk
â yael
7 hours ago
Do you need to save any data on
sdb
or can it be wiped?â Stephen Harris
7 hours ago
Do you need to save any data on
sdb
or can it be wiped?â Stephen Harris
7 hours ago
wiped - like a new disk
â yael
7 hours ago
wiped - like a new disk
â yael
7 hours ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
accepted
You could partition the /dev/sdb
to make it recognizable to other operating systems that the disk is in use, but that will make extending the disk more complicated in the future, and since it's a VMDK its name on the virtualization host should make its purpose obvious anyway. So I'd recommend omitting the partitioning in this case, and just using the whole virtual disk for the LVM. So:
pvcreate /dev/sdb
Then you could just extend your existing VG with the new PV (with vgextend lp55 /dev/sdb
), but as you said you want to create a new VG, so:
vgcreate new1 /dev/sdb
At this point, the new VG is created but has no LVs allocated. If you want to use all the available capacity into a single LV/filesystem, then you could do this:
lvcreate -n lv_name -l 100%FREE new1
If you want to create a LV of some specific size, you can use -L nnnG
to specify the size in GiB instead of -l 100%FREE
.
(You probably should replace lv_name
with something that describes the intended use of the LV.)
After the LV is created, you are free to use it as you wish. You may put a filesystem (of whatever type) onto it and mount it, or use it as a raw storage for a database engine, or whatever you want to do with it.
For example, to create an ext4 filesystem on it:
mkfs.ext4 /dev/new1/lv_name
Then, create a mountpoint wherever is appropriate to you:
mkdir /some/where
Create an entry in /etc/fstab
:
/dev/new1/lv_name /some/where ext4 defaults 0 2
And mount it:
mount /some/where
and you're done.
what about ext4 filesystem
â yael
7 hours ago
can we use - mkfs.xfs /dev/new1/lv_name ( insted mkfs.ext4 ) ?
â yael
5 hours ago
add a comment |Â
up vote
1
down vote
Since you don't need to save any data you can following the standard process:
pvcreate /dev/sdb
vgcreate new1 /dev/sdb
And now you can lvcreate
volumes on that VG
lvcreate -L10G -n testvol1 new1
If you increase the size of sdb
afterwards, you can use the pvresize
to make the new space available.
what about ext4 filesystem
â yael
7 hours ago
Once you've created the LV, you canmke2fs
on it, same as any other partition or volume (egmke2fs -t ext4 /dev/new1/testvol1
)
â Stephen Harris
6 hours ago
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
You could partition the /dev/sdb
to make it recognizable to other operating systems that the disk is in use, but that will make extending the disk more complicated in the future, and since it's a VMDK its name on the virtualization host should make its purpose obvious anyway. So I'd recommend omitting the partitioning in this case, and just using the whole virtual disk for the LVM. So:
pvcreate /dev/sdb
Then you could just extend your existing VG with the new PV (with vgextend lp55 /dev/sdb
), but as you said you want to create a new VG, so:
vgcreate new1 /dev/sdb
At this point, the new VG is created but has no LVs allocated. If you want to use all the available capacity into a single LV/filesystem, then you could do this:
lvcreate -n lv_name -l 100%FREE new1
If you want to create a LV of some specific size, you can use -L nnnG
to specify the size in GiB instead of -l 100%FREE
.
(You probably should replace lv_name
with something that describes the intended use of the LV.)
After the LV is created, you are free to use it as you wish. You may put a filesystem (of whatever type) onto it and mount it, or use it as a raw storage for a database engine, or whatever you want to do with it.
For example, to create an ext4 filesystem on it:
mkfs.ext4 /dev/new1/lv_name
Then, create a mountpoint wherever is appropriate to you:
mkdir /some/where
Create an entry in /etc/fstab
:
/dev/new1/lv_name /some/where ext4 defaults 0 2
And mount it:
mount /some/where
and you're done.
what about ext4 filesystem
â yael
7 hours ago
can we use - mkfs.xfs /dev/new1/lv_name ( insted mkfs.ext4 ) ?
â yael
5 hours ago
add a comment |Â
up vote
3
down vote
accepted
You could partition the /dev/sdb
to make it recognizable to other operating systems that the disk is in use, but that will make extending the disk more complicated in the future, and since it's a VMDK its name on the virtualization host should make its purpose obvious anyway. So I'd recommend omitting the partitioning in this case, and just using the whole virtual disk for the LVM. So:
pvcreate /dev/sdb
Then you could just extend your existing VG with the new PV (with vgextend lp55 /dev/sdb
), but as you said you want to create a new VG, so:
vgcreate new1 /dev/sdb
At this point, the new VG is created but has no LVs allocated. If you want to use all the available capacity into a single LV/filesystem, then you could do this:
lvcreate -n lv_name -l 100%FREE new1
If you want to create a LV of some specific size, you can use -L nnnG
to specify the size in GiB instead of -l 100%FREE
.
(You probably should replace lv_name
with something that describes the intended use of the LV.)
After the LV is created, you are free to use it as you wish. You may put a filesystem (of whatever type) onto it and mount it, or use it as a raw storage for a database engine, or whatever you want to do with it.
For example, to create an ext4 filesystem on it:
mkfs.ext4 /dev/new1/lv_name
Then, create a mountpoint wherever is appropriate to you:
mkdir /some/where
Create an entry in /etc/fstab
:
/dev/new1/lv_name /some/where ext4 defaults 0 2
And mount it:
mount /some/where
and you're done.
what about ext4 filesystem
â yael
7 hours ago
can we use - mkfs.xfs /dev/new1/lv_name ( insted mkfs.ext4 ) ?
â yael
5 hours ago
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
You could partition the /dev/sdb
to make it recognizable to other operating systems that the disk is in use, but that will make extending the disk more complicated in the future, and since it's a VMDK its name on the virtualization host should make its purpose obvious anyway. So I'd recommend omitting the partitioning in this case, and just using the whole virtual disk for the LVM. So:
pvcreate /dev/sdb
Then you could just extend your existing VG with the new PV (with vgextend lp55 /dev/sdb
), but as you said you want to create a new VG, so:
vgcreate new1 /dev/sdb
At this point, the new VG is created but has no LVs allocated. If you want to use all the available capacity into a single LV/filesystem, then you could do this:
lvcreate -n lv_name -l 100%FREE new1
If you want to create a LV of some specific size, you can use -L nnnG
to specify the size in GiB instead of -l 100%FREE
.
(You probably should replace lv_name
with something that describes the intended use of the LV.)
After the LV is created, you are free to use it as you wish. You may put a filesystem (of whatever type) onto it and mount it, or use it as a raw storage for a database engine, or whatever you want to do with it.
For example, to create an ext4 filesystem on it:
mkfs.ext4 /dev/new1/lv_name
Then, create a mountpoint wherever is appropriate to you:
mkdir /some/where
Create an entry in /etc/fstab
:
/dev/new1/lv_name /some/where ext4 defaults 0 2
And mount it:
mount /some/where
and you're done.
You could partition the /dev/sdb
to make it recognizable to other operating systems that the disk is in use, but that will make extending the disk more complicated in the future, and since it's a VMDK its name on the virtualization host should make its purpose obvious anyway. So I'd recommend omitting the partitioning in this case, and just using the whole virtual disk for the LVM. So:
pvcreate /dev/sdb
Then you could just extend your existing VG with the new PV (with vgextend lp55 /dev/sdb
), but as you said you want to create a new VG, so:
vgcreate new1 /dev/sdb
At this point, the new VG is created but has no LVs allocated. If you want to use all the available capacity into a single LV/filesystem, then you could do this:
lvcreate -n lv_name -l 100%FREE new1
If you want to create a LV of some specific size, you can use -L nnnG
to specify the size in GiB instead of -l 100%FREE
.
(You probably should replace lv_name
with something that describes the intended use of the LV.)
After the LV is created, you are free to use it as you wish. You may put a filesystem (of whatever type) onto it and mount it, or use it as a raw storage for a database engine, or whatever you want to do with it.
For example, to create an ext4 filesystem on it:
mkfs.ext4 /dev/new1/lv_name
Then, create a mountpoint wherever is appropriate to you:
mkdir /some/where
Create an entry in /etc/fstab
:
/dev/new1/lv_name /some/where ext4 defaults 0 2
And mount it:
mount /some/where
and you're done.
edited 6 hours ago
answered 7 hours ago
telcoM
13.8k11842
13.8k11842
what about ext4 filesystem
â yael
7 hours ago
can we use - mkfs.xfs /dev/new1/lv_name ( insted mkfs.ext4 ) ?
â yael
5 hours ago
add a comment |Â
what about ext4 filesystem
â yael
7 hours ago
can we use - mkfs.xfs /dev/new1/lv_name ( insted mkfs.ext4 ) ?
â yael
5 hours ago
what about ext4 filesystem
â yael
7 hours ago
what about ext4 filesystem
â yael
7 hours ago
can we use - mkfs.xfs /dev/new1/lv_name ( insted mkfs.ext4 ) ?
â yael
5 hours ago
can we use - mkfs.xfs /dev/new1/lv_name ( insted mkfs.ext4 ) ?
â yael
5 hours ago
add a comment |Â
up vote
1
down vote
Since you don't need to save any data you can following the standard process:
pvcreate /dev/sdb
vgcreate new1 /dev/sdb
And now you can lvcreate
volumes on that VG
lvcreate -L10G -n testvol1 new1
If you increase the size of sdb
afterwards, you can use the pvresize
to make the new space available.
what about ext4 filesystem
â yael
7 hours ago
Once you've created the LV, you canmke2fs
on it, same as any other partition or volume (egmke2fs -t ext4 /dev/new1/testvol1
)
â Stephen Harris
6 hours ago
add a comment |Â
up vote
1
down vote
Since you don't need to save any data you can following the standard process:
pvcreate /dev/sdb
vgcreate new1 /dev/sdb
And now you can lvcreate
volumes on that VG
lvcreate -L10G -n testvol1 new1
If you increase the size of sdb
afterwards, you can use the pvresize
to make the new space available.
what about ext4 filesystem
â yael
7 hours ago
Once you've created the LV, you canmke2fs
on it, same as any other partition or volume (egmke2fs -t ext4 /dev/new1/testvol1
)
â Stephen Harris
6 hours ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Since you don't need to save any data you can following the standard process:
pvcreate /dev/sdb
vgcreate new1 /dev/sdb
And now you can lvcreate
volumes on that VG
lvcreate -L10G -n testvol1 new1
If you increase the size of sdb
afterwards, you can use the pvresize
to make the new space available.
Since you don't need to save any data you can following the standard process:
pvcreate /dev/sdb
vgcreate new1 /dev/sdb
And now you can lvcreate
volumes on that VG
lvcreate -L10G -n testvol1 new1
If you increase the size of sdb
afterwards, you can use the pvresize
to make the new space available.
answered 7 hours ago
Stephen Harris
22.6k24076
22.6k24076
what about ext4 filesystem
â yael
7 hours ago
Once you've created the LV, you canmke2fs
on it, same as any other partition or volume (egmke2fs -t ext4 /dev/new1/testvol1
)
â Stephen Harris
6 hours ago
add a comment |Â
what about ext4 filesystem
â yael
7 hours ago
Once you've created the LV, you canmke2fs
on it, same as any other partition or volume (egmke2fs -t ext4 /dev/new1/testvol1
)
â Stephen Harris
6 hours ago
what about ext4 filesystem
â yael
7 hours ago
what about ext4 filesystem
â yael
7 hours ago
Once you've created the LV, you can
mke2fs
on it, same as any other partition or volume (eg mke2fs -t ext4 /dev/new1/testvol1
)â Stephen Harris
6 hours ago
Once you've created the LV, you can
mke2fs
on it, same as any other partition or volume (eg mke2fs -t ext4 /dev/new1/testvol1
)â Stephen Harris
6 hours ago
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%2f479741%2flinux-how-to-convert-vmdk-disk-to-lvm-disk%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
Do you need to save any data on
sdb
or can it be wiped?â Stephen Harris
7 hours ago
wiped - like a new disk
â yael
7 hours ago