Dave-H Posted February 13, 2015 Author Posted February 13, 2015 Thanks jaclaz, i will report back after the switcher file modification.I was actually a bit concerned that it reported "OK, NTFS volume is mounted to drive E: ..."Why would it report that? It hadn't actually done it.There is already a drive E: on the USB machine (PC2XP4096) which is what I was using, it's a network drive on that machine.In fact it's the main archive drive that's physically in the other machine, where it also appears as drive E: and I certainly don't want anything messing with that! Here's the details of the machines - 1. PC1XP512 Primary machine Windows XP 32 bit with eSATA connection2. PC1XP4096 Primary Machine Windows XP 32 bit with USB connection3. PC181512 Primary machine Windows 8.1 64 bit with eSATA connection4. PC1814096 Primary machine Windows 8.1 64 bit with USB connection5. PC2XP512 Secondary machine not applicable - no eSATA connection6 PC2XP4096 Secondary machine Windows XP 32 bit USB connection7. PC281512 Secondary machine not applicable - no eSATA connection8. PC2814096 Secondary machine Windows 8.1 32 bit USB connection
jaclaz Posted February 13, 2015 Posted February 13, 2015 (edited) Thanks jaclaz, i will report back after the switcher file modification.I was actually a bit concerned that it reported "OK, NTFS volume is mounted to drive E: ..."Why would it report that? It hadn't actually done it.That is something to be understood, most probably *something* doesn't proceed as expected in the batch.While you are editing the switcher.cmd, make also the following edit, find the label:mountcheckand add right after it a couple lines, so that it becomes::mountcheckSET SecondDriveLetter=SET SecondVolumeID=this way the second drive letter is re-determined each time, which should avoid that false detection. And it is possible that this: There is already a drive E: on the USB machine (PC2XP4096) which is what I was using, it's a network drive on that machine. is the actual reason of the more generic issue, as the diskpart command issued "assign" equates to "assign first drive letter available", and it is entirely possible that for what diskpart knows first available letter is E: on that machine... So, in the batch, edit here: :: THIS IS NEXT ONE at +4select Volume %Volume#%assignEXIT Changing it to: :: THIS IS NEXT ONE at +4select Volume %Volume#%assign letter=%ThisDriveLetter%EXITAnd the same could be done - to be on the safe side - to the previous diskpart "remove" command, changing::: THIS IS NEXT ONE at +4select Volume %Volume#%removeEXITto:: THIS IS NEXT ONE at +4select Volume %Volume#%remove letter=%ThisDriveLetter%EXITjaclaz Edited February 13, 2015 by jaclaz
jaclaz Posted February 13, 2015 Posted February 13, 2015 Mostly pointless post , but a good way to let Dave-H notice I have edited (adding things to do), my previous post and that I received correctly the info about the machines. Here's the details of the machines - 1. PC1XP512 Primary machine Windows XP 32 bit with eSATA connection 2. PC1XP4096 Primary Machine Windows XP 32 bit with USB connection 3. PC181512 Primary machine Windows 8.1 64 bit with eSATA connection 4. PC1814096 Primary machine Windows 8.1 64 bit with USB connection 5. PC2XP512 Secondary machine not applicable - no eSATA connection 6 PC2XP4096 Secondary machine Windows XP 32 bit USB connection 7. PC281512 Secondary machine not applicable - no eSATA connection 8. PC2814096 Secondary machine Windows 8.1 32 bit USB connection jaclaz
Dave-H Posted February 13, 2015 Author Posted February 13, 2015 (edited) OK, I tried again after doing the edits to switcher.cmd.The drive is still set for 512 and is fine on the eSATA machine (PC1XP512).Running the modified switcher on the USB connected 4096 machine (PC2XP4096) gave this -Microsoft Windows XP [Version 5.1.2600](C) Copyright 1985-2001 Microsoft Corp.D:\Users\Dave>g:G:\>switcherXP or 2003 ..."DUAL" disk found as \\.\PHYSICALDRIVE1Disk is mounted as 4096 bytes/sectorVolume found:Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.Volume found:Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.Volume found:Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.Volume found:Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.This just repeated over and over until the windows was closed.I don't know why it's saying "Disk is mounted as 4096 bytes/sector" as surely it isn't.Unless I've got completely confused the eSATA interface is 512 and the USB interface is 4096.Running the switcher on the eSATA machine (PC1XP512) gives this, which is correct -Microsoft Windows XP [Version 5.1.2600](C) Copyright 1985-2001 Microsoft Corp.C:\XP User Files\Dave>i:I:\>switcherXP or 2003 ..."DUAL" disk found as \\.\PHYSICALDRIVE5Disk is mounted as 512 bytes/sectorOK, NTFS volume is mounted to drive J: ......Currently deployed bootsector is the 512 bytes/sector oneCurrent NTFS bootsector is the 512 bytes/sector one, good.Nothing to switch.Press any key to continue . . .I:\> Edited February 13, 2015 by Dave-H
jaclaz Posted February 13, 2015 Posted February 13, 2015 (edited) Sorry, "somehow" I either mistyped or the board code tags did their "magic" There must be no spaces between "SET SecondDriveLetter" and the "=" (and of course no spaces after it), and the same applies to the other line forSecondVolumeId, the scope of the lines is to undefine the two variables...Otherwise the batch seems correct, it may be advisable to rephrase "Disk is mounted as" changing it to something like "Disk is connected as" or "Disk has an interface read as" or the like, whatever you believe being more clear or less confusing.However that is the message that the line should convey, the Disk (the whole thing) is "seen" by windows as having that sector size.jaclaz Edited February 13, 2015 by jaclaz
Dave-H Posted February 14, 2015 Author Posted February 14, 2015 Well it looks OK, having checked out what you said.I think you need to check the modified version over yourself to make sure I've done all the modifications correctly.Switcher.cmd
jaclaz Posted February 14, 2015 Posted February 14, 2015 Hmmm. Try the attached switcherdh.cmd, I rechecked it and added some more verbose output.I could find no issues with your edits (exception made for a missing double quote, but that would have only affected the :remount part).The current issue is *somewhere* in the part that (:mountcheck and/or :notmounted) attempts to detect/find the drive letter/VolumeID for the second partition, on the PC2XP4096 there must be some "remains" in the Registry mounted devices (or however something that I seemingly cannot reproduce/imagine) that "tricks" the batch, making it assign an empty value to the SecondVolumeID variable.Can you try again the attached on the PC2XP4096?Please additionally run a:MOUNTVOL>mountvol.logand aREG QUERY HKLM\SYSTEM\MountedDevices>regexe.logand attach the two logs, besides the output of the switcherdh.cmdjaclazSwitcherdh.zip
Dave-H Posted February 14, 2015 Author Posted February 14, 2015 OK, here's what I got what I ran the new version of the switcher -Microsoft Windows XP [Version 5.1.2600](C) Copyright 1985-2001 Microsoft Corp.D:\Users\Dave>g:G:\>switcherdhXP or 2003 ..."DUAL" disk found as \\.\PHYSICALDRIVE1Disk is connected as 4096 bytes/sectorChecking Drive Letter E:Environment variable Second not definedVolIndex_1=\\?\Volume{2952b50f-2f76-11e2-bcf2-806d6172696f}\VolIndex_2=\\?\Volume{71d4ba4a-5179-11e3-b24b-806d6172696f}\VolIndex_3=\\?\Volume{71d4ba4b-5179-11e3-b24b-806d6172696f}\VolIndex_4=\\?\Volume{e579176a-b23d-11e4-8fd5-b46c9d6c66ad}\VolIndex_5=\\?\Volume{e579176b-b23d-11e4-8fd5-b46c9d6c66ad}\DriveLetter1=C:\DriveLetter2=D:\DriveLetter3=F:\DriveLetter4=G:\DriveLetter5=E:\Volume found:Press any key to continue . . .Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.Checking Drive Letter E:Environment variable Second not definedVolIndex_1=\\?\Volume{2952b50f-2f76-11e2-bcf2-806d6172696f}\VolIndex_2=\\?\Volume{71d4ba4a-5179-11e3-b24b-806d6172696f}\VolIndex_3=\\?\Volume{71d4ba4b-5179-11e3-b24b-806d6172696f}\VolIndex_4=\\?\Volume{e579176a-b23d-11e4-8fd5-b46c9d6c66ad}\VolIndex_5=\\?\Volume{e579176b-b23d-11e4-8fd5-b46c9d6c66ad}\DriveLetter1=C:\DriveLetter2=D:\DriveLetter3=F:\DriveLetter4=G:\DriveLetter5=E:\Volume found:Press any key to continue . . .Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.Checking Drive Letter E:Environment variable Second not definedVolIndex_1=\\?\Volume{2952b50f-2f76-11e2-bcf2-806d6172696f}\VolIndex_2=\\?\Volume{71d4ba4a-5179-11e3-b24b-806d6172696f}\VolIndex_3=\\?\Volume{71d4ba4b-5179-11e3-b24b-806d6172696f}\VolIndex_4=\\?\Volume{e579176a-b23d-11e4-8fd5-b46c9d6c66ad}\VolIndex_5=\\?\Volume{e579176b-b23d-11e4-8fd5-b46c9d6c66ad}\DriveLetter1=C:\DriveLetter2=D:\DriveLetter3=F:\DriveLetter4=G:\DriveLetter5=E:\Volume found:Press any key to continue . . .Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.Checking Drive Letter E:Environment variable Second not definedVolIndex_1=\\?\Volume{2952b50f-2f76-11e2-bcf2-806d6172696f}\VolIndex_2=\\?\Volume{71d4ba4a-5179-11e3-b24b-806d6172696f}\VolIndex_3=\\?\Volume{71d4ba4b-5179-11e3-b24b-806d6172696f}\VolIndex_4=\\?\Volume{e579176a-b23d-11e4-8fd5-b46c9d6c66ad}\VolIndex_5=\\?\Volume{e579176b-b23d-11e4-8fd5-b46c9d6c66ad}\DriveLetter1=C:\DriveLetter2=D:\DriveLetter3=F:\DriveLetter4=G:\DriveLetter5=E:\Volume found:Press any key to continue . . .This repeated over and over.The other two logs are attached. logs.zip
jaclaz Posted February 14, 2015 Posted February 14, 2015 (edited) Good. It is strange, the mountvol and reg.exe logs indicate that the second NTFS partition is mounted as drive letter E: There is probably some kind of "conflict" with your drive E:, which is if I remember right a network connected drive. It is possible that *somehow* an earlier run of the batch (or whatever) has created a kind of "sticky" drive letter in the Registry (or whatever). Try the following:remove/disconnect the USB diskopen regedit and navigate to HKLM\SYSTEM\MountedDevicesdelete the entries that have a binary value starting with 4455414C, there should be 4 of them, as per regexe.log: \??\Volume{e579176a-b23d-11e4-8fd5-b46c9d6c66ad} REG_BINARY 4455414C0000040000000000\DosDevices\G: REG_BINARY 4455414C0000040000000000\??\Volume{e579176b-b23d-11e4-8fd5-b46c9d6c66ad} REG_BINARY 4455414C0000000200000000\DosDevices\E: REG_BINARY 4455414C0000000200000000 change the drive letter connected to your network drive (temporarily) to Z:reconnect the disk and re-run the batch In the meantime I will see if I can find a simple way to detect network drive letters in use... jaclaz P.S.: Please also run this command:wmic path win32_logicaldisk get name, drivetype Edited February 14, 2015 by jaclaz
Dave-H Posted February 14, 2015 Author Posted February 14, 2015 When I reconnected the drive, the small partition appeared as E: and the large one as G: (unformatted).Running the switcher seemed to work this time - Microsoft Windows XP [Version 5.1.2600](C) Copyright 1985-2001 Microsoft Corp.D:\Users\Dave>e:E:\>switcherdhXP or 2003 ..."DUAL" disk found as \\.\PHYSICALDRIVE1Disk is connected as 4096 bytes/sectorChecking Drive Letter G:OK, NTFS volume is mounted to drive G: ......Currently deployed bootsector is the 512 bytes/sector oneCurrently mounted NTFS bootsector is NOT the 4kb bytes/sector one.Trying to refresh mounting ...This is :doremountCopyright (C) 1999-2003 Microsoft Corporation.On computer: NETBOOKDisk 1 is now the selected disk. Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 C Windows 8.1 NTFS Partition 140 GB Healthy System Volume 1 D Windows XP NTFS Partition 140 GB Healthy Boot Volume 2 F Shared Driv NTFS Partition 18 GB Healthy Volume 3 G Partition 931 GB Healthy Volume 4 E FAT Partition 254 MB HealthyVolume#=3Press any key to continue . . .Removing drive letter G: ......done.Re-assigning drive letter G:...done.No dice, going to switch it ...Do you want to switch to the 4kb bootsector? [Y/N]ydsfi \\.\G: 0 0 as4kbNTFS.bssOK, written 4096 bytes at offset 0This is :doremountCopyright (C) 1999-2003 Microsoft Corporation.On computer: NETBOOKDisk 1 is now the selected disk. Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 C Windows 8.1 NTFS Partition 140 GB Healthy System Volume 1 D Windows XP NTFS Partition 140 GB Healthy Boot Volume 2 F Shared Driv NTFS Partition 18 GB Healthy Volume 3 G New Volume NTFS Partition 931 GB Healthy Volume 4 E FAT Partition 254 MB HealthyVolume#=3Press any key to continue . . .Removing drive letter G: ......done.Re-assigning drive letter G:...done.Checking Drive Letter G:OK, NTFS volume is mounted to drive G: ......Currently deployed bootsector is the 4kb bytes/sector oneCurrent NTFS bootsector is the 4kb bytes/sector one, good.Nothing to switch.Press any key to continue . . .E:\>Subsequently running your command line gave this -D:\Users\Dave>wmic path win32_logicaldisk get name, drivetypeDriveType Name3 C:3 D:3 E:3 F:3 G:4 Z:D:\Users\Dave>
jaclaz Posted February 14, 2015 Posted February 14, 2015 (edited) Good. ... and this probably explains why the good MS guys by default assign Network drives to drive letter Z: :http://support.microsoft.com/kb/308582/en-us Try the attached new version 0.07 this should be able to take care of the Network drive(s) also. I am as always fighting between making the batch too or too little verbose . If this version works on PC1 and PC2 machines under XP, next step would be to see how it behaves under 8.1 jaclazSwitcher007.zip Edited February 14, 2015 by jaclaz
Dave-H Posted February 14, 2015 Author Posted February 14, 2015 (edited) OK, I put my network drive back to E: and disconnected and re-connected the external drive.Only the large partition appeared, as drive G:, not the small one, so I couldn't run the switcher.I assumed this was because it wanted to be drive E: and I had taken that letter away from it!Disconnecting the network drive immediately fixed it and it reappeared as drive E:.I used Disk Management to change the large partition to H: and the small partition to G:, ran the switcher on G:, and it worked! Microsoft Windows XP [Version 5.1.2600](C) Copyright 1985-2001 Microsoft Corp.D:\Users\Dave>g:G:\>switcherXP or 2003 ..."DUAL" disk found as \\.\PHYSICALDRIVE1Disk is connected as 4096 bytes/sectorChecking Drive Letter H:OK, NTFS volume is mounted to drive H: ......Currently deployed bootsector is the 512 bytes/sector oneCurrently mounted NTFS bootsector is NOT the 4kb bytes/sector one.Trying to refresh mounting ...NTFS Volume is Volume 3Microsoft DiskPart version 5.1.3565Copyright (C) 1999-2003 Microsoft Corporation.On computer: NETBOOKDISKPART>Please wait while DiskPart scans your configuration.............DiskPart has finished scanning your configuration.DISKPART> Removing drive letter H: ......done.Re-assigning drive letter H:...done. Volume ### Ltr Label Fs Type Size Status Info Volume 0 C Windows 8.1 NTFS Partition 140 GB Healthy System Volume 1 D Windows XP NTFS Partition 140 GB Healthy Boot Volume 2 F Shared Driv NTFS Partition 18 GB Healthy Volume 3 H Partition 931 GB Healthy Volume 4 G FAT Partition 254 MB HealthyNo dice, going to switch it ...Do you want to switch to the 4kb bootsector? [Y/N]ydsfi \\.\H: 0 0 as4kbNTFS.bssOK, written 4096 bytes at offset 0NTFS Volume is Volume 3Microsoft DiskPart version 5.1.3565Copyright (C) 1999-2003 Microsoft Corporation.On computer: NETBOOKDISKPART>Please wait while DiskPart scans your configuration.............DiskPart has finished scanning your configuration.DISKPART> Removing drive letter H: ......done.Re-assigning drive letter H:...done. Volume ### Ltr Label Fs Type Size Status Info Volume 0 C Windows 8.1 NTFS Partition 140 GB Healthy System Volume 1 D Windows XP NTFS Partition 140 GB Healthy Boot Volume 2 F Shared Driv NTFS Partition 18 GB Healthy Volume 3 H New Volume NTFS Partition 931 GB Healthy Volume 4 G FAT Partition 254 MB HealthyChecking Drive Letter H:OK, NTFS volume is mounted to drive H: ......Currently deployed bootsector is the 4kb bytes/sector oneCurrent NTFS bootsector is the 4kb bytes/sector one, good.Nothing to switch.Press any key to continue . . .G:\>Will try again on Windows 8.1 in a while, but it's now looking good! Edited February 14, 2015 by Dave-H
jaclaz Posted February 14, 2015 Posted February 14, 2015 (edited) Yes, the "Initial" drive letter assignment to the FAT partition needs in some cases to be done manually, using Disk Manager, because it is possible that - like it just happened to you - there is a conflict with a network drive (or some other drive, let's say a virtual disk or the like). I don't think this can be avoided, since the "automatic" assignment of drive letters happens right at the moment the disk is connected and the mount manager performs it immediately, seemingly without checking for these "non-fully-integrated" volumes/drives. Among others, this is one reason why the idea is to have the batch only run from the specific "dual mode" FAT volume (which allows for a better portability, i.e. the tool is "self-contained", but forces us to use the "queer" partitioning scheme, so that there is no need to change anything in the MBR) as you have to access properly the FAT partition in order to run the switcher.cmd, and since both the batch and the two alternative bootsectors for the NTFS partition are on the same FAT volume (that is on the same disk as the NTFS volume) there are little risks to deploy the wrong bootsector (from another "dual mode" disk) or to have not the "right" bootsectors available. To be fair, one could even think to create the "other" bootsector for the NTFS volume "on the fly", but since after all it is a matter of just 2 files 4096 bytes each it is not an issue with "occupied" space, and I would probably need more tools, like hexalter and dumphex added to the volume. A possible evolution could be that of creating a backup/copy of those two sectors in an unmapped area of the disk, like - say - sectors LBA 47-54 and 55-62 so that - even if they are deleted by mistake from the FAT volume, they can be recovered anyway ... jaclaz Edited February 14, 2015 by jaclaz
Dave-H Posted February 16, 2015 Author Posted February 16, 2015 Sorry for the delay again.I just tried using the disk in Windows 8.1 "as is" from Windows XP. When I connected it to the USB machine (PC2814096) drive G: appeared but it said there was a problem with it and invited me to scan it.I didn't scan it, and it appears in Explorer OK and the files seem to be OK on it.Drive H: the large drive is nowhere to be seen however, and Disk Management again shows it as a primary partition with no file system or drive letter.It was left working fine on that machine in Windows XP. The other machine (PC181512) showed it as unformatted as I would expect.Using the switcher on that machine switched it successfully. Going back to the PC2814096 machine produced the same result as before, no large partition.Running the switcher just gave this again -Microsoft Windows [Version 6.3.9600](c) 2013 Microsoft Corporation. All rights reserved.C:\windows\system32>g:G:\>switcherVista , or later, ...OK, I am a local admin ..."DUAL" disk found as \\.\PHYSICALDRIVE1Disk is connected as 4096 bytes/sectorChecking Drive Letter H:Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.Checking Drive Letter H:Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.Checking Drive Letter H:Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.Checking Drive Letter H:Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.Checking Drive Letter H:Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.Checking Drive Letter H:Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.Checking Drive Letter H:Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.Checking Drive Letter H:Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.Checking Drive Letter H:Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.Checking Drive Letter H:Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.Checking Drive Letter H:Attempting to mount the NTFS volume to drive H: ......The parameter is incorrect.etc. etc............ I will try it again but this time I'll delete all the partitions first and start from scratch using 8.1 to see if that gives a different result.
jaclaz Posted February 16, 2015 Posted February 16, 2015 Basically - if I get it right - the PC181512 had no issue in switching from 4kb to 512 but the PC2814096 had issues BOTH when the disk was ALREADY (set on PC2XP) to 4096 and when attempting to switch it from 512 to 4kb? I will try it again but this time I'll delete all the partitions first and start from scratch using 8.1 to see if that gives a different result.NO, please DON'T. We have right now a disk that works nicely under XP on both machines (and with both geometries) BUT that seemingly doesn't on only one machine and only on one geometry. Quick recap of available machines/OS/Connections: PC1XP512 Primary machine Windows XP 32 bit with eSATA connectionPC1XP4096 Primary Machine Windows XP 32 bit with USB connectionPC181512 Primary machine Windows 8.1 64 bit with eSATA connectionPC1814096 Primary machine Windows 8.1 64 bit with USB connectionPC2XP4096 Secondary machine Windows XP 32 bit USB connectionPC2814096 Secondary machine Windows 8.1 32 bit USB connection Now we have the disk "as is" (and the switcher.cmd) tested on::PC1XP512 OKPC1XP4096 OKPC181512 OKPC1814096 Missing dataPC2XP4096 OKPC2814096 NOT OK Can you fill the "gap" before anything else? Since the PC181512 is OK, it is probable that there is an issue in the switcher.cmd, I am in the process of re-writing it from scratch at the light of the previous reports, inverting/simplifying the detection (and drive letter assignment) logic, but it would be useful to have the data from PC1814096 (or have I missed it? ) jaclaz
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now