先来查看下硬盘信息
[root@xenserver-DS-Monitor01 ~]# smartctl --all /dev/sda
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0+10] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: PLEXTOR PX-512M6S+
Serial Number: P02620100868
LU WWN Device Id: 5 002303 1009083c8
Add. Product Id: SC902040
Firmware Version: 1.00
User Capacity: 512,110,190,592 bytes [512 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ATA8-ACS, ATA/ATAPI-7 T13/1532D revision 4a
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Thu Aug 11 23:59:09 2016 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 10) seconds.
Offline data collection
capabilities: (0x15) SMART execute Offline immediate.
No Auto Offline data collection support.
Abort Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
No Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 10) minutes.
SCT capabilities: (0x003d) SCT Status supported.
SCT Error Recovery Con
[root@xenserver-DS-Monitor01 ~]# smartctl -A /dev/sda
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0+10] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 100 100 000 Pre-fail Always - 0
5 Reallocated_Sector_Ct 0x0003 100 100 000 Pre-fail Always - 0
9 Power_On_Hours 0x0002 100 100 000 Old_age Always - 0
12 Power_Cycle_Count 0x0003 100 100 000 Pre-fail Always - 12
170 Unknown_Attribute 0x0032 100 100 000 Old_age Always - 0
171 Unknown_Attribute 0x0003 100 100 000 Pre-fail Always - 0
172 Unknown_Attribute 0x0003 100 100 000 Pre-fail Always - 0
173 Unknown_Attribute 0x0003 100 100 000 Pre-fail Always - 0
174 Unknown_Attribute 0x0003 100 100 000 Pre-fail Always - 12
175 Program_Fail_Count_Chip 0x0003 100 100 000 Pre-fail Always - 0
176 Erase_Fail_Count_Chip 0x0003 100 100 000 Pre-fail Always - 0
177 Wear_Leveling_Count 0x0003 100 100 000 Pre-fail Always - 19
178 Used_Rsvd_Blk_Cnt_Chip 0x0003 100 100 000 Pre-fail Always - 0
179 Used_Rsvd_Blk_Cnt_Tot 0x0003 100 100 000 Pre-fail Always - 0
180 Unused_Rsvd_Blk_Cnt_Tot 0x0033 100 100 000 Pre-fail Always - 1184
181 Program_Fail_Cnt_Total 0x0003 100 100 000 Pre-fail Always - 0
182 Erase_Fail_Count_Total 0x0003 100 100 000 Pre-fail Always - 0
183 Runtime_Bad_Block 0x0032 100 100 000 Old_age Always - 0
184 End-to-End_Error 0x0033 100 100 000 Pre-fail Always - 0
187 Reported_Uncorrect 0x0003 100 100 000 Pre-fail Always - 0
188 Command_Timeout 0x0032 100 100 000 Old_age Always - 0
192 Power-Off_Retract_Count 0x0003 100 100 000 Pre-fail Always - 12
195 Hardware_ECC_Recovered 0x0003 100 100 000 Pre-fail Always - 0
196 Reallocated_Event_Count 0x0003 100 100 000 Pre-fail Always - 0
198 Offline_Uncorrectable 0x0003 100 100 000 Pre-fail Always - 0
199 UDMA_CRC_Error_Count 0x0003 100 100 000 Pre-fail Always - 0
232 Available_Reservd_Space 0x0003 100 100 010 Pre-fail Always - 0
233 Media_Wearout_Indicator 0x0003 100 100 000 Pre-fail Always - 6
241 Total_LBAs_Written 0x0003 100 100 000 Pre-fail Always - 102
242 Total_LBAs_Read 0x0003 100 100 000 Pre-fail Always - 34
[root@xenserver-DS-Monitor01 ~]#
再来看看分区信息
[root@xenserver-DS-Monitor01 ~]# sgdisk -p /dev/sda
Disk /dev/sda: 1000215216 sectors, 476.9 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): CC968B4B-6998-4270-9B25-917806F75F8E
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1000215182
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)
Number Start (sector) End (sector) Size Code Name
1 46139392 83888127 18.0 GiB 0700
2 8390656 46139391 18.0 GiB 0700
3 87033856 1000215182 435.4 GiB 8E00
4 83888128 84936703 512.0 MiB EF02
5 2048 8390655 4.0 GiB 0700
6 84936704 87033855 1024.0 MiB 8200
[root@xenserver-DS-Monitor01 ~]#
经过上面的查询可以得知,/dev/sda3是数据盘,因为分区给的空间最大,那么就来上/dev/sda3来生效做本地存储
[root@xenserver-DS-Monitor01 ~]# xe host-list
uuid ( RO) : de645a59-46ac-47db-83fa-3e91fb50b8b6
name-label ( RW): xenserver-DS-Monitor01
name-description ( RW): Default install
[root@xenserver-DS-Monitor01 ~]# xe sr-create content-type=user device-config:device=/dev/sda3 host-uuid=de645a59-46ac-47db-83fa-3e91fb50b8b6 name-label="Local storage" shared=false type=lvm
3f1ca7d9-9783-dffd-433f-d1d5906e7dcb
[root@xenserver-DS-Monitor01 ~]# xe sr-list name-label="Local storage"
uuid ( RO) : 3f1ca7d9-9783-dffd-433f-d1d5906e7dcb
name-label ( RW): Local storage
name-description ( RW):
host ( RO): xenserver-DS-Monitor01
type ( RO): lvm
content-type ( RO): user
[root@xenserver-DS-Monitor01 ~]#