G'day,

Following up from Kent's posting about accessing the local hard disk and his desire to be able to restore his classroom PC's using LTSP, I've had a bit of a play around and have managed to get LTSP to do this. It's so simple yet if any Sys admins out there have ever had the (dis)pleasure of using commercial backup software to try and restore a windoze boxen image after it's destroyed itself, (install the OS from CD (keying in license keys etc, then reboot and overwrite the minimal install with the backup image, recover the registery, stuff around, doesn't work, won't boot etc etc) you might find this an interesting idea.

So,

I partitioned the PC's disk into two, the first partition being 150Mb and the second being the remainder of the disk. I installed a PC operating system (Nt4.0) on hda1.

I installed the 3.0.12 ltsp kernel and configured MODULE_01 = ide-disk, & SCREEN_01 = shell in lts.cfg on the server. I exported /home on the server as read/write in /etc/export and rom-o-magic'd a boot floppy for the PC's network card. I re-booted the PC off the etherboot and had it come up as an LTSP workstation. Then I made an image of (part) of the PC's disk.

dd if=/dev/hda of=/home/images/pc1.dsk.img bs=1024 count=160000

I.E the first 160Mb of the disk. So this copied the boot sector, and the entire hda1 partition (C:), plus the initial few blocks of the second partition (D:). (I don't care if D: is properly restored, the point of the partitioning was so that dd doesn't have to copy a 2Gb image of mostly nothing).

I then destroyed the image on the local disk and tried to boot the PC off it's hard drive. It gave the "Operating system not found" message.

I then re-booted the PC off the etherboot floppy. Once at the shell prompt I issued the command

dd if=/home/images/pc1.dsk.img of=/dev/hda bs=1024

Once this was complete (a few minutes on a very fast network) I rebooted from the hard drive and "volia", my windoze installation was recovered. Cool!

So I wrote a couple of lines of shell script and set this as the command via lts.conf screen_01 = myshell, rebooted the PC via etherboot and once it's up it automatically starts backing up it's disk to the server.

Now I'm asking for some ideas to further "automate" this process.

It would be really cool to be able to control whether the PC boots local or net from the server end rather than at the PC. I guess some configuring in dhcp or tftp might be the answer? Any suggestions?

Next, I understand that some network cards listen on the network and it's possible to issue a "re-boot" command to the PC from the network? Is this true? Any ideas on this one. Otherwise I guess I could do some sort of cron job on the server and at command 10 mins later on the PC, that is simply relies on the server and PC being on about the same time, messy but would work. Or I need somehow to be able to issue a ssh command to an MS os boxen to re-boot (are there ssh servers for MS and even if so, can you re-boot MS from the command line?


Thanks for any ideas


Pete.

P.S I did try at first to copy the boot sector and the hda1 as two seperate images. The trouble is that on recovery, I restore the boot sector and partition table, by

dd if=/home/images/ws1.boot.img of=/dev/hda

but at this point the device file /dev/hda1 doesn't exist because the disk partition table wasn't present when the kernel loaded the ide-disk module. So I had to re-boot the workstation before I could restore the hda1 image. Would doing an rmmod ide-disk, insmod ide-disk cause the kernel to build /dev/hda1? This might mean you could do the boot sector using dd and the hda1 partition by mounting it and doing it with tar. Thus only backing up the actual content rather than an entire image of mostly empty blocks (in the case of a single 80Gb disk for example) Being an MS OS a file system based recovery will work because the kernel doesn't have to reside at a known block offset. Wouldn't work if the local PC image was Linux/lilo. But the fly in that ointment is that you would have to know the filesystem (experimental NTFS write module in the LTSP kernel anyone?)





-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
     https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net

Reply via email to