Access in DOS to USB NTFS hard drives

The intent of this forum is to discuss my DOS TSR programs (available at http://bretjohnson.us), how they work and don't work, new/missing features, status of updates, and anything else related to them that may need to be discussed.

Access in DOS to USB NTFS hard drives

Postby cosmos55 » Tue May 11, 2010 10:04 pm

Hallo,

I made use of your DOS-drivers to access a flash USB stick, and it worked very fine !! Good work !

I'm just wondering if there is a limitation of the capacity of the USB stick ?

I also would be interested in making visible in DOS, an USB hard drive formatted in NTFS of 320 GB and/or 1000 GB. I didn't manage to do this with your drivers. Is there any solution for that...?

Thank you in advance.

Pascal
cosmos55
 
Posts: 5
Joined: Tue May 11, 2010 9:51 pm

Re: Access in DOS to USB NTFS hard drives

Postby Bret » Wed May 12, 2010 3:00 am

cosmos55 wrote:I'm just wondering if there is a limitation of the capacity of the USB stick ?


The only capacity issue is that the number of sectors on the disk must be <= 2^32, which equates to 2TB total capacity if the disk uses standard 512-byte sectors.

cosmos55 wrote:I also would be interested in making visible in DOS, an USB hard drive formatted in NTFS of 320 GB and/or 1000 GB. I didn't manage to do this with your drivers. Is there any solution for that...?


FYI, it is a VERY bad idea to use NTFS, or any other type of JFS, on removable media, including USB hard drives. Even Microsoft says you should not do it. It is also a bad idea to use any kind of write-back caching on removable media, no matter what kind of file system it is using.

In spite of this warning, there are several different programs out there that will let you read from NTFS disks in DOS, though I'm not sure there are any (at least free ones) that will let you write to an NTFS disk. Just do a Google search for "NTFS DOS" The programs should all work with USBDRIVE, since USBDRIVE provides an INT 13h interface. I've personally never tried this, though, since I never use NTFS with USB.

I have tried a couple of the programs with fixed (non-removable) NTFS disks/partitions, but they didn't seem to work very well (similar to my experience with DOS LFN programs). Keep in mind that NTFS is proprietary (like almost everything that Microsoft does), and there are also several different versions of NTFS, so Microsoft is probably the only one who will ever really understand how it works.
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Access in DOS to USB NTFS hard drives

Postby cosmos55 » Wed May 12, 2010 6:18 am

Thanks for the quick response !

FYI, it is a VERY bad idea to use NTFS, or any other type of JFS, on removable media, including USB hard drives.


I bought the 1000 GB hard drive already formatted in NTFS. So it would be a good idea to format it to FAT32 ?

there are several different programs out there that will let you read from NTFS disks in DOS


I tried different programs and I succeeded in browsing my 320 GB NTFS USB drive with 'NTFS4DOS' from Avira.(of course after loading USBUHCIL and USBDRIVE). It supports read and write.
But for some reason it didn't work on my 1000 GB NTFS USB drive...? despite of the fact that USBUHSL and USBDRIVE did not give any problem.
cosmos55
 
Posts: 5
Joined: Tue May 11, 2010 9:51 pm

Re: Access in DOS to USB NTFS hard drives

Postby Bret » Wed May 12, 2010 8:38 am

cosmos55 wrote:I bought the 1000 GB hard drive already formatted in NTFS. So it would be a good idea to format it to FAT32 ?


If it were mine, that's what I would try and do. One problem you might run into, though, is that the Windows formatting tools artificially limit the size of a FAT volume to something less than the maximum. That is, even though Windows can use a 1TB FAT32 partition, it won't actually let you format one to be that big. You may need to use Ranish or some other program to do the actual formatting (I'm not even 100% positive that Ranish will work, but suspect that it will). You might also consider dividing the disk up into smaller partitions, instead of just having one huge one. That's also a problem with newer versions of Windows, though, because they don't allow more than one partition on a removable disk (older versions of Windows did, but newer ones don't).

cosmos55 wrote:I tried different programs and I succeeded in browsing my 320 GB NTFS USB drive with 'NTFS4DOS' from Avira.(of course after loading USBUHCIL and USBDRIVE). It supports read and write.
But for some reason it didn't work on my 1000 GB NTFS USB drive...? despite of the fact that USBUHSL and USBDRIVE did not give any problem.


It's hard to say what might be wrong there. It could be a problem with USBDRIVE, or it could be that NTFS4DOS has a problem with really big drives for some reason, or maybe the NTFS on the disk is a (newer?) version that NTFS4DOS doesn't understand, or any other number of possibilities. The fact that USBDRIVE seems to be happy with both disks leads me to believe it's probably not a problem with USBDRIVE, but it's hard to say for sure -- disks sometimes do really strange things.

We can try to do some advanced troubleshooting if you want, but if you're going to try and re-format the disk anyway we should wait, since the new format may resolve the problem.
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Access in DOS to USB NTFS hard drives

Postby DOS386 » Wed May 12, 2010 3:03 pm

Bret wrote:The only capacity issue is that the number of sectors on the disk must be <= 2^32, which equates to 2TB total capacity if the disk uses standard 512-byte sectors.


LBA32 for UHCI (and OHCI ?). Does EHCI provide LBA64 ? Of course USBDOS should support it then :-)

FYI, it is a VERY bad idea to use NTFS, or any other type of JFS, on removable media


or any FS or other "technology" from MS ... at all :-(

cosmos55 wrote:I bought the 1000 GB hard drive already formatted in NTFS. So it would be a good idea to format it to FAT32 ?


For now, YES, since FAT is the only thing DOS knows for now :-(

FYI, FAT sucks heavily, also, a 900 GiB HD will have a FAT size of at least (32 KiB clusters) 110 MiB, and evaluating it at 50 KiB/s will take 38 minutes, so the sad conclusion, USBDOS is NOT READY for absurdly huge HD's. With USB 2 support this will be better, but not perfect, because of faulty FAT28 "design".
DOS386
 
Posts: 12
Joined: Fri Mar 20, 2009 12:58 am

Re: Access in DOS to USB NTFS hard drives

Postby cosmos55 » Wed May 12, 2010 9:51 pm

Thanks for all the help.
But I just recalled that in FAT32 I'm stuck with files larger dan 4GB and I have a lot of mkv-videofiles like that... So leaving it at NTFS is my only option.

The only reason I wanted to access the USB hard drive in DOS, is because I wanted to try to delete some files that became corrupted (Cyclic Redundancy Error). I've already tried in Windows Safemode with MS-DOS prompt, but they could not be deleted neither.
I once had the same issue on a USB stick, and then I could delete them in DOS.

So I guess I will have to leave those corrupted files like they are... Maybe I will try to reformat the drive if I find the capacity on my other drives to make a backup.
cosmos55
 
Posts: 5
Joined: Tue May 11, 2010 9:51 pm

Re: Access in DOS to USB NTFS hard drives

Postby Bret » Thu May 13, 2010 3:15 am

DOS386 wrote:LBA32 for UHCI (and OHCI ?). Does EHCI provide LBA64 ? Of course USBDOS should support it then


The type of host controller (EHCI vs U/OHCI) has nothing to do with disk structures (LBAxx). USBDRIVE does not support more than 2^32 sectors because all USB disks I've ever seen use the "SCSI Transparent" protocol, which only provides space for a 32-bit sector number. There's talk of creating a new protocol for USB disks, which I suspect may include support for 2^64 sectors.

DOS386 wrote:USBDOS is NOT READY for absurdly huge HD's


Apparently neither is Windows, if it can't even delete a file that it created.

cosmos55 wrote:But I just recalled that in FAT32 I'm stuck with files larger dan 4GB and I have a lot of mkv-videofiles like that... So leaving it at NTFS is my only option.


Have you looked at the output of the USBDRIVE troubleshooting options (/F, /Q, etc.) to see if it looks like USBDRIVE is reading the disk like it should? That should help isolate the problem to see if it's with USBDRIVE or somewhere else.
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Access in DOS to USB NTFS hard drives

Postby cosmos55 » Fri May 14, 2010 5:54 am

Hallo,

I tested with de USBDRIVE switches and apparently the /B switch tells me the connected drive is not SCSI compatible :

Host Index : 0
Addr : 2
Intf num : 0
Stage num : 117
Error Code : 0005h
req : 12h
stp /dat /sts : 00h
csw : ffh
Residue : ffffffffh
Key : 0fh
Info : ffffffffh
Asc/q : ffffh

SCSI Req Type : 12h = Inquiry
Sense Key (SCSI) : 0fh = reserved

The /F switch doesn't tell me very much.

I also tried the usbaspi.exe trick but it tells me : Illegal operation
I have already tried the usbaspi.sys and di1000dd.sys combination and the usbaspi.sys recognies an ASPI device with several LUN's, but I get stuck after the loading of di1000dd.sys with the error : divide overflow
cosmos55
 
Posts: 5
Joined: Tue May 11, 2010 9:51 pm

Re: Access in DOS to USB NTFS hard drives

Postby Bret » Fri May 14, 2010 8:18 am

You're misinterpreting the error codes, which is understandable unless you've really looked at the source code.

An error at Stage Number 117 means the device is SCSI-compatible, but does not declare itself to be a DASD (Direct Access Storage Device, a.k.a. a disk drive). USBDRIVE will only work with devices that declare themselves to be DASD. It may be declaring itself to be a CD/DVD or something, which could explain the multiple LUNs and could also explain why USBASPI sort of recognizes it (USBASPI is supposed to work with CD-ROMs). A basic USB hard drive should only have one LUN, unless it has some special security features or something.

Look at the contents of the Inquiry buffer with the /F option -- the lower 5 bits of the first byte will tell you what kind of Device it declares itself to be. Likely possibilities are 00 (DASD), 01 (Sequential Access Device, usually a magnetic tape), 04 (WORM - Write-Once Read Many), 05 (CD-ROM), 07 (Optical Memory), 0C (RAID / Storage Array), or 0E (Reduced Block Command Set DASD). There are other possibilities as well, but I wouldn't expect a hard drive to be anything other than those.
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Access in DOS to USB NTFS hard drives

Postby cosmos55 » Sat May 15, 2010 2:02 am

Right again. I found 05, so CD-ROM. I read that USBDRIVE is not supporting this for the moment. And it is not like a Sandisk flash drive where you have to install U3 software...
USBDEVIC tells me ther is a SCSI TTrsp Bulk and a RootHUB.
cosmos55
 
Posts: 5
Joined: Tue May 11, 2010 9:51 pm


Return to Programs

Who is online

Users browsing this forum: No registered users and 2 guests

cron