Find the answer to your Linux question:
Results 1 to 3 of 3
At my computer shop where I work, we got alot of used PC's from some place. It's my job to refurbish them for resale. Each computer comes with XP pro. ...
  1. #1
    Just Joined!
    Join Date
    Jan 2009
    Posts
    1

    Question Auto XP partion restore

    At my computer shop where I work, we got alot of used PC's from some place. It's my job to refurbish them for resale. Each computer comes with XP pro. So the boss man asks me if there is a way to put a XP restore option. I say yes if I install Linux on a small partion and use partimage to make a image of the XP partion and store in on the Ubuntu side. I wrote a small shell script so the end user could restore XP without having to bring it in the shop when they foul XP up.

    Here is the script:

    Code:
    #!/bin/bash
    # System Restore
    
    
    echo "***************************** XP System Restore *****************************"
    read -n 1 -p "Press any key to continue"
    
    echo "This will restore your Windows XP installation"
    
    echo "********************YOU WILL LOSE ALL DATA IF YOU CONTINUE********************"
    echo "ONLY RUN THIS IF YOU WANT A FRESH INSTALL OF XP"
    echo "Y to continue N to exit Y/N"
    
    read a
    if [[ $a == "N" || $a == "n" ]]; then
    read -n 1 -p "Press any key to continue..."
    exit
    
    else
    
    if [[ $a == "Y" || $a == "y" ]]; then
    echo "Restore System Now? **Warning** ALL DATA WILL BE ERASED!! Y/N?"
    read a
    if [[ $a == "N" || $a == "n" ]]; then
    exit
    else
    if [[ $a == "Y" || $a == "y" ]]; then
    read -n 1 -p "Press any key to continue... The password is owner"
    sudo partimage restore /dev/sda1 /home/owner/XP-Restore.000
    
    fi
    fi
    fi
    fi
    It works fine but not simple enough for end users (So the Boss Man says). So I edited GRUB so it would only give two options "Windows XP Pro" and "System Restore"--Ubuntu--.

    Is there a way to have the script auto run on boot or login and have partimage restore without any input from the end user other then the Y/N questions that I have in the script.

    If anyone can help me out here it would be greatly appreciated



    Would the use of flag -BX work here.

    * -BX, --fully-batch=X batch mode without GUI, X is a challenge response string


    I don't understand the batch = X part... is the X meant to be replaced with something or would the command just look like this:
    Code:
                
    sudo partimage restore -BX /dev/sda1 /home/owner/XP-Restore.000

  2. #2
    Linux User
    Join Date
    Apr 2007
    Posts
    289
    Can this task not be accomplished doig a 'fixmbr' execution?

    If so, this can be done with ANY XP CD, following these commands here:

    Recovery Console - How to Enter Windows XP Recovery Console

  3. #3
    Linux Guru
    Join Date
    Jan 2009
    Location
    Dover, NH
    Posts
    1,633
    Somehow I think Linux is actually overkill for this operation. Perfect for even novice computer users, but total newbies, I have to agree with your boss, The program needs to start by itself on boot and require pretty much a warning and a "yes or no" input only, nothing else. It should also be small and self contained. I have a solution that is similar to one I use for Windows machines:

    FreeDOS & Partition Saving (remember Norton Ghost?)

    You can either use the built-in OS start-up menus and fdisk scripts to swap the active partitions and restart into the recovery partition, or, you can use another freeware boot-loader that doesn't require linux (like Ranish/XOSL). I suggest the former, since a fumbling Windows trying to fix itself is known to wipe the MBR on you with little or no warning. Of course, you can still use your linux CD (or maybe something simpler, like the gPartED CD) to make the partitions in the first place.

    Just an idea, you're the tech. Luck to you whatever you chose!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...