rhel7中,targetcli使用两位数的分区后缀名字(比如sda10)而导致的问题

来源:互联网 发布:淘宝卖家需要的软件 编辑:程序博客网 时间:2024/06/08 20:01

rhel7中,targetcli使用两位数的分区名字(比如sda10)而导致的问题

[root@host1 ~]# fdisk -l /dev/sdaDisk /dev/sda: 1999.3 GB, 1999307276288 bytes, 3904897024 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x000a8633   Device Boot      Start         End      Blocks   Id  System/dev/sda1   *        2048     1026047      512000   83  Linux/dev/sda2         1026048    68134911    33554432   82  Linux swap / Solaris/dev/sda3        68134912   487565311   209715200   83  Linux/dev/sda4       487565312  3904897023  1708665856    5  Extended/dev/sda5       487567360   508538879    10485760   83  Linux/dev/sda6       508540928   529512447    10485760   83  Linux/dev/sda7       529514496   550486015    10485760   83  Linux/dev/sda8       550488064  1179633663   314572800   83  Linux/dev/sda9      1179635712  1808781311   314572800   83  Linux/dev/sda10     1808783360  2437928959   314572800   83  Linux ------>>>注意此处的sda10

[root@host1 ~]# targetclitargetcli shell version 2.1.fb41Copyright 2011-2013 by Datera, Inc and others.For help on commands, type 'help'./backstores/block> lso- block ...................................................................................................... [Storage Objects: 0]/backstores/block> create dev=/dev/sda5 ocr_hdd_1Created block storage object ocr_hdd_1 using /dev/sda5./backstores/block> create dev=/dev/sda6 ocr_hdd_2Created block storage object ocr_hdd_2 using /dev/sda6./backstores/block> create dev=/dev/sda7 ocr_hdd_3Created block storage object ocr_hdd_3 using /dev/sda7./backstores/block> create dev=/dev/sda8 fra_hdd_1Created block storage object fra_hdd_1 using /dev/sda8./backstores/block> create dev=/dev/sda9 fra_hdd_2Created block storage object fra_hdd_2 using /dev/sda9./backstores/block> create dev=/dev/sda10 fra_hdd_3          ------>>>注意此处的sda10Created block storage object fra_hdd_3 using /dev/sda10./backstores/block> create dev=/dev/nvme0n1 data_ssd_1Created block storage object data_ssd_1 using /dev/nvme0n1./backstores/block> create dev=/dev/nvme1n1 data_ssd_2Created block storage object data_ssd_2 using /dev/nvme1n1./backstores/block> create dev=/dev/nvme2n1 data_ssd_3Created block storage object data_ssd_3 using /dev/nvme2n1./backstores/block> ls----------------------------------------------->>>>ls命令Traceback (most recent call last):  File "/usr/bin/targetcli", line 121, in <module>    main()  File "/usr/bin/targetcli", line 111, in main    shell.run_interactive()  File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 894, in run_interactive    self._cli_loop()  File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 723, in _cli_loop    self.run_cmdline(cmdline)  File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 837, in run_cmdline    self._execute_command(path, command, pparams, kparams)  File "/usr/lib/python2.7/site-packages/configshell_fb/shell.py", line 812, in _execute_command    result = target.execute_command(command, pparams, kparams)  File "/usr/lib/python2.7/site-packages/configshell_fb/node.py", line 1411, in execute_command    return method(*pparams, **kparams)  File "/usr/lib/python2.7/site-packages/configshell_fb/node.py", line 710, in ui_command_ls    tree = self._render_tree(target, depth=depth)  File "/usr/lib/python2.7/site-packages/configshell_fb/node.py", line 861, in _render_tree    + self._render_tree(children[i], margin, depth)  File "/usr/lib/python2.7/site-packages/configshell_fb/node.py", line 765, in _render_tree    (description, is_healthy) = root.summary()  File "/usr/lib/python2.7/site-packages/targetcli/ui_backstore.py", line 540, in summary    return ("%s (%s) %s%s %s" % (so.udev_path, bytes_to_human(so.size),  File "/usr/lib/python2.7/site-packages/rtslib_fb/tcm.py", line 703, in _get_size    return get_size_for_disk_name(self._parse_info('device')) * int(self._parse_info('SectorSize'))  File "/usr/lib/python2.7/site-packages/rtslib_fb/utils.py", line 162, in get_size_for_disk_name    return get_size("/sys/block/%s/%s" % (disk, m.group()), True)  File "/usr/lib/python2.7/site-packages/rtslib_fb/utils.py", line 141, in get_size    sect_size = int(fread("%s/size" % path))  File "/usr/lib/python2.7/site-packages/rtslib_fb/utils.py", line 90, in fread    with open(path, 'r') as file_fd:IOError: [Errno 2] No such file or directory: '/sys/block/sda1/sda10/size'------------ls命令的报错![root@host1 ~]#



根据redhat.com文章:targetcli causes calltrace with the particular partition names which include 2 digits,链接见下:
https://access.redhat.com/solutions/2180861
建议:
Currently, there is no package to fix this issue. Red Hat is handling this issue in RHBZ#1312270The workaround is to avoid creation iqn with the partition whose name contains two digits.
好吧,遇到bug了。。。不用sda10了,于是执行如下的命令:

[root@host1 ~]# targetclitargetcli shell version 2.1.fb41Copyright 2011-2013 by Datera, Inc and others.For help on commands, type 'help'./>cd backstores/block/backstores/block> delete  fra_hdd_3Deleted storage object fra_hdd_3./backstores/block> ls------------->>>>>能正常显示了!!!o- block ...................................................................................................... [Storage Objects: 8]  o- data_ssd_1 ................................................................... [/dev/nvme0n1 (745.2GiB) write-thru deactivated]  o- data_ssd_2 ................................................................... [/dev/nvme1n1 (745.2GiB) write-thru deactivated]  o- data_ssd_3 ................................................................... [/dev/nvme2n1 (745.2GiB) write-thru deactivated]  o- fra_hdd_1 ....................................................................... [/dev/sda8 (300.0GiB) write-thru deactivated]  o- fra_hdd_2 ....................................................................... [/dev/sda9 (300.0GiB) write-thru deactivated]  o- ocr_hdd_1 ........................................................................ [/dev/sda5 (10.0GiB) write-thru deactivated]  o- ocr_hdd_2 ........................................................................ [/dev/sda6 (10.0GiB) write-thru deactivated]  o- ocr_hdd_3 ........................................................................ [/dev/sda7 (10.0GiB) write-thru deactivated]/backstores/block>




阅读全文
0 0