Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-09-05 Thread Alan Stern
On Wed, 3 Sep 2014, James Bottomley wrote: > On Wed, 2014-09-03 at 16:30 -0400, Alan Stern wrote: > > On Wed, 3 Sep 2014, James Bottomley wrote: > > > > > Before we embark on elaborate hacks, why don't we just make the capacity > > > writeable (by root) in sysfs from userspace (will require block

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-09-04 Thread Dale R. Worley
> From: James Bottomley > Before we embark on elaborate hacks, why don't we just make the capacity > writeable (by root) in sysfs from userspace (will require block change)? > We can then encode all the nasty heuristics (including gpt reading) in > userspace as a udev rule. Looking in from the o

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-09-03 Thread James Bottomley
On Wed, 2014-09-03 at 16:30 -0400, Alan Stern wrote: > On Wed, 3 Sep 2014, James Bottomley wrote: > > > Before we embark on elaborate hacks, why don't we just make the capacity > > writeable (by root) in sysfs from userspace (will require block change)? > > We can then encode all the nasty heurist

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-09-03 Thread Alan Stern
On Wed, 3 Sep 2014, James Bottomley wrote: > Before we embark on elaborate hacks, why don't we just make the capacity > writeable (by root) in sysfs from userspace (will require block change)? > We can then encode all the nasty heuristics (including gpt reading) in > userspace as a udev rule. Tha

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-09-03 Thread James Bottomley
On Wed, 2014-09-03 at 15:05 -0400, Alan Stern wrote: > On Wed, 3 Sep 2014, Dale R. Worley wrote: > > > > From: Alan Stern > > > > > > On Fri, 29 Aug 2014, Matthew Dharm wrote: > > > > Is there an 'easy' way to override the detected size of a storage > > > > device from userspace? If we had that

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-09-03 Thread Dale R. Worley
> From: Alan Stern > Anyway, I can try writing a patch to add this capability. We'll see if > it can solve your problem. Unfortunately, I think there is genuine value in such a hack. E.g., I've got two USB-to-SATA adapters. One works correctly. One does not. But at this point, I can't atta

