from wiki
This commit is contained in:
parent
ea66226ce0
commit
341ad2fed2
1 changed files with 36 additions and 1 deletions
|
|
@ -1 +1,36 @@
|
|||
pages/AddDiskDrive.md
|
||||
# Creating an Nth disk drive for a VM
|
||||
|
||||
```
|
||||
fallocate -l 500G /store/images/ran.psg.com.sdb
|
||||
ls -lh /store/images/ran.psg.com.sdb
|
||||
chown libvirt-qemu:mlocate /store/images/ran.psg.com.sdb
|
||||
l -lh /store/images/ran.psg.com.sdb
|
||||
chmod 600 /store/images/ran.psg.com.sdb
|
||||
```
|
||||
|
||||
Create an xml file describing the disk
|
||||
|
||||
```
|
||||
cat > ran.sdb.xml
|
||||
<disk type='file' device='disk'>
|
||||
<driver name='qemu' type='raw' cache='none'/>
|
||||
<source file='/store/images/ran.psg.com.sdb'/>
|
||||
<target dev='vda'/>
|
||||
</disk>
|
||||
```
|
||||
|
||||
Attach the new store to the VM
|
||||
|
||||
```
|
||||
virsh attach-device ran.psg.com ran.sdb.xml
|
||||
```
|
||||
|
||||
You will have to reboot the VM to see the device.
|
||||
|
||||
Then you can
|
||||
|
||||
```
|
||||
mkfs.ext4 /dev/vda
|
||||
```
|
||||
|
||||
Edit /etc/fstab and mount the new volumey
|
||||
Loading…
Add table
Add a link
Reference in a new issue