help determining what hard drive number to use with acronis trueimagecmd

Discussion in 'Acronis True Image Product Line' started by gamer1000k, Jul 20, 2007.

Thread Status:
Not open for further replies.
  1. gamer1000k

    gamer1000k Registered Member

    Joined:
    Jul 20, 2007
    Posts:
    10
    I have the Acronis TrueImage Workstation 9.1 plugin installed in BartPE. I copied trueimagecmd.exe to the plugin directory so now I have command line abilities. I'm trying to automate the process so that when the cd is inserted, it will automatically image the hard drive. The problem I'm running into is automatically determining what hard drive to use. I can't rely on the contents of the hard drives, as the hard drives may be blank or corrupt, and there may be usb hard drives plugged in that would change the hard drive number so it is no longer 1. I've figured out how to parse diskpart to find a hard drive number based on hard drive size, but diskpart's number for the hard drives doesn't correspond to acronis. I've looked at the acronis list command, but it seems to size the hard drive by sectors and if there are multiple partitions it splits it up over multiple lines, making parsing very difficult. Does anyone know of a good way to automatically determine what the primary hard drive is (preferably based on location on the IDE or SATA bus) and convert that number to correspond with acronis' numbering scheme? All the computers this will be used on will only have one logical internal drive, any additional drives would be usb external. Thanks in advance for your suggestions.
     
  2. jmk94903

    jmk94903 Registered Member

    Joined:
    Jul 10, 2004
    Posts:
    3,329
    Location:
    San Rafael, CA
    I've never seen the first internal drive be anything but drive 0 or drive 1 depending upon the BIOS or program. TI uses Drive 1 but Windows uses Drive 0.

    USB drives, CDs, etc. are all higher numbers, or have you actually found a case where a USB drive has a lower number than the internal hard drive?
     
  3. gamer1000k

    gamer1000k Registered Member

    Joined:
    Jul 20, 2007
    Posts:
    10
    That's the problem I'm having, if a usb drive is plugged in at startup, it gets detected first and gets a lower drive number than the internal hard drive
     
  4. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,483
    Location:
    California
    Most newer computers do this. They automatically put USB devices ahead of internal devices (especially if you're booting from one of them).

    Can you clearify a few points?

    Why does the internal hard drive ONLY have a logical partition? Is it a non-Windows system? There is not a Primary partition? Or do you just mean there is only ONE internal hard drive?

    Is the backup image you would want to restore on the USB external? In this case you'd need to also figure out which external (if more than one are connected) is the correct one.

    Do you have a specific reason to need to be able to image a drive that is empty or corrupt?

    Have you considered "tagging" the external drives? That way you could find them and the "untagged" drive would be the internal drive.
     
  5. gamer1000k

    gamer1000k Registered Member

    Joined:
    Jul 20, 2007
    Posts:
    10
    The computers should only have one drive number for the internal drives because the hard drives are connected to a RAID controller and all the drives are part of the same array.

    The hard drives will likely be blank or corrupt because the purpose of this cd is a restore cd that can be used for initial imaging or to repair a corrupted image.

    The images are not all windows, some are linux and sometimes they would be on an external usb drive, right now we can determine the drive letter for the usb drive by tagging the drive with a specific file or folder that can be easily searched for. This only gives the drive letter though, which works fine for loading an image file, but is useless for actually getting a hard drive number, especially if there are multiple partitions and I'm trying to repair the image.
     
  6. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,483
    Location:
    California
    Do the partitions change on the computers you're trying to restore?

    In other words, for each computer, does the partition structure of the internal drive remain the same, no partition changes, etc.

    If they do stay the same, then you might be able to create a "map" for each computer and put that on the BartPE cd. That way it could recognize the internal drive by comparing it to the "map" and pick it from the list. If it couldn't find a match then the script would have to abort since you wouldn't want to accidentally restore to the wrong drive.
     
  7. gamer1000k

    gamer1000k Registered Member

    Joined:
    Jul 20, 2007
    Posts:
    10
    I want to try to avoid anything that relies on a particular drive structure because (right now at least) there are a bunch of different images floating around that need to be tested, and they are constantly changing. Eventually once there are a limited number of images that might work, but right now everything is kind of in a testing phase and they want this cd to speed up the testing process now and then later be used to image and restore computers.
     
  8. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,483
    Location:
    California
    Could you post diskpart output and the Acronis List command output samples? It may help to see exactly what you're referring to.
     
  9. gamer1000k

    gamer1000k Registered Member

    Joined:
    Jul 20, 2007
    Posts:
    10
    Diskpart:

    Microsoft DiskPart version 5.2.3790.1830
    Copyright (C) 1999-2001 Microsoft Corporation.
    On computer: BARTPE-16592

    Disk ### Status Size Free Dyn Gpt
    -------- ---------- ------- ------- --- ---
    Disk 0 Online 75 GB 0 B
    Disk 1 Online 136 GB 0 B

    Acronis:

    Num Partition Flags Start Size Type
    ---- -------------------- ----------- ---------- ---------- -----------
    Disk 1:
    1-1 FAT16 Pri 63 31941 FAT16
    1-2 NTFS (D:) Pri,Act 32004 9473184 NTFS
    1-3 NTFS (F:) Pri 9505188 146786346 NTFS
    Disk 2:
    2-1 FAT16 Pri 63 32067 FAT16
    2-2 NTFS (C:) Pri,Act 32130 17109225 NTFS
    Table 17141355 Table
    2-3 NTFS (E:) 17141418 268317567 NTFS

    these were both done on the same computer without changing any drives, note the fact that the usb drive is the first drive listed in both cases
     
  10. MudCrab

    MudCrab Imaging Specialist

    Joined:
    Nov 3, 2006
    Posts:
    6,483
    Location:
    California
    This is what I get using DiskPart on my computer when booted into BartPE with one USB hard drive attached:

    Code:
    This is what I get on my computer with this drive setup:
    Disk 0 is the USB disk
    Disk 1 is a RAID setup
    Disk 2 is a single disk
    Disk 3 is a single disk
    
    DISKPART> list disk
    
      Disk ###  Status      Size     Free     Dyn  Gpt
      --------  ----------  -------  -------  ---  ---
      Disk 0    Online        75 GB      0 B
      Disk 1    Online       298 GB      0 B
      Disk 2    Online       298 GB      0 B
      Disk 3    Online       298 GB      0 B
    
    DISKPART> select disk 0
    
    Disk 0 is now the selected disk.
    
    DISKPART> detail disk
    
    SEAGATE ST380021A [B][COLOR="blue"]USB Device[/COLOR][/B]
    Disk ID: 82A8BB89
    [B][COLOR="Blue"]Type   : USB[/COLOR][/B][B][COLOR="Red"]
    Bus    : 0
    Target : 0[/COLOR][/B]
    LUN ID : 0
    
      Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
      ----------  ---  -----------  -----  ----------  -------  ---------  --------
      Volume 1     E   TIBACKUPS    NTFS   Partition     75 GB  Healthy
    
    DISKPART> select disk 1
    
    Disk 1 is now the selected disk.
    
    DISKPART> detail disk
    
    Seagate Raid 0
    Disk ID: 257D257D
    Type   : IDE
    [B][COLOR="Red"]Bus    : 3
    Target : 0[/COLOR][/B]
    LUN ID : 0
    
      Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
      ----------  ---  -----------  -----  ----------  -------  ---------  --------
      Volume 2         VISTA        NTFS   Partition    148 GB  Healthy
      Volume 3         GAMES        NTFS   Partition     80 GB  Healthy
      Volume 4     C   WORK         NTFS   Partition     39 GB  Healthy
      Volume 5                             Partition     30 GB  Healthy
    
    DISKPART> select disk 2
    
    Disk 2 is now the selected disk.
    
    DISKPART> detail disk
    
    ST3320620AS
    Disk ID: 25D025D0
    Type   : IDE
    [B][COLOR="red"]Bus    : 3
    Target : 1[/COLOR][/B]
    LUN ID : 0
    
      Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
      ----------  ---  -----------  -----  ----------  -------  ---------  --------
      Volume 6     D   SEAGATE320   NTFS   Partition    282 GB  Healthy
      Volume 7                             Partition    204 MB  Healthy
      Volume 8                             Partition   2094 MB  Healthy
      Volume 9                             Partition     14 GB  Healthy
    
    DISKPART> select disk 3
    
    Disk 3 is now the selected disk.
    
    DISKPART> detail disk
    
    ST3320620AS
    Disk ID: FE6D3F3D
    Type   : IDE
    [B][COLOR="Red"]Bus    : 3
    Target : 2[/COLOR][/B]
    LUN ID : 0
    
      Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
      ----------  ---  -----------  -----  ----------  -------  ---------  --------
      Volume 10                            Partition     15 GB  Healthy
      Volume 11                            Partition     14 GB  Healthy
      Volume 12                            Partition     13 GB  Healthy
      Volume 13                            Partition     12 GB  Healthy
      Volume 14                            Partition     11 GB  Healthy
      Volume 15    F   SHARE        FAT32  Partition     10 GB  Healthy
      Volume 16    G   DATA         NTFS   Partition    223 GB  Healthy
    The USB drive is listed as a USB drive under the details.

    Do you know if the Bus and Target IDs match up with what TI is assigning?

    I don't have the Workstation version so I can't run trueimagecmd.exe and find out.
     
  11. gamer1000k

    gamer1000k Registered Member

    Joined:
    Jul 20, 2007
    Posts:
    10
    I don't think they correspond very well, because in some situations diskpart will skip drive numbers and I've never seen acronis do that. I had a setup with diskpart working before (using the hard drive size to determine the correct drive) but I ran into issues with the drive numbers not being consistent with acronis.
     
  12. gamer1000k

    gamer1000k Registered Member

    Joined:
    Jul 20, 2007
    Posts:
    10
    if you want to test out trueimagecmd, the exe is included with the workstation free trial
     
Thread Status:
Not open for further replies.