Jump to content

Formatting an external drive using different interfaces


Dave-H

Recommended Posts

OK, that's working!

:thumbup

This is going from 512 to 4086 -

Microsoft Windows [Version 6.3.9600](c) 2013 Microsoft Corporation. All rights reserved.C:\WINDOWS\system32>I:I:\>switcherqev"DUAL" disk found as \\.\PHYSICALDRIVE4, connected as 4096 bytes/sectorThe NTFS Volume is Volume{e308684d-bc26-11e4-bfa7-00304879f908}Checking drive letters ...In use: C: D: E: F: G: H: I:                            S:          W:Free  :                      J: K: L: M: N: O: P: Q: R:    T: U: V:    X: Y: Z:Mounting volume to drive letter J: ... OK, done:Press any key to continue . . .Volume 7     J                RAW    Partition    931 GB  HealthyFilesystem is RAW, we need to switch ...OK, switched:Next is the LABEL commandPress any key to continue . . .LABEL J:Data_4kbPress any key to continue . . .Volume 7     J   Data_4kb     NTFS   Partition    931 GB  HealthyEverything is cool ...Press any key to continue . . .I:\>

This is going from 4096 to 512 -

Microsoft Windows [Version 6.3.9600](c) 2013 Microsoft Corporation. All rights reserved.C:\WINDOWS\system32>I:I:\>switcherqev"DUAL" disk found as \\.\PHYSICALDRIVE4, connected as 512 bytes/sectorThe NTFS Volume is Volume{e308684d-bc26-11e4-bfa7-00304879f908}Checking drive letters ...In use: C: D: E: F: G: H: I:                            S:          W:Free  :                      J: K: L: M: N: O: P: Q: R:    T: U: V:    X: Y: Z:Mounting volume to drive letter J: ... OK, done:Press any key to continue . . .Volume 7     J                RAW    Partition    931 GB  HealthyFilesystem is RAW, we need to switch ...OK, switched:Next is the LABEL commandPress any key to continue . . .LABEL J:Data_512Press any key to continue . . .Volume 7     J   Data_512     NTFS   Partition    931 GB  HealthyEverything is cool ...Press any key to continue . . .I:\>

Again using elevated command prompts.

The "you need to format the disk in drive J: before you can use it" window is still popping up when the script runs though, which is a bit off putting!

:) 

Link to comment
Share on other sites


OK, that's working!

:thumbup

Good. :)

 

The "you need to format the disk in drive J: before you can use it" window is still popping up when the script runs though, which is a bit off putting!

:)

Yes it is :(.

Though I am not sure what specific command triggers it.

The only one that may cause it, could be the MOUNTVOL command :unsure:, because we actually (when the switch is needed) mount to the first drive letter the volume with the "other geometry" bootsector.

Try the attached, it is only a (hopefully working) quick fix, in which I moved the mounting to first drive letter to after the switch (if needed) is performed.

If that is the issue, then I will rewrite the routine less half-@§§edly.

jaclaz

SwitcherQEVmod2.zip

Link to comment
Share on other sites

That's fine jaclaz!

Works when double clicked and when right clicked and run as an administrator.

Also works fine from a desktop shortcut, non-elevated or elevated.

I've only checked on 8.1, but I have no reason to think that it won't be fine on XP too.

:thumbup

There's still a short pause on my system after "Mounting volume to drive letter J: ... OK, done:", but I really wouldn't worry about it!

Great work, now get that final release out and get on to your next thing!

Cheers, Dave.

:yes:

Edited by Dave-H
Link to comment
Share on other sites

Yes, that's better, especially as it now tells you the volume label it's going to assign to the drive, which will tell people why the drive ends up labelled as it is!

Just one last suggestion, when it prints "Bootsector is the "other" XX one" I think it would be better if it printed "Bootsector is the "wrong" XX one".

I think that would be clearer, and would agree with what it prints if you run the switcher when it's not actually needed, when it prints "Bootsector is the "right" XX one".

:)

Link to comment
Share on other sites

Yes, that's great!

:yes:

One thing I have noticed is that often the display of the label on the drive in Explorer doesn't update, and still shows the old label even after switching, although the drive works fine with the new configuration. Refreshing the display doesn't seem to fix it, only removing and replacing the drive fixes it.

I guess that's a Windows thing that can't be fixed.

:no:

Link to comment
Share on other sites

Yes, that's great!

:yes:

One thing I have noticed is that often the display of the label on the drive in Explorer doesn't update, and still shows the old label even after switching, although the drive works fine with the new configuration. Refreshing the display doesn't seem to fix it, only removing and replacing the drive fixes it.

I guess that's a Windows thing that can't be fixed.

:no:

No :(, this should not happen. :unsure:

 

The bootsector of the NTFS volume on the disk (at connection time) is EITHER set to the 512 or to the 4kb.

  1. IF it is 512 and the connection is 512 then the label Data_512 is read (and the switcherQE doesn't do anything to it).
  2. IF it is 512 and the connection is 4kb then the label is NOT read (as Explorer has no way to read it, for all it knows it is a malformed filesystem) and the switcherQE changes it to Data_4kb.
  3. IF it is 4kb and the connection is 4kb then the label Data_4kb is read (and the switcherQE doesn't do anything to it).
  4. IF it is 4kb and the connection is 512 then the label is NOT read (as Explorer has no way to read it, for all it knows it is a malformed filesystem) and the switcherQE changes it to Data_512.

In cases 2 and 4 at connection time Explorer should show a non-label, i.e. the default "Local Disk" and (hopefully) after the switch either Data_512 or Data_4kb, you should never have a situation in which you have Data_512 and after the switch it becomes Data_4kb or viceversa.

 

If  "Local Disk" remains after the switch could be an "update lag" in Explorer, if you close the Explorer Windows and re-open it should be updated.

 

Can you check and find a "repeatable sequence" that causes the issue?

Now the batch tells you when it actually switches and issues the LABEL command, if the batch outputs 

ECHO Assigning Label "Data_%Disk_Connected_As%" to drive %FirstFree%

and/or the last line (diskpart output) shows the "right" label the result should be reflected in Explorer immediately, at least this is what happens here in XP, maybe Windows 8.x has (yet another) different behaviour?

jaclaz

Link to comment
Share on other sites

Well, I've tried again today, and would you believe it, I now can't fault it, the label is switching correctly all the time!

Yesterday, it quite consistently wasn't.

Just one of those anomalies that make you love computers I guess, but it doesn't look as if there really is any problem after all.

:thumbup

Link to comment
Share on other sites

Thanks jaclaz!
I'll check it out and let you know if I find any issues.
It's been really fascinating doing this with you, and thanks for all your perseverance and patience with me at times!
Cheers, Dave.

:)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...