Bug 671517

Summary: system saying device is still in use after being used by tgtd
Product: Red Hat Enterprise Linux 6 Reporter: David Huff <dhuff>
Component: scsi-target-utilsAssignee: Andy Grover <agrover>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0CC: agrover
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-06 19:58:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description David Huff 2011-01-21 18:26:56 UTC
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:

Comment 2 Mike Christie 2011-01-21 20:57:42 UTC
(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?

Comment 3 Mike Christie 2011-01-22 00:09:28 UTC
I just tried this here and the mkfs works for me.

Are you using sdb for lvm or dm devices as well as iscsi?

Comment 4 Andy Grover 2011-03-17 18:11:36 UTC
taking bug, setting needinfo.

Comment 5 RHEL Program Management 2011-04-04 02:17:04 UTC
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.

Comment 6 Andy Grover 2011-06-06 19:58:52 UTC
no response to needinfo, please reopen if the problem pops up again.