willWipeDisk refuses to clean

Discussion in 'Windows 7' started by Deleted member 222776, Apr 6, 2014.

    I have a Windows 7 image that I want to fully unattend. I'm using ADK for 8.1 if that's of importance.
    When installing, windows gives the error that it cannot clean the disk because it is currently being used. I have on that disk my previously installed windows.
    My current autoUnattend.xml is View attachment b0yzDJCqqx.7z
     
  1. Flipp3r

    Flipp3r MDL Expert

    Feb 11, 2009
    1,962
    904
    60
    I've had this before. I think it gives you that error if there's a hidden recovery/tools partition.
    You can always clean it with diskpart 1st & try again.
    I boot into winpe from usb & run a batch file that cleans the drive & creates all the partition structure I want.
    My unattend just tells setup which partition to install too.
    This is much better because you can now add a custom recovery partition to the end of the drive. ie, shrink windows partition my 10gb & create 10gb recovery.
    Autounattend is limited as it can't shrink...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. I have a USB stick in which I use to install windows. I don't know which device, either HDD or USB, will be DISK 0. So, if clean disk 0, it might be the USB and I don't want that.
     
  3. Flipp3r

    Flipp3r MDL Expert

    Feb 11, 2009
    1,962
    904
    60
    run diskpart
    lis dis
    sel dis 0
    cle
    exit

    Check 1st with the list disk command. Your HDD/SSD's will always be listed 1st anyway, unless they are not seen & you need to load a driver.
    Your unattend is trying to wipe disk 0 anyway you realise...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. pisthai

    pisthai Imperfect Human

    Jul 29, 2009
    7,222
    2,272
    240
    Disc 0 will be the disk which were used for booting the OS and if the OS is on USB Stick, that would be Disc 0!! So, be carefully, check the capacity of the drive and chose the one to clean which you'll need for the installation.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. #6 Deleted member 222776, Apr 6, 2014
    Last edited by a moderator: Apr 20, 2017
    (OP)
    I'm writing a batch right now to find the correct partition. This will look for the partition that has the system flag and select it.
    Based on the following output, am I correct in assuming that the System flag is always the primary system drive? Regardless of CD/DVD/USB etc. media used to boot.
    It's basically the place where bootmgr is located, right?


    My USB is drive G and it contains the ACTIVE flag and is using bootmgr and BCD files. This, however, does not appear as the system.

    I guess there's no way of fully automating diskpart in finding the primary disk.

    Code:
    DISKPART> lis vol
    
      Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
      ----------  ---  -----------  -----  ----------  -------  ---------  --------
      Volume 0     F   SC2012SP1SC  UDF    DVD-ROM     1069 MB  Healthy
      Volume 1     C                NTFS   Partition     50 GB  Healthy    System
      Volume 2     D                NTFS   Partition    415 GB  Healthy    Pagefile
      Volume 3     E                NTFS   Partition    698 GB  Healthy
      Volume 4     G                NTFS   Removable     50 MB  Healthy
    
    DISKPART>
     
  6. pisthai

    pisthai Imperfect Human

    Jul 29, 2009
    7,222
    2,272
    240
    #7 pisthai, Apr 6, 2014
    Last edited by a moderator: Apr 20, 2017
    How many partition has the HDD? The C Partition is 50GB only!!

    And how you like to carry on, format/wipe the C Partition only? That would maybe not solve your problem! Best would be to wipe the whole drive and start from 0!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. The C and D drives are DISK 0 (i.e. primary disk).
    I'm trying to automate diskpart to clean DISK 0, thus removing all partitions on it. In this case, C and D would be deleted.
     
  8. pisthai

    pisthai Imperfect Human

    Jul 29, 2009
    7,222
    2,272
    240
    #9 pisthai, Apr 6, 2014
    Last edited: Apr 6, 2014
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Flipp3r

    Flipp3r MDL Expert

    Feb 11, 2009
    1,962
    904
    60
    Don't worry about volumes.
    lis dis
    sel dis 0
    lis par
    Volumes will always be all over the place...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...