Hide Forgot
Description of problem: can not foramt device after being used by tgtd Version-Release number of selected component (if applicable): scsi-target-utils-1.0.4-3.el6.x86_64 How reproducible: yes Steps to Reproduce: Define an iSCSI target name: # tgtadm --lld iscsi --op new --mode target --tid=1 --targetname iqn.2010-10.local.rhev:target1 Add disk as a logical unit to the target: # tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/sdb1 try to format part: # mke2fs /dev/sdb1 mke2fs 1.41.12 (17-May-2010) /dev/sdb1 is apparently in use by the system; will not make a filesystem here! trun off tgtd try again same problem unload iscsi moduals same problem reboot same problem I had to boot into rescue mode to foramt the drive Actual results: cannot format dive after used by tgtd Expected results: be able to format dirve Additional info:
(In reply to comment #0) > Add disk as a logical unit to the target: > # tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/sdb1 > In that command you are passing tgt a partition on a disk and not the entire disk. Is that what you intended (the comment above mentions you wanted to add a disk)? Just a warning: If you pass tgtd a partition, it will expose it as a complete disk, so if on the initiator you did fdisk and mkfs on what the initiator sees, I think it will screw things up if you later try to access /dev/sdb on the target side assuming that all the partitions are from the target's point of view. > try to format part: > > # mke2fs /dev/sdb1 > mke2fs 1.41.12 (17-May-2010) > /dev/sdb1 is apparently in use by the system; will not make a filesystem here! > unload iscsi moduals same problem The unloading iscsi modules threw me. tgtd does not use any kernel modules. So are you running mkfs on the /dev/sdb1 on the tgt systems or are did the iscsi initiator just happen to assign the iscsi disk /dev/sdb too, and you are running mkfs in the initiator side. > > reboot same problem > Do you mean you reboot and restart tgtd? Is tgtd restarted after you reboot and try to run mkfs?
I just tried this here and the mkfs works for me. Are you using sdb for lvm or dm devices as well as iscsi?
taking bug, setting needinfo.
Since RHEL 6.1 External Beta has begun, and this bug remains unresolved, it has been rejected as it is not proposed as exception or blocker. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux.
no response to needinfo, please reopen if the problem pops up again.