大网数据广告活动
服务器运维问答

Arch Linux - KVM - Sharing SSD and HDD between Arch and it's VMs

· 52CE 我爱测

I'm relatively new to linux and I'm trying to build an Arch linux that will have a gaming VM. I have 2 disks: a 500GB SSD and a 2TB HDD. I've settled on a LVM with a swapfile and extra space for snapshots. I don't intend to use t…

问题原文

原帖链接 · Matheus Simon · CC BY-SA 4.0

I'm relatively new to linux and I'm trying to build an Arch linux that will have a gaming VM. I have 2 disks: a 500GB SSD and a 2TB HDD. I've settled on a LVM with a swapfile and extra space for snapshots. I don't intend to use the base linux and only use VMs for both personal and business ends. I'm trying to figure out the best way to partition and organize the disks. In order to do that I have a few questions:

  1. Given the specifications, how would you go about doing that?
  2. Can I install Arch on the HDD but put the VMs on the SSD?
  3. Can I have the swapfile on the SSD but the system on the HDD?
  4. Can I have both the SSD and the HDD on the same volume group?

Ultimately I would like to know what's the most optimized way to do what I described.

已采纳解答

原帖链接 · Bob · CC BY-SA 4.0

Can I install Arch on the HDD but put the VMs on the SSD?

Yes.

Can I have the swapfile on the SSD but the system on the HDD?

Yes. Maybe a swap partition (or LVM) on the SSD rather than a swap file is easier to configure. But note that whichever disk you use for swap it will hurt your performance and you generally want to avoid heavy swapping...

Can I have both the SSD and the HDD on the same volume group?

Yes.

And you’ll still be able to manually assign either the SSD or HDD as the storage when creating a new logical volume by appending the disk/partition as an additional position parameter to your lvcreate command line

For instance

lvcreate -L 10G -n my_test_volume VolumeGroupName /dev/fast1 
    

Ultimately I would like to know what's the most optimized way to do what I described.

Maybe by using the SSD as a cache will give you the most benefit? See for instance: https://rwmj.wordpress.com/2014/05/22/using-lvms-new-cache-feature/

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-10-12)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。