RES: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-09-03 Thread Alfredo Dal Ava Junior
On Sat, 30 Aug 2014, Matthew Dharm wrote > I was thinking of something that could notice a USB device which is formatted > NTFS and has a partition table and filesystem that indicates a much bigger > capacity than what the drive reports. Under this circumstances, you could do > something like po

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-09-03 Thread Alan Stern
On Wed, 3 Sep 2014, Dale R. Worley wrote: > > From: Alan Stern > > > > On Fri, 29 Aug 2014, Matthew Dharm wrote: > > > Is there an 'easy' way to override the detected size of a storage > > > device from userspace? If we had that, someone could write a helper > > > application which looked for t

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-09-03 Thread Dale R. Worley
> From: Alan Stern > > On Fri, 29 Aug 2014, Matthew Dharm wrote: > > Is there an 'easy' way to override the detected size of a storage > > device from userspace? If we had that, someone could write a helper > > application which looked for this particular fubar and try to Do The > > Right Thing(

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-08-31 Thread Alan Stern
On Sat, 30 Aug 2014, Douglas Gilbert wrote: > On 14-08-30 05:15 PM, Alan Stern wrote: > > On Fri, 29 Aug 2014, Matthew Dharm wrote: > > > >> Is there an 'easy' way to override the detected size of a storage > >> device from userspace? If we had that, someone could write a helper > >> application

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-08-30 Thread Matthew Dharm
On Sat, Aug 30, 2014 at 2:15 PM, Alan Stern wrote: > On Fri, 29 Aug 2014, Matthew Dharm wrote: > >> Is there an 'easy' way to override the detected size of a storage >> device from userspace? If we had that, someone could write a helper >> application which looked for this particular fubar and tr

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-08-30 Thread Douglas Gilbert
On 14-08-30 05:15 PM, Alan Stern wrote: On Fri, 29 Aug 2014, Matthew Dharm wrote: Is there an 'easy' way to override the detected size of a storage device from userspace? If we had that, someone could write a helper application which looked for this particular fubar and try to Do The Right Thi

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-08-30 Thread Alan Stern
On Fri, 29 Aug 2014, Matthew Dharm wrote: > Is there an 'easy' way to override the detected size of a storage > device from userspace? If we had that, someone could write a helper > application which looked for this particular fubar and try to Do The > Right Thing(tm), or at least offer the user

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-08-29 Thread Matthew Dharm
Is there an 'easy' way to override the detected size of a storage device from userspace? If we had that, someone could write a helper application which looked for this particular fubar and try to Do The Right Thing(tm), or at least offer the user some options. Matt On Fri, Aug 29, 2014 at 2:07 P

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-08-29 Thread Dale R. Worley
> From: Alan Stern > If you try to repartition the drive under Windows using the deficient > adapter, you'll see that the problem still exists. It just doesn't > show up during normal use. So in summary, the Windows workaround is icky, but it allows any use but repartitioning to be one on the

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-08-27 Thread Alan Stern
On Wed, 27 Aug 2014, Dale R. Worley wrote: > What I find interesting is that Windows (at least, Windows 7 > Professional) seems to be able to handle the deficient adapter. So does Linux. The difference is that Windows believes the values in the partition table in preference to what the hardware

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-08-27 Thread James Bottomley
On Wed, 2014-08-27 at 15:21 -0400, Dale R. Worley wrote: > > From: James Bottomley > > > Did you try read capacity 16 on it? What happened? (the AS2105 rejects > > read capacity 16, so there's no reliable way to deduce the capacity of > > drives over 2TB). > > OK, I had to track down which pac

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-08-27 Thread Dale R. Worley
What I find interesting is that Windows (at least, Windows 7 Professional) seems to be able to handle the deficient adapter. What I'd like to do is log the disk commands during the mounting sequence, preferably at both the SCSI and USB layers. Then at least we'll know exactly what the driver is d

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-08-27 Thread Dale R. Worley
> From: James Bottomley > Did you try read capacity 16 on it? What happened? (the AS2105 rejects > read capacity 16, so there's no reliable way to deduce the capacity of > drives over 2TB). OK, I had to track down which package contains sg_readcap. The adapter that fails gives this output:

Re: RES: RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-27 Thread Alan Stern
On Wed, 27 Aug 2014, Oliver Neukum wrote: > > I don't think we want to add another SCSI flag to say that READ > > CAPACITY(10) is unreliable. > > Why not? It would only be friendly to tell the upper layer > of a malfunction if we know about it. To what end? What will the upper layer do with thi

Re: RES: RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-27 Thread Oliver Neukum
On Tue, 2014-08-26 at 10:47 -0400, Alan Stern wrote: > On Mon, 25 Aug 2014, Oliver Neukum wrote: > > Just set US_FL_NEEDS_CAP16. If READ CAPACITY(16) fails in that case, > > it is clear that something is wrong. It must be set or READ CAPACITY(10) > > alone would be taken as giving a valid answer.

Re: Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-08-26 Thread James Bottomley
On Tue, 2014-08-26 at 15:39 -0400, Dale R. Worley wrote: > This is almost certainly a form of the problem reported in > "AS2105-based enclosure size issues with >2TB HDDs". I'm repeating my > original message here so linux-usb can see it, and so it can be > connec

Problem with USB-to-SATA adapters (was: AS2105-based enclosure size issues with >2TB HDDs)

2014-08-26 Thread Dale R. Worley
This is almost certainly a form of the problem reported in "AS2105-based enclosure size issues with >2TB HDDs". I'm repeating my original message here so linux-usb can see it, and so it can be connected to the older thread. I'll address it in another message. I'v

Re: RES: RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-26 Thread Alan Stern
On Mon, 25 Aug 2014, Oliver Neukum wrote: > On Mon, 2014-08-25 at 16:21 -0400, Alan Stern wrote: > > On Mon, 25 Aug 2014, Alfredo Dal Ava Junior wrote: > > > > > Well, it is causing problems anyway... from user perspective, it's a > > > Linux compatibility issue, as it works "fine" on Windows. I'

RES: RES: RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-26 Thread Alfredo Dal Ava Junior
On Mon, 26 Aug 2014, David Leight wrote: > I wonder what the manufacturer would saw in response the bug where > windows shows the incorrect size when trying to partition the disk? I contacted enclosure manufacturer (Welland) some weeks ago, they are supposed to escalate my questions to enginee

RE: RES: RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-26 Thread David Laight
From Oliver Neukum [mailto:oneu...@suse.de] > On Tue, 2014-08-26 at 09:58 +, David Laight wrote: > > > Part of the problem is that usb-storage has no way to know that > > > anything strange is going on. It's normal for READ CAPACITY(16) to > > > fail (this depend on the SCSI level), and it's n

Re: RES: RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-26 Thread Oliver Neukum
On Tue, 2014-08-26 at 09:58 +, David Laight wrote: > > Part of the problem is that usb-storage has no way to know that > > anything strange is going on. It's normal for READ CAPACITY(16) to > > fail (this depend on the SCSI level), and it's normal for the READ > > CAPACITY(10) to report a valu

RE: RES: RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-26 Thread David Laight
From: Alan Stern > On Mon, 25 Aug 2014, Alfredo Dal Ava Junior wrote: > > > Well, it is causing problems anyway... from user perspective, it's a > > Linux compatibility issue, as it works "fine" on Windows. I'm not an > > expert, but I'm wondering that if usb-storage could set capacity as > > "UND

Re: RES: RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-25 Thread Oliver Neukum
On Mon, 2014-08-25 at 16:21 -0400, Alan Stern wrote: > On Mon, 25 Aug 2014, Alfredo Dal Ava Junior wrote: > > > Well, it is causing problems anyway... from user perspective, it's a > > Linux compatibility issue, as it works "fine" on Windows. I'm not an > > expert, but I'm wondering that if usb-st

RES: RES: RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-25 Thread Alfredo Dal Ava Junior
On Mon, 25 Aug 2014 Alan Stern wrote: > Part of the problem is that usb-storage has no way to know that anything > strange is going on. It's normal for READ CAPACITY(16) to fail (this depend > on > the SCSI level), and it's normal for the READ > CAPACITY(10) to report a value less than 2 TB. > R

Re: RES: RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-25 Thread Alan Stern
On Mon, 25 Aug 2014, Alfredo Dal Ava Junior wrote: > Well, it is causing problems anyway... from user perspective, it's a > Linux compatibility issue, as it works "fine" on Windows. I'm not an > expert, but I'm wondering that if usb-storage could set capacity as > "UNDETERMINED"/ Zero (or keep usi

RES: RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-25 Thread Alfredo Dal Ava Junior
On Mon, 25 Aug 2014 Alan Stern wrote: > > On Mon, 25 Aug 2014, Alfredo Dal Ava Junior wrote: > > That's right. I don't know why Windows behaves that way. Please look this output from diskpart (Windows): DISKPART> list partition Partition ### Type Size Offset ---

RES: RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-25 Thread Alfredo Dal Ava Junior
On Mon, 15 Aug 2014 James Bottomley wrote: > So how did the partition get on there at the correct size in the first place? > Even under windows partition managers believe the disk size they get from > the system if the disk is blank. The HDD can be partitioned outside the enclosure, when connect

Re: RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-25 Thread Alan Stern
On Mon, 25 Aug 2014, Alfredo Dal Ava Junior wrote: > On Mon, 25 Aug 2014, Alan Stern wrote: > > > > Don't forget that lots of disks go crazy if you try to read from a > > nonexistent > > block, that is, one beyond the end of the disk. > > IMO, this bug cannot be worked around in any reasonable m

Re: RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-25 Thread James Bottomley
On Mon, 2014-08-25 at 18:48 +, Alfredo Dal Ava Junior wrote: > On Mon, 25 Aug 2014, Alan Stern wrote: > > > > Don't forget that lots of disks go crazy if you try to read from a > > nonexistent > > block, that is, one beyond the end of the disk. > > IMO, this bug cannot be worked around in any

RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-25 Thread Alfredo Dal Ava Junior
On Mon, 25 Aug 2014, Alan Stern wrote: > > Don't forget that lots of disks go crazy if you try to read from a nonexistent > block, that is, one beyond the end of the disk. > IMO, this bug cannot be worked around in any reasonable manner. The > device simply cannot handle disks larger than 2 TB.

Re: AS2105-based enclosure size issues with >2TB HDDs

2014-08-25 Thread Alan Stern
On Mon, 25 Aug 2014, Oliver Neukum wrote: > On Mon, 2014-08-25 at 10:58 +, Alfredo Dal Ava Junior wrote: > > > - 1TB and 2TB: READ_CAPACITY_10 returns correct size value > > - 3TB and 4TB: READ_CAPACITY_10 returns size in a 2TB modulus > > > > If we fix capacity size by reporting (READ_CAPAC

Re: AS2105-based enclosure size issues with >2TB HDDs

2014-08-25 Thread Oliver Neukum
On Mon, 2014-08-25 at 10:58 +, Alfredo Dal Ava Junior wrote: > - 1TB and 2TB: READ_CAPACITY_10 returns correct size value > - 3TB and 4TB: READ_CAPACITY_10 returns size in a 2TB modulus > > If we fix capacity size by reporting (READ_CAPACITY_10 + MODULO_2TB), the > result > will be invalid