Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
LVM partition as kvm guest disk: How to format?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Tue Apr 05, 2016 4:31 am    Post subject: LVM partition as kvm guest disk: How to format? Reply with quote

Hi,

I have an lvm volume /dev/hddvg1/guest1_vda which will be used as a kvm guest disk. Meaning it has partitions made by gdisk.

I can't figure out how to format /dev/hddvg1/guest1_vda1 and _vda2 from the host. The host does not see individual partitions created on the LVM "disk."

Can anyone give a hint? All I get from google is how to format an lvm as a partition, not as a disk.

Thanks.
Back to top
View user's profile Send private message
irafiral
n00b
n00b


Joined: 31 Jan 2005
Posts: 29
Location: Germany

PostPosted: Tue Apr 05, 2016 8:01 am    Post subject: Reply with quote

I have never done this, but I guess you can use a loop device.

losetup -f --show /dev/hddvg1/guest1_vda

mkfs /dev/loop???
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2970
Location: Germany

PostPosted: Tue Apr 05, 2016 11:13 am    Post subject: Reply with quote

You could use `losetup --find --show --partscan` or `kpartx` (multipath-tools) to make partitions available to the host.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2549

PostPosted: Tue Apr 05, 2016 3:45 pm    Post subject: Reply with quote

Did all that from both of you, and it worked.

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum