Announcement

Collapse
No announcement yet.

How to auto-import foreign striped volumes?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to auto-import foreign striped volumes?

    I have two Windows 7 Pro installed on my PC: one for working and one for my home cinema.

    My media and other files reside on a striped volume. Every time I boot with a different OS I have to reimport the "foreign" volumes, which is no problem, but very inconvenient.

    Can I auto-import them at boot time or after login automatically? Diskpart seems not be able to do that.

    Thank you fpr your help

  • #2
    Re: How to auto-import foreign striped volumes?

    You could use Powershell to test the disk presence/status, then run the Diskpart command from inside the Powershell script to bring the disk on-line. There are things to note here:
    A) Powershell doesn't run scripts out-of-the-box, so you'll have to maybe invoke a BAT file to bypass the ExecutionPolicy setting, then run the PS script
    B) have the execution file set to run as part of your Startup in each OS
    C) Use the 'get-WIMObject' cmdlet to inquire for the disk in question

    If the disk is listed, call up the Diskpart cmd line instruction to import it and you're off. The cmdlet name I listed above works under Win7 Pro with PS7 running on it.

    While Get-WMIObject commands won't work by themselves here, you could use a variation, get-WMIObject -class CIMClass. To find out which command may work for you, inside PS, run this command (without the quotes): 'Get-CimClass -ClassName *disk* -QualifierName dynamic'. It will return a list of CIMClass and Win32_* objects having to do with dynamic disks. You'll have to read up on the various entries to see which one can give you the key value you're looking for to decide on running the import.

    Since I don't have one to play with I can't be more informative than that, but if you boot your machine and DON'T immediately import the stripe, you'll be able to see what works for you. Once you have it working for 1 Win7 OS, simply copy to the other install.
    *RicklesP*
    MSCA (2003/XP), Security+, CCNA

    ** Remember: credit where credit is due, and reputation points as appropriate **

    Comment


    • #3
      Re: How to auto-import foreign striped volumes?

      Originally posted by RicklesP View Post
      The cmdlet name I listed above works under Win7 Pro with PS7 running on it.
      Which cmdlet are you referring to?

      Since there are always the same disks to be imported I do not need to test for them to be there, I just need to select one of the disks in the stripe set and use the diskpart "import" command (I already tested that).

      What I cannot do is use this in bat or cmd file since diskpart is interactive. Could you help me with this please?

      Comment


      • #4
        Re: How to auto-import foreign striped volumes?

        The cmdlet was the 'get-wmiobject' in the previous sentence in my original post.

        Having a quick search on , the first link I found when looking for 'diskpart scripted' was this one:
        'http://www.tech-recipes.com/rx/9910/how-to-automate-windows-diskpart-commands-in-a-script/'

        Sounds straigthforward, if you already know which commands you wish to enter on the interactive CLI. Or if you go to:
        'http://blogs.technet.com/b/heyscriptingguy/archive/2013/08/26/automating-diskpart-with-windows-powershell-part-1.aspx' you can find a way to use Powershell to help you as well with Diskpart.

        What it boils down to is: diskpart can quite simply be scripted by calling it from a BAT file and passing it a text file with the appropriate cmds listed, one per line. If you already know the commands, put 'em in a text file, then call that text file as part of the diskpart command you issue from a BAT file. No powershell required.
        *RicklesP*
        MSCA (2003/XP), Security+, CCNA

        ** Remember: credit where credit is due, and reputation points as appropriate **

        Comment


        • #5
          Re: How to auto-import foreign striped volumes?

          Thx alot for all your help.
          Since I have installed some apps on this drive, that need to be there at startup I decided to break the striped volume again. Just too much hassle for my dual boot system.

          Comment

          Working...
          X