Sponsored Content
Full Discussion: Auto XP partion restore
Top Forums Shell Programming and Scripting Auto XP partion restore Post 302280841 by Zewbie on Tuesday 27th of January 2009 04:36:55 PM
Old 01-27-2009
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 theshop 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 Image



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
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Partion size

hi, just need to know the disk size and the partition size on machine.pls let me know how to do that.is their a way i can get to know the size of directory.like /,/var...etc. thanx (2 Replies)
Discussion started by: saood
2 Replies

2. Linux

Doing stuff to files on a NTFS partion from linux

I have a 50GB section of my hard drive on which I've kept all my music, movies and more back from when I had Windows. When I'm in linux it says that the NTFS section is a read only section. Is it possible to copy, rename, add, move or delete any files off of this section? I'm trying to get rid... (2 Replies)
Discussion started by: CTroxtell21
2 Replies

3. UNIX for Dummies Questions & Answers

Partion Magic problems.

Hiya people, A great big "HI" to everybody. I'm new to the Forum and now to my problem(s). I am about to partition my only 80GB HD and using the Partition Magic 8 software it looks fairly simple although here is my problem :- 1. Do I change the new partition to primary or logical? 2. Do I... (4 Replies)
Discussion started by: Syndrome_00
4 Replies

4. Solaris

How to create on partion from 2 disks?

Hi everyone :b: I'm glade to join this forum and I have one question I installed latest Solaris 10 release on SF V480 with 2 73 GB disks 8 GB RAM 4 CPU's My configuration is 10GB for root, 8GB for Swap and 12GB for var. I mirrored root, so disk 1 has 40GB free of space and disk 2 has... (11 Replies)
Discussion started by: HishamN
11 Replies

5. AIX

mksysb restore - Wrong OS level for restore

Hi all, I am still working on my mksysb restore. My latest issue is during an alt_disk_install from tape I got the following error after all the data had been restored. 0505-143 alt_disk_install: Unable to match mksysb level 5.2.0 with any available boot images. Please correct this... (0 Replies)
Discussion started by: pobman
0 Replies

6. Linux

Centos 5 install. Partion order

I can't control the partion order during install. For example i need. hda5 /var 1GB hda6 /opt 2GB I created them in such order but OS adjust them to hda5 /opt 2GB hda6 /var 1GB It is frustrating during install, I pretty sure I can order the partion as i like... (0 Replies)
Discussion started by: honglus
0 Replies

7. Solaris

unable to boot afer restoring root partion manages by veritas

Hi all, After restoring the / FS on a netra 240. It is unable to boot the system. The message displayed is the following: "The file just loaded does not appear to be executable" Bellow, the content of /etc/vfstab before restoring: #more /etc/vfstab... (0 Replies)
Discussion started by: faberarnold
0 Replies

8. AIX

How to know exactly which physical partion contains data?

/dev/fslv01 5.00 2.90 42% 776 1% /movelv_testfslv01:/movelv_test LP PP1 PV1 PP2 PV2 PP3 PV3 0001 0175 hdisk1 0111 hdisk0 0002 0176 hdisk1 0112 hdisk0 0003 0177 hdisk1 0113 hdisk0... (10 Replies)
Discussion started by: bobochacha29
10 Replies
IPTABLES-RESTORE(8)						  iptables 1.6.1					       IPTABLES-RESTORE(8)

NAME
iptables-restore -- Restore IP Tables ip6tables-restore -- Restore IPv6 Tables SYNOPSIS
iptables-restore [-chntv] [-M modprobe] [-T name] [file] ip6tables-restore [-chntv] [-M modprobe] [-T name] [file] DESCRIPTION
iptables-restore and ip6tables-restore are used to restore IP and IPv6 Tables from data specified on STDIN or in file. Use I/O redirection provided by your shell to read from a file or specify file as an argument. -c, --counters restore the values of all packet and byte counters -h, --help Print a short option summary. -n, --noflush don't flush the previous contents of the table. If not specified, both commands flush (delete) all previous contents of the respec- tive table. -t, --test Only parse and construct the ruleset, but do not commit it. -v, --verbose Print additional debug info during ruleset processing. -M, --modprobe modprobe_program Specify the path to the modprobe program. By default, iptables-restore will inspect /proc/sys/kernel/modprobe to determine the exe- cutable's path. -T, --table name Restore only the named table even if the input stream contains other ones. BUGS
None known as of iptables-1.2.1 release AUTHORS
Harald Welte <laforge@gnumonks.org> wrote iptables-restore based on code from Rusty Russell. Andras Kis-Szabo <kisza@sch.bme.hu> contributed ip6tables-restore. SEE ALSO
iptables-apply(8),iptables-save(8), iptables(8) The iptables-HOWTO, which details more iptables usage, the NAT-HOWTO, which details NAT, and the netfilter-hacking-HOWTO which details the internals. iptables 1.6.1 IPTABLES-RESTORE(8)
All times are GMT -4. The time now is 06:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy