为XenServer挂载/增加第二块硬盘的方法

很多服务器都会多块盘或者做了Raid的多个虚拟磁盘,而安装xenserver后,他只会默认挂载第一快盘,也就是安装xenServer系统的那块。
 
那剩余的其他盘,怎么挂载上去做虚拟机的存储用呢?或者后期新增一块磁盘该如何操作呢?

1、用命令查看下自己的host-uuid

[root@xenserver-10 ~]# xe host-list
uuid ( RO)                : dca60990-98c3-4f10-b05d-aee9138778f7
          name-label ( RW): xenserver-8.239
    name-description ( RW): Default install

2、查看所有硬盘了的id

[root@xenserver-10 ~]# ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root 10 Oct 24 12:52 dm-name-VG_XenStorage--1d5302ea--598a--8acd--5be5--b67e3a142160-MGT -> ../../dm-0
lrwxrwxrwx 1 root root 10 Oct 24 12:52 dm-uuid-LVM-67dHwk1JS4179AxhDbOKqkOue2zwvABRX6ilOR9xT2sUseuVJUfBXa36HKrO726G -> ../../dm-0
lrwxrwxrwx 1 root root  9 Oct 24 12:51 scsi-364cd98f09abc4b002541c7e30460debf -> ../../sda
lrwxrwxrwx 1 root root 10 Oct 24 12:51 scsi-364cd98f09abc4b002541c7e30460debf-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 24 12:51 scsi-364cd98f09abc4b002541c7e30460debf-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 24 12:51 scsi-364cd98f09abc4b002541c7e30460debf-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Oct 24 12:51 scsi-364cd98f09abc4b002541c7e30460debf-part4 -> ../../sda4
lrwxrwxrwx 1 root root 10 Oct 24 12:51 scsi-364cd98f09abc4b002541c7e30460debf-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Oct 24 12:51 scsi-364cd98f09abc4b002541c7e30460debf-part6 -> ../../sda6
lrwxrwxrwx 1 root root  9 Feb  6 10:51 scsi-364cd98f09abc4b002541c7ef0511f4de -> ../../sdb
lrwxrwxrwx 1 root root  9 Oct 24 12:51 wwn-0x64cd98f09abc4b002541c7e30460debf -> ../../sda
lrwxrwxrwx 1 root root 10 Oct 24 12:51 wwn-0x64cd98f09abc4b002541c7e30460debf-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 24 12:51 wwn-0x64cd98f09abc4b002541c7e30460debf-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 24 12:51 wwn-0x64cd98f09abc4b002541c7e30460debf-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Oct 24 12:51 wwn-0x64cd98f09abc4b002541c7e30460debf-part4 -> ../../sda4
lrwxrwxrwx 1 root root 10 Oct 24 12:51 wwn-0x64cd98f09abc4b002541c7e30460debf-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Oct 24 12:51 wwn-0x64cd98f09abc4b002541c7e30460debf-part6 -> ../../sda6
lrwxrwxrwx 1 root root  9 Feb  6 10:51 wwn-0x64cd98f09abc4b002541c7ef0511f4de -> ../../sdb

3、查看需要挂载的分区

[root@xenserver-10 ~]# ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root  9 Oct 24 12:51 pci-0000:1a:00.0-scsi-0:2:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 Oct 24 12:51 pci-0000:1a:00.0-scsi-0:2:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 24 12:51 pci-0000:1a:00.0-scsi-0:2:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 24 12:51 pci-0000:1a:00.0-scsi-0:2:0:0-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Oct 24 12:51 pci-0000:1a:00.0-scsi-0:2:0:0-part4 -> ../../sda4
lrwxrwxrwx 1 root root 10 Oct 24 12:51 pci-0000:1a:00.0-scsi-0:2:0:0-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Oct 24 12:51 pci-0000:1a:00.0-scsi-0:2:0:0-part6 -> ../../sda6
lrwxrwxrwx 1 root root  9 Feb  6 10:51 pci-0000:1a:00.0-scsi-0:2:1:0 -> ../../sdb

4、挂载第2块硬盘到系统中,挂载成功会返回新存储的UUID

[root@xenserver-10 ~]# xe sr-create type=lvm content-type=user device-config:device=/dev/disk/by-path/pci-0000:1a:00.0-scsi-0:2:1:0 name-label="Disk 2"
40bf63b0-cb28-9a21-1395-99e3be77e353

 

发布了68 篇原创文章 · 获赞 18 · 访问量 5万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章