Feature #1347
openFeature #1344: Hardware/Inventarisierung: Masterplan
Festplattenpartitionierung als JSON
Added by Simon Rettberg about 4 years ago. Updated almost 3 years ago.
90%
Description
Gleiches gilt für Platten. Wie definiert man eine echte Platte, wie erkennt man die, wie liest man die Partitionierung aus?
(Nein "/dev/sd*" ist leider falsch!)
Reicht der Output von sfdisk oder sgdisk, kann man den gut in JSON umwandeln?
Updated by Jannik Schönartz about 4 years ago
Also mit sfdisk --json kann man sich die Partitionstabelle direkt als JSON ausgeben. (zeft9003)
$ sfdisk --json /dev/nvme0n1
{
"partitiontable": {
"label": "gpt",
"id": "FE386A51-70EB-4886-977F-8AC98D6CD70F",
"device": "/dev/nvme0n1",
"unit": "sectors",
"firstlba": 34,
"lastlba": 500118158,
"partitions": [
{"node": "/dev/nvme0n1p1", "start": 2048, "size": 2099200, "type": "C12A7328-F81F-11D2-BA4B-00A0C93EC93B", "uuid": "28DB187C-07A3-4287-ABEF-595C262284F8", "n
ame": "COB", "attrs": "RequiredPartition GUID:63"},
{"node": "/dev/nvme0n1p2", "start": 2101248, "size": 262144, "type": "E3C9E316-0B5C-4DB8-817D-F92DF00215AE", "uuid": "457B64C2-4327-4EBA-B6E3-4A10DE800391",
"name": "MSR", "attrs": "GUID:63"},
{"node": "/dev/nvme0n1p3", "start": 2363392, "size": 125829120, "type": "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7", "uuid": "FADCBBB0-DCDB-44A2-A1F9-A263BDE2C222
", "name": "OS"},
{"node": "/dev/nvme0n1p4", "start": 495919792, "size": 4196352, "type": "DE94BBA4-06D1-4D40-A16A-BFD50179D6AC", "uuid": "A340E79C-7F62-4F4D-8618-057436616205
", "name": "RBP", "attrs": "RequiredPartition GUID:63"},
{"node": "/dev/nvme0n1p5", "start": 128192512, "size": 104857600, "type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4", "uuid": "9461344C-FC3D-4651-8263-B012A8D828
5D", "name": "OpenSLX-ID44"}
]
}
}
Updated by Dirk von Suchodoletz about 4 years ago
Das sieht doch schonmal gut aus ...
Updated by Simon Rettberg about 4 years ago
Sieht doch gut aus. MBR sieht so aus:
# sfdisk --json /dev/sda { "partitiontable": { "label": "dos", "id": "0x3ae2a574", "device": "/dev/sda", "unit": "sectors", "partitions": [ {"node": "/dev/sda1", "start": 2048, "size": 83886080, "type": "44"} ] } }
Die zu klärende Frage wär jetzt noch, wie groß ein Sektor ist. Weil die Entwickler des Tools besonders schlau waren, haben sie davon abgehesen, da noch ein Feld "sectorsize" rein zu pappen. Richtet sich das also nach der physikalischen Größe der HDD (512/4K) oder immer fix nach der logischen Sektorgröße des Kernels (512)?
Updated by Michael Janczyk almost 4 years ago
CentOS7 hat noch sfdisk, das json nicht unterstützt: sfdisk from util-linux 2.23.2
Wenn man nur Partitionen braucht, könnte man auch blkid -o export oder lsblk --output verwenden.
Updated by Simon Rettberg almost 3 years ago
Was ist jetzt hier der Stand? Sollte ja kein Hexenwerk sein.
Updated by Jannik Schönartz almost 3 years ago
- Status changed from New to Feedback
- Assignee changed from BAS-Crew to Simon Rettberg
- % Done changed from 0 to 90
Also ich hab wie heute besprochen jetzt mal lsblk und sfdisk hizugefügt und nach platten gruppiert. commit
Folgende parameter werden dabei aufgerufen:
$ sfdisk --json /dev/disk/by-path/<disk> $ lsblk --json -b --output-all /dev/disk/by-path/<disk>
Das neue Schema sieht so aus:
{ ..., "drives": { "<disk_by-path_identifier>": { "readlink": "/dev/sr0", "smartctl": {...}, "sfdisk": {...}, "lsblk": {...} } } ..., }
Der disk_by-path_identifier ist dann halt was unter /dev/disk/by-path/<identifiert> gefunden wird. Z.B.
pci-0000:00:17.0-ata-1
Beispiel mit Daten...Beispiel mit Daten...
{
...,
"drives": {
"pci-0000:00:17.0-ata-2": {
"readlink": "/dev/sr0",
"smartctl": {
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
1
],
"svn_revision": "5022",
"platform_info": "x86_64-linux-5.4.0-77-generic",
"build_info": "(local build)",
"argv": [
"smartctl",
"-x",
"--json",
"/dev/disk/by-path/pci-0000:00:17.0-ata-2"
],
"exit_status": 2
},
"device": {
"name": "/dev/disk/by-path/pci-0000:00:17.0-ata-2",
"info_name": "/dev/disk/by-path/pci-0000:00:17.0-ata-2",
"type": "scsi",
"protocol": "SCSI"
},
"vendor": "TSSTcorp",
"product": "CDDVDW SH-216FB",
"model_name": "TSSTcorp CDDVDW SH-216FB",
"revision": "FT00",
"scsi_version": "SPC-3"
},
"sfdisk": {},
"lsblk": {
"blockdevices": [
{
"name": "sr0",
"kname": "sr0",
"path": "/dev/sr0",
"maj:min": "11:0",
"fsavail": null,
"fssize": null,
"fstype": null,
"fsused": null,
"fsuse%": null,
"mountpoint": null,
"label": null,
"uuid": null,
"ptuuid": null,
"pttype": null,
"parttype": null,
"partlabel": null,
"partuuid": null,
"partflags": null,
"ra": 128,
"ro": false,
"rm": true,
"hotplug": true,
"model": "TSSTcorp_CDDVDW_SH-216FB",
"serial": "S18F6YBH4003DT",
"size": 1073741312,
"state": "running",
"owner": "root",
"group": "cdrom",
"mode": "brw-rw----",
"alignment": 0,
"min-io": 512,
"opt-io": 0,
"phy-sec": 512,
"log-sec": 512,
"rota": true,
"sched": "mq-deadline",
"rq-size": 64,
"type": "rom",
"disc-aln": 0,
"disc-gran": 0,
"disc-max": 0,
"disc-zero": false,
"wsame": 0,
"wwn": null,
"rand": false,
"pkname": null,
"hctl": "1:0:0:0",
"tran": "sata",
"subsystems": "block:scsi:pci",
"rev": "FT00",
"vendor": "TSSTcorp",
"zoned": "none"
}
]
}
},
"pci-0000:00:17.0-ata-1": {
"readlink": "/dev/sda",
"smartctl": {
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
1
],
"svn_revision": "5022",
"platform_info": "x86_64-linux-5.4.0-77-generic",
"build_info": "(local build)",
"argv": [
"smartctl",
"-x",
"--json",
"/dev/disk/by-path/pci-0000:00:17.0-ata-1"
],
"exit_status": 0
},
"device": {
"name": "/dev/disk/by-path/pci-0000:00:17.0-ata-1",
"info_name": "/dev/disk/by-path/pci-0000:00:17.0-ata-1 [SAT]",
"type": "sat",
"protocol": "ATA"
},
"model_family": "Samsung based SSDs",
"model_name": "SAMSUNG MZNTY128HDHP-00000",
"serial_number": "S2YMNB0H619385",
"wwn": {
"naa": 5,
"oui": 9528,
"id": 56925086141
},
"firmware_version": "MAT2100Q",
"user_capacity": {
"blocks": 250069680,
"bytes": 128035676160
},
"logical_block_size": 512,
"physical_block_size": 512,
"rotation_rate": 0,
"form_factor": {
"ata_value": 7,
"name": "M.2"
},
"in_smartctl_database": true,
"ata_version": {
"string": "ACS-2, ATA8-ACS T13/1699-D revision 4c",
"major_value": 1020,
"minor_value": 57
},
"sata_version": {
"string": "SATA 3.1",
"value": 127
},
"interface_speed": {
"max": {
"sata_value": 14,
"string": "6.0 Gb/s",
"units_per_second": 60,
"bits_per_unit": 100000000
},
"current": {
"sata_value": 3,
"string": "6.0 Gb/s",
"units_per_second": 60,
"bits_per_unit": 100000000
}
},
"local_time": {
"time_t": 1624978731,
"asctime": "Tue Jun 29 16:58:51 2021 CEST"
},
"read_lookahead": {
"enabled": true
},
"write_cache": {
"enabled": true
},
"ata_security": {
"state": 41,
"string": "Disabled, frozen [SEC2]",
"enabled": false,
"frozen": true
},
"smart_status": {
"passed": true
},
"ata_smart_data": {
"offline_data_collection": {
"status": {
"value": 0,
"string": "was never started"
},
"completion_seconds": 0
},
"self_test": {
"status": {
"value": 0,
"string": "completed without error",
"passed": true
},
"polling_minutes": {
"short": 2,
"extended": 64
}
},
"capabilities": {
"values": [
83,
3
],
"exec_offline_immediate_supported": true,
"offline_is_aborted_upon_new_cmd": false,
"offline_surface_scan_supported": false,
"self_tests_supported": true,
"conveyance_self_test_supported": false,
"selective_self_test_supported": true,
"attribute_autosave_enabled": true,
"error_logging_supported": true,
"gp_logging_supported": true
}
},
"ata_sct_capabilities": {
"value": 61,
"error_recovery_control_supported": true,
"feature_control_supported": true,
"data_table_supported": true
},
"ata_smart_attributes": {
"revision": 1,
"table": [
{
"id": 5,
"name": "Reallocated_Sector_Ct",
"value": 100,
"worst": 100,
"thresh": 10,
"when_failed": "",
"flags": {
"value": 51,
"string": "PO--CK ",
"prefailure": true,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 9,
"name": "Power_On_Hours",
"value": 99,
"worst": 99,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 1387,
"string": "1387"
}
},
{
"id": 12,
"name": "Power_Cycle_Count",
"value": 99,
"worst": 99,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 386,
"string": "386"
}
},
{
"id": 170,
"name": "Unused_Rsvd_Blk_Ct_Chip",
"value": 100,
"worst": 100,
"thresh": 10,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 171,
"name": "Program_Fail_Count_Chip",
"value": 100,
"worst": 100,
"thresh": 10,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 172,
"name": "Erase_Fail_Count_Chip",
"value": 100,
"worst": 100,
"thresh": 10,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 173,
"name": "Wear_Leveling_Count",
"value": 99,
"worst": 99,
"thresh": 5,
"when_failed": "",
"flags": {
"value": 51,
"string": "PO--CK ",
"prefailure": true,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 8,
"string": "8"
}
},
{
"id": 174,
"name": "Unexpect_Power_Loss_Ct",
"value": 99,
"worst": 99,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 52,
"string": "52"
}
},
{
"id": 178,
"name": "Used_Rsvd_Blk_Cnt_Chip",
"value": 100,
"worst": 100,
"thresh": 10,
"when_failed": "",
"flags": {
"value": 19,
"string": "PO--C- ",
"prefailure": true,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": false
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 180,
"name": "Unused_Rsvd_Blk_Cnt_Tot",
"value": 100,
"worst": 100,
"thresh": 10,
"when_failed": "",
"flags": {
"value": 19,
"string": "PO--C- ",
"prefailure": true,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": false
},
"raw": {
"value": 905,
"string": "905"
}
},
{
"id": 184,
"name": "End-to-End_Error",
"value": 100,
"worst": 100,
"thresh": 97,
"when_failed": "",
"flags": {
"value": 51,
"string": "PO--CK ",
"prefailure": true,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 187,
"name": "Uncorrectable_Error_Cnt",
"value": 100,
"worst": 100,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 194,
"name": "Temperature_Celsius",
"value": 62,
"worst": 47,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 38,
"string": "38"
}
},
{
"id": 199,
"name": "CRC_Error_Count",
"value": 100,
"worst": 100,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 62,
"string": "-OSRCK ",
"prefailure": false,
"updated_online": true,
"performance": true,
"error_rate": true,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 0,
"string": "0"
}
},
{
"id": 233,
"name": "Media_Wearout_Indicator",
"value": 99,
"worst": 99,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 19,
"string": "PO--C- ",
"prefailure": true,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": false
},
"raw": {
"value": 16609442,
"string": "16609442"
}
},
{
"id": 241,
"name": "Total_LBAs_Written",
"value": 99,
"worst": 99,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 684,
"string": "684"
}
},
{
"id": 242,
"name": "Total_LBAs_Read",
"value": 99,
"worst": 99,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 470,
"string": "470"
}
},
{
"id": 249,
"name": "Unknown_Samsung_Attr",
"value": 99,
"worst": 99,
"thresh": 0,
"when_failed": "",
"flags": {
"value": 50,
"string": "-O--CK ",
"prefailure": false,
"updated_online": true,
"performance": false,
"error_rate": false,
"event_count": true,
"auto_keep": true
},
"raw": {
"value": 1024,
"string": "1024"
}
}
]
},
"power_on_time": {
"hours": 1387
},
"power_cycle_count": 386,
"temperature": {
"current": 38,
"power_cycle_min": 32,
"power_cycle_max": 40,
"lifetime_min": 27,
"lifetime_max": 53,
"op_limit_min": 0,
"op_limit_max": 70,
"limit_min": 0,
"limit_max": 70
},
"ata_log_directory": {
"gp_dir_version": 1,
"smart_dir_version": 1,
"smart_dir_multi_sector": true,
"table": [
{
"address": 0,
"name": "Log Directory",
"read": true,
"write": false,
"gp_sectors": 1,
"smart_sectors": 1
},
{
"address": 1,
"name": "Summary SMART error log",
"read": true,
"write": false,
"smart_sectors": 1
},
{
"address": 2,
"name": "Comprehensive SMART error log",
"read": true,
"write": false,
"smart_sectors": 1
},
{
"address": 3,
"name": "Ext. Comprehensive SMART error log",
"read": true,
"write": false,
"gp_sectors": 1
},
{
"address": 6,
"name": "SMART self-test log",
"read": true,
"write": false,
"smart_sectors": 1
},
{
"address": 7,
"name": "Extended self-test log",
"read": true,
"write": false,
"gp_sectors": 1
},
{
"address": 9,
"name": "Selective self-test log",
"read": true,
"write": true,
"smart_sectors": 1
},
{
"address": 16,
"name": "NCQ Command Error log",
"read": true,
"write": false,
"gp_sectors": 1
},
{
"address": 17,
"name": "SATA Phy Event Counters log",
"read": true,
"write": false,
"gp_sectors": 1
},
{
"address": 19,
"name": "SATA NCQ Send and Receive log",
"read": true,
"write": false,
"gp_sectors": 1
},
{
"address": 48,
"name": "IDENTIFY DEVICE data log",
"read": true,
"write": false,
"gp_sectors": 9,
"smart_sectors": 9
},
{
"address": 128,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 129,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 130,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 131,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 132,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 133,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 134,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 135,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 136,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 137,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 138,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 139,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 140,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 141,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 142,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 143,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 144,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 145,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 146,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 147,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 148,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 149,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 150,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 151,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 152,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 153,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 154,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 155,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 156,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 157,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 158,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 159,
"name": "Host vendor specific log",
"read": true,
"write": true,
"gp_sectors": 16,
"smart_sectors": 16
},
{
"address": 223,
"name": "Device vendor specific log",
"gp_sectors": 1,
"smart_sectors": 1
},
{
"address": 224,
"name": "SCT Command/Status",
"read": true,
"write": true,
"gp_sectors": 1,
"smart_sectors": 1
},
{
"address": 225,
"name": "SCT Data Transfer",
"read": true,
"write": true,
"gp_sectors": 1,
"smart_sectors": 1
}
]
},
"ata_smart_error_log": {
"extended": {
"revision": 1,
"sectors": 1,
"count": 0
}
},
"ata_smart_self_test_log": {
"extended": {
"revision": 1,
"sectors": 1,
"count": 0
}
},
"ata_smart_selective_self_test_log": {
"revision": 1,
"table": [
{
"lba_min": 0,
"lba_max": 0,
"status": {
"value": 0,
"string": "Not_testing"
}
},
{
"lba_min": 0,
"lba_max": 0,
"status": {
"value": 0,
"string": "Not_testing"
}
},
{
"lba_min": 0,
"lba_max": 0,
"status": {
"value": 0,
"string": "Not_testing"
}
},
{
"lba_min": 0,
"lba_max": 0,
"status": {
"value": 0,
"string": "Not_testing"
}
},
{
"lba_min": 0,
"lba_max": 0,
"status": {
"value": 0,
"string": "Not_testing"
}
}
],
"current_read_scan": {
"lba_min": 0,
"lba_max": 65535,
"status": {
"value": 0,
"string": "was never started"
}
},
"flags": {
"value": 0,
"remainder_scan_enabled": false
},
"power_up_scan_resume_minutes": 0
},
"ata_sct_status": {
"format_version": 3,
"sct_version": 256,
"device_state": {
"value": 0,
"string": "Active"
},
"temperature": {
"current": 38,
"power_cycle_min": 32,
"power_cycle_max": 40,
"lifetime_min": 27,
"lifetime_max": 53,
"under_limit_count": 0,
"over_limit_count": 0
}
},
"ata_sct_temperature_history": {
"version": 2,
"sampling_period_minutes": 1,
"logging_interval_minutes": 10,
"temperature": {
"op_limit_min": 0,
"op_limit_max": 70,
"limit_min": 0,
"limit_max": 70
},
"size": 128,
"index": 6,
"table": [
38,
38,
38,
38,
38,
38,
38,
38,
39,
39,
39,
39,
39,
39,
39,
39,
39,
39,
39,
39,
40,
39,
39,
39,
39,
39,
39,
null,
32,
35,
36,
37,
37,
37,
37,
37,
38,
38,
38,
38,
38,
38,
38,
38,
38,
38,
38,
38,
38,
38,
38,
38,
38,
39,
39,
39,
39,
39,
39,
39,
39,
39,
39,
38,
38,
38,
38,
38,
38,
38,
38,
38,
38,
38,
38,
38,
38,
38,
39,
39,
39,
39,
39,
39,
39,
39,
39,
39,
39,
39,
39,
null,
32,
36,
38,
38,
39,
40,
39,
37,
36,
36,
36,
36,
36,
36,
35,
35,
35,
35,
35,
35,
36,
36,
36,
36,
35,
35,
36,
37,
37,
37,
38,
38,
37,
38,
38,
38
]
},
"ata_sct_erc": {
"read": {
"enabled": false
},
"write": {
"enabled": false
}
},
"sata_phy_event_counters": {
"table": [
{
"id": 1,
"name": "Command failed due to ICRC error",
"size": 2,
"value": 0,
"overflow": false
},
{
"id": 2,
"name": "R_ERR response for data FIS",
"size": 2,
"value": 0,
"overflow": false
},
{
"id": 3,
"name": "R_ERR response for device-to-host data FIS",
"size": 2,
"value": 0,
"overflow": false
},
{
"id": 4,
"name": "R_ERR response for host-to-device data FIS",
"size": 2,
"value": 0,
"overflow": false
},
{
"id": 5,
"name": "R_ERR response for non-data FIS",
"size": 2,
"value": 0,
"overflow": false
},
{
"id": 6,
"name": "R_ERR response for device-to-host non-data FIS",
"size": 2,
"value": 0,
"overflow": false
},
{
"id": 7,
"name": "R_ERR response for host-to-device non-data FIS",
"size": 2,
"value": 0,
"overflow": false
},
{
"id": 8,
"name": "Device-to-host non-data FIS retries",
"size": 2,
"value": 0,
"overflow": false
},
{
"id": 9,
"name": "Transition from drive PhyRdy to drive PhyNRdy",
"size": 2,
"value": 2,
"overflow": false
},
{
"id": 10,
"name": "Device-to-host register FISes sent due to a COMRESET",
"size": 2,
"value": 2,
"overflow": false
},
{
"id": 11,
"name": "CRC errors within host-to-device FIS",
"size": 2,
"value": 0,
"overflow": false
},
{
"id": 13,
"name": "Non-CRC errors within host-to-device FIS",
"size": 2,
"value": 0,
"overflow": false
},
{
"id": 15,
"name": "R_ERR response for host-to-device data FIS, CRC",
"size": 2,
"value": 0,
"overflow": false
},
{
"id": 16,
"name": "R_ERR response for host-to-device data FIS, non-CRC",
"size": 2,
"value": 0,
"overflow": false
},
{
"id": 18,
"name": "R_ERR response for host-to-device non-data FIS, CRC",
"size": 2,
"value": 0,
"overflow": false
},
{
"id": 19,
"name": "R_ERR response for host-to-device non-data FIS, non-CRC",
"size": 2,
"value": 0,
"overflow": false
}
],
"reset": false
}
},
"sfdisk": {
"partitiontable": {
"label": "gpt",
"id": "6B759871-98C6-4391-AB04-8F3853DD692E",
"device": "/dev/disk/by-path/pci-0000:00:17.0-ata-1",
"unit": "sectors",
"firstlba": 34,
"lastlba": 250069646,
"partitions": [
{
"node": "/dev/disk/by-path/pci-0000:00:17.0-ata-1-part1",
"start": 2048,
"size": 2099200,
"type": "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
"uuid": "43B2CBCC-4757-4BAF-90BA-8FF40192472F",
"name": "COB",
"attrs": "RequiredPartition"
},
{
"node": "/dev/disk/by-path/pci-0000:00:17.0-ata-1-part2",
"start": 2101248,
"size": 262144,
"type": "E3C9E316-0B5C-4DB8-817D-F92DF00215AE",
"uuid": "823D99A8-AE0D-4753-8D1F-CBCAC4CAB37C",
"name": "MSR"
},
{
"node": "/dev/disk/by-path/pci-0000:00:17.0-ata-1-part3",
"start": 2363392,
"size": 123810387,
"type": "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7",
"uuid": "1E193BDE-BB60-44A3-A31E-42DEB9578EE2",
"name": "Basic data partition"
},
{
"node": "/dev/disk/by-path/pci-0000:00:17.0-ata-1-part4",
"start": 126175232,
"size": 991232,
"type": "DE94BBA4-06D1-4D40-A16A-BFD50179D6AC",
"uuid": "C3711AF0-7376-430A-8A5B-8A3B4D7F2E8C",
"attrs": "RequiredPartition GUID:63"
},
{
"node": "/dev/disk/by-path/pci-0000:00:17.0-ata-1-part5",
"start": 127168512,
"size": 2048,
"type": "21686148-6449-6E6F-744E-656564454649",
"uuid": "8E1F894A-2C21-4A0B-B321-D58E5B0AB437"
},
{
"node": "/dev/disk/by-path/pci-0000:00:17.0-ata-1-part6",
"start": 127170560,
"size": 118700032,
"type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
"uuid": "FDBD1033-52D8-4C06-9FA7-8EEEE9383C5A"
},
{
"node": "/dev/disk/by-path/pci-0000:00:17.0-ata-1-part7",
"start": 245871280,
"size": 4196352,
"type": "DE94BBA4-06D1-4D40-A16A-BFD50179D6AC",
"uuid": "18BD013A-3FC4-4734-8476-240E1F39CEE8",
"name": "RBP",
"attrs": "RequiredPartition"
}
]
}
},
"lsblk": {
"blockdevices": [
{
"name": "sda",
"kname": "sda",
"path": "/dev/sda",
"maj:min": "8:0",
"fsavail": null,
"fssize": null,
"fstype": null,
"fsused": null,
"fsuse%": null,
"mountpoint": null,
"label": null,
"uuid": null,
"ptuuid": "6b759871-98c6-4391-ab04-8f3853dd692e",
"pttype": "gpt",
"parttype": null,
"partlabel": null,
"partuuid": null,
"partflags": null,
"ra": 128,
"ro": false,
"rm": false,
"hotplug": false,
"model": "SAMSUNG_MZNTY128HDHP-00000",
"serial": "S2YMNB0H619385",
"size": 128035676160,
"state": "running",
"owner": "root",
"group": "disk",
"mode": "brw-rw----",
"alignment": 0,
"min-io": 512,
"opt-io": 0,
"phy-sec": 512,
"log-sec": 512,
"rota": false,
"sched": "mq-deadline",
"rq-size": 64,
"type": "disk",
"disc-aln": 0,
"disc-gran": 512,
"disc-max": 2147450880,
"disc-zero": false,
"wsame": 0,
"wwn": "0x5002538d40ffe1bd",
"rand": false,
"pkname": null,
"hctl": "0:0:0:0",
"tran": "sata",
"subsystems": "block:scsi:pci",
"rev": "100Q",
"vendor": "ATA ",
"zoned": "none",
"children": [
{
"name": "sda1",
"kname": "sda1",
"path": "/dev/sda1",
"maj:min": "8:1",
"fsavail": null,
"fssize": null,
"fstype": "vfat",
"fsused": null,
"fsuse%": null,
"mountpoint": null,
"label": "SYSTEM",
"uuid": "3E7D-2FF3",
"ptuuid": "6b759871-98c6-4391-ab04-8f3853dd692e",
"pttype": "gpt",
"parttype": "c12a7328-f81f-11d2-ba4b-00a0c93ec93b",
"partlabel": "COB",
"partuuid": "43b2cbcc-4757-4baf-90ba-8ff40192472f",
"partflags": "0x1",
"ra": 128,
"ro": false,
"rm": false,
"hotplug": false,
"model": null,
"serial": null,
"size": 1074790400,
"state": null,
"owner": "root",
"group": "disk",
"mode": "brw-rw----",
"alignment": 0,
"min-io": 512,
"opt-io": 0,
"phy-sec": 512,
"log-sec": 512,
"rota": false,
"sched": "mq-deadline",
"rq-size": 64,
"type": "part",
"disc-aln": 0,
"disc-gran": 512,
"disc-max": 2147450880,
"disc-zero": false,
"wsame": 0,
"wwn": "0x5002538d40ffe1bd",
"rand": false,
"pkname": "sda",
"hctl": null,
"tran": null,
"subsystems": "block:scsi:pci",
"rev": null,
"vendor": null,
"zoned": "none"
},
{
"name": "sda2",
"kname": "sda2",
"path": "/dev/sda2",
"maj:min": "8:2",
"fsavail": null,
"fssize": null,
"fstype": null,
"fsused": null,
"fsuse%": null,
"mountpoint": null,
"label": null,
"uuid": null,
"ptuuid": "6b759871-98c6-4391-ab04-8f3853dd692e",
"pttype": "gpt",
"parttype": "e3c9e316-0b5c-4db8-817d-f92df00215ae",
"partlabel": "MSR",
"partuuid": "823d99a8-ae0d-4753-8d1f-cbcac4cab37c",
"partflags": null,
"ra": 128,
"ro": false,
"rm": false,
"hotplug": false,
"model": null,
"serial": null,
"size": 134217728,
"state": null,
"owner": "root",
"group": "disk",
"mode": "brw-rw----",
"alignment": 0,
"min-io": 512,
"opt-io": 0,
"phy-sec": 512,
"log-sec": 512,
"rota": false,
"sched": "mq-deadline",
"rq-size": 64,
"type": "part",
"disc-aln": 0,
"disc-gran": 512,
"disc-max": 2147450880,
"disc-zero": false,
"wsame": 0,
"wwn": "0x5002538d40ffe1bd",
"rand": false,
"pkname": "sda",
"hctl": null,
"tran": null,
"subsystems": "block:scsi:pci",
"rev": null,
"vendor": null,
"zoned": "none"
},
{
"name": "sda3",
"kname": "sda3",
"path": "/dev/sda3",
"maj:min": "8:3",
"fsavail": null,
"fssize": null,
"fstype": "ntfs",
"fsused": null,
"fsuse%": null,
"mountpoint": null,
"label": null,
"uuid": "B07EC9827EC94238",
"ptuuid": "6b759871-98c6-4391-ab04-8f3853dd692e",
"pttype": "gpt",
"parttype": "ebd0a0a2-b9e5-4433-87c0-68b6b72699c7",
"partlabel": "Basic data partition",
"partuuid": "1e193bde-bb60-44a3-a31e-42deb9578ee2",
"partflags": null,
"ra": 128,
"ro": false,
"rm": false,
"hotplug": false,
"model": null,
"serial": null,
"size": 63390918144,
"state": null,
"owner": "root",
"group": "disk",
"mode": "brw-rw----",
"alignment": 0,
"min-io": 512,
"opt-io": 0,
"phy-sec": 512,
"log-sec": 512,
"rota": false,
"sched": "mq-deadline",
"rq-size": 64,
"type": "part",
"disc-aln": 0,
"disc-gran": 512,
"disc-max": 2147450880,
"disc-zero": false,
"wsame": 0,
"wwn": "0x5002538d40ffe1bd",
"rand": false,
"pkname": "sda",
"hctl": null,
"tran": null,
"subsystems": "block:scsi:pci",
"rev": null,
"vendor": null,
"zoned": "none"
},
{
"name": "sda4",
"kname": "sda4",
"path": "/dev/sda4",
"maj:min": "8:4",
"fsavail": null,
"fssize": null,
"fstype": "ntfs",
"fsused": null,
"fsuse%": null,
"mountpoint": null,
"label": null,
"uuid": "B69E121E9E11D827",
"ptuuid": "6b759871-98c6-4391-ab04-8f3853dd692e",
"pttype": "gpt",
"parttype": "de94bba4-06d1-4d40-a16a-bfd50179d6ac",
"partlabel": null,
"partuuid": "c3711af0-7376-430a-8a5b-8a3b4d7f2e8c",
"partflags": "0x8000000000000001",
"ra": 128,
"ro": false,
"rm": false,
"hotplug": false,
"model": null,
"serial": null,
"size": 507510784,
"state": null,
"owner": "root",
"group": "disk",
"mode": "brw-rw----",
"alignment": 0,
"min-io": 512,
"opt-io": 0,
"phy-sec": 512,
"log-sec": 512,
"rota": false,
"sched": "mq-deadline",
"rq-size": 64,
"type": "part",
"disc-aln": 0,
"disc-gran": 512,
"disc-max": 2147450880,
"disc-zero": false,
"wsame": 0,
"wwn": "0x5002538d40ffe1bd",
"rand": false,
"pkname": "sda",
"hctl": null,
"tran": null,
"subsystems": "block:scsi:pci",
"rev": null,
"vendor": null,
"zoned": "none"
},
{
"name": "sda5",
"kname": "sda5",
"path": "/dev/sda5",
"maj:min": "8:5",
"fsavail": null,
"fssize": null,
"fstype": null,
"fsused": null,
"fsuse%": null,
"mountpoint": null,
"label": null,
"uuid": null,
"ptuuid": "6b759871-98c6-4391-ab04-8f3853dd692e",
"pttype": "gpt",
"parttype": "21686148-6449-6e6f-744e-656564454649",
"partlabel": null,
"partuuid": "8e1f894a-2c21-4a0b-b321-d58e5b0ab437",
"partflags": null,
"ra": 128,
"ro": false,
"rm": false,
"hotplug": false,
"model": null,
"serial": null,
"size": 1048576,
"state": null,
"owner": "root",
"group": "disk",
"mode": "brw-rw----",
"alignment": 0,
"min-io": 512,
"opt-io": 0,
"phy-sec": 512,
"log-sec": 512,
"rota": false,
"sched": "mq-deadline",
"rq-size": 64,
"type": "part",
"disc-aln": 0,
"disc-gran": 512,
"disc-max": 2147450880,
"disc-zero": false,
"wsame": 0,
"wwn": "0x5002538d40ffe1bd",
"rand": false,
"pkname": "sda",
"hctl": null,
"tran": null,
"subsystems": "block:scsi:pci",
"rev": null,
"vendor": null,
"zoned": "none"
},
{
"name": "sda6",
"kname": "sda6",
"path": "/dev/sda6",
"maj:min": "8:6",
"fsavail": null,
"fssize": null,
"fstype": "ext4",
"fsused": null,
"fsuse%": null,
"mountpoint": null,
"label": null,
"uuid": "43febc95-6b7c-4d48-a94f-87fd9275be59",
"ptuuid": "6b759871-98c6-4391-ab04-8f3853dd692e",
"pttype": "gpt",
"parttype": "0fc63daf-8483-4772-8e79-3d69d8477de4",
"partlabel": null,
"partuuid": "fdbd1033-52d8-4c06-9fa7-8eeee9383c5a",
"partflags": null,
"ra": 128,
"ro": false,
"rm": false,
"hotplug": false,
"model": null,
"serial": null,
"size": 60774416384,
"state": null,
"owner": "root",
"group": "disk",
"mode": "brw-rw----",
"alignment": 0,
"min-io": 512,
"opt-io": 0,
"phy-sec": 512,
"log-sec": 512,
"rota": false,
"sched": "mq-deadline",
"rq-size": 64,
"type": "part",
"disc-aln": 0,
"disc-gran": 512,
"disc-max": 2147450880,
"disc-zero": false,
"wsame": 0,
"wwn": "0x5002538d40ffe1bd",
"rand": false,
"pkname": "sda",
"hctl": null,
"tran": null,
"subsystems": "block:scsi:pci",
"rev": null,
"vendor": null,
"zoned": "none"
},
{
"name": "sda7",
"kname": "sda7",
"path": "/dev/sda7",
"maj:min": "8:7",
"fsavail": null,
"fssize": null,
"fstype": "ntfs",
"fsused": null,
"fsuse%": null,
"mountpoint": null,
"label": "RE",
"uuid": "A03C40A03C407378",
"ptuuid": "6b759871-98c6-4391-ab04-8f3853dd692e",
"pttype": "gpt",
"parttype": "de94bba4-06d1-4d40-a16a-bfd50179d6ac",
"partlabel": "RBP",
"partuuid": "18bd013a-3fc4-4734-8476-240e1f39cee8",
"partflags": "0x1",
"ra": 128,
"ro": false,
"rm": false,
"hotplug": false,
"model": null,
"serial": null,
"size": 2148532224,
"state": null,
"owner": "root",
"group": "disk",
"mode": "brw-rw----",
"alignment": 0,
"min-io": 512,
"opt-io": 0,
"phy-sec": 512,
"log-sec": 512,
"rota": false,
"sched": "mq-deadline",
"rq-size": 64,
"type": "part",
"disc-aln": 0,
"disc-gran": 512,
"disc-max": 2147450880,
"disc-zero": false,
"wsame": 0,
"wwn": "0x5002538d40ffe1bd",
"rand": false,
"pkname": "sda",
"hctl": null,
"tran": null,
"subsystems": "block:scsi:pci",
"rev": null,
"vendor": null,
"zoned": "none"
}
]
}
]
}
}
},
...,
}
Bei lsblk gibts halt weder den Sektorstart noch die Anzahl der Sektoren.
Aber sollte so erstmal passen oder?
Updated by Jannik Schönartz almost 3 years ago
Beim schreiben vom Ticketupdate ist mir aufgefallen, dass lsblk auch vermutlich erst ab version 2.27.rc1 den parameter --json hat.
CentOS7 hat noch sfdisk, das json nicht unterstützt: sfdisk from util-linux 2.23.2
Also ist hier die Frage ob wir bei den Servern dann die Partitionstabellen weglassen oder das irgendwie selber von hand parsen?