How to Rescue Windows Files Across a Network

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

How to Rescue Windows Files Across a Network

#1 Post by rcrsn51 »

Suppose you have a Windows machine that won't boot or whose hard drive is failing. You want to rescue your "Documents and Settings" folder but don't have a USB drive big enough to hold it. With a few commands, you can use Puppy to transfer the files to another machine on your network.

1. Boot the destination Puppy machine.

2. Use the "ifconfig" command to determine its IP address.

3. Open a folder on a partition large enough to hold the incoming Windows files.

4. Inside the folder, open a terminal and type the following command.
Note that it has an "ell" in it. Don't forget the "-" symbol at the end!

Code: Select all

nc -l -p 1234 | tar -zxf - 
Your Puppy machine will sit there listening for incoming data on Port 1234.

5. Boot the Windows machine off a Puppy Live CD.

6. Mount the Windows partition and open its folder.

7. Inside the folder, open a terminal and type the following command.
Use the IP address of the destination machine. Don't forget the "-" symbol after the zcf!

Code: Select all

tar -zcf - "Documents and Settings" | nc -w 2 aaa.bbb.cc.dd 1234
This code will build an archive of your Documents and Settings folder, then send it across the network to the destination machine's IP address. You should see files being created in the destination folder. When done, both commands will terminate.

If you are not comfortable with this kind of command-line procedure, you might want to try a test run first. On a Windows machine, make a folder with some dummy data. Then practice sending it to a Puppy machine.

-----------------------------

You can use the same procedure to clone an entire Windows partition from one machine to another. (However, there is no guarantee that Windows will boot on the hardware of the new machine.)

1. On the receiving machine:

Code: Select all

nc -l -p 1234 | zcat | ntfsclone --restore-image --overwrite /dev/sda1 -
2: On the sending machine:

Code: Select all

ntfsclone --save-image --output - /dev/sda1 | gzip -c | nc -w 2 aaa.bbb.cc.dd 1234
In both commands, note the locations of the "-" symbols. Change the /dev/sdxy partitions to match your setup.
Last edited by rcrsn51 on Mon 24 Oct 2011, 10:21, edited 3 times in total.

Nicky
Posts: 10
Joined: Tue 11 Oct 2011, 00:06

#2 Post by Nicky »

Great post! Just what I've been looking for, ever since my (old) laptop doesn't boot vista anymore. Bought a new laptop running Win 7 a few days ago. Have booted that one with a lupu 501 live CD a number of times and it runs fine. (Also tried to update to 528, but X won't load) :(

Both laptops have sda1, sda2, and sda3 partitions, and on the new one I just added an sda4 partition. What I basically want to do is copy the sda2 and sda3 partitions of the old computer onto the new sda4 partition. Or, if that complicates things, I could split the latter and create an sda5. The idea is to be able to access the files and programs I still need. How that's accomplished doesn't matter much; booting doesn't enter into it. (Later on I hope to install Puppy on the as yet unallocated back-end of my drive and make it accessible from within Win 7. Or if that's impossible, boot into it from usb)

So what I've got is an old laptop (usb booted) and the pertinent partitions looking like /mnt/sda2 and /mnt/sda3 and the new laptop pertinent partition so far being /mnt/sda4 The two are connected with a lan crossover cable.

Now if I needed to copy only a single partition, as far as I understand your command codes, I would have to substitute /dev/sda1 with /mnt/sda4 :
on both machines, is that correct? Anything else you can advise me to do?

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#3 Post by rcrsn51 »

If you want to use the second procedure above - cloning a whole partition - you must use /dev, not /mnt in the commands. Both the source and destination partitions must be unmounted.

But you can't clone two different partitions into the same destination. So you must use the first procedure - transferring folders. You can replace "Documents and Settings" with the * wildcard on the source machine.
Last edited by rcrsn51 on Sat 22 Oct 2011, 11:19, edited 1 time in total.

Nicky
Posts: 10
Joined: Tue 11 Oct 2011, 00:06

#4 Post by Nicky »

Thanks for replying. As I'm obviously a newbie at this, I hope my questions aren't too obtuse. I'm dealing with wanting to copy a couple of 30 Gig partitions. And since I don't want to find out later I missed something, I'd like to get it all over to the new machine. There isn't enough room left on the old unit to make tarballs first; so copying the old machine's sda2 and sda3, each to its own folder on sda4 of the new laptop, is what I've got in mind. Since everything in linux is a file, that should be possible with nc, no? Would this be taking hrs or days?
I had a network going before, (pinged it) with IP addresses 192.168.0.1 for the source machine and 192.168.0.2 for the destination machine. Is there anything special about port 1234?
Could you please give me the codes to type into both machines? Thanks in advance!

cthisbear
Posts: 4422
Joined: Sun 29 Jan 2006, 22:07
Location: Sydney Australia

#5 Post by cthisbear »

No disrespect to rcrsn51, and not meaning to derail his post.....

However....Nicky, you could do the same with Teamviewer in Puppy

and use the same program in Windows.
Simplicity.

Or boot both machines off a Hiren's boot cd
and use the inbuilt Teamviewer in Mini Windows.

" or whose hard drive is failing. "

Puppy is usually better at grabbing data off dead drives.
Although recent Hiren's have a USB plugin,
you can mount an external drive after booting.

If it wasn't too hard I would take the drive out anyway,
subject to having a spare USB adapter.

And then boot.....connect after the desktop comes up.
With faulty drives....speed is the key.

Apologies again to >> rcrsn51.

""""""

Puppy version >> Lucid.

File:teamviewer_wine.pet 18179 KB 8/09/2010 12:00:00 AM

Near the bottom of

ftp://distro.ibiblio.org/puppylinux/pet-packages-lucid/

http://www.teamviewer.com/en/index.aspx

http://www.hirensbootcd.org/download/

http://www.teamviewer.com/en/products/screenshots.aspx

Chris.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#6 Post by rcrsn51 »

Is there anything special about port 1234?
No. you can pick any port number you want.
Would this be taking hrs or days?
It's probably more like minutes than hours.
There isn't enough room left on the old unit to make tarballs first;
That's not a problem. The tarball isn't permanent. As it is created, it is automatically sent across the network.
Could you please give me the codes to type into both machines?
They are exactly what I have listed above. As a test, replace "Documents and Settings" with the name of a folder in the source partition and see what happens.

Nicky
Posts: 10
Joined: Tue 11 Oct 2011, 00:06

#7 Post by Nicky »

@rcrsn51 Appreciate your interest and the prod message. I still haven't been successful with applying your lines of code. Could it be that's because I don't have a true puppy box and am booting both units from media? Unlikely I'd say since the problem appears to me to be at the sending end, and that one is media-booted in your example too. But if that's yet the case, I could do a hdd install, but would prefer not having to dual boot. Anyway, so far nothing happens. The first unit indeed sits there and listens. But the second unit executes the code without error messages and gives me a # for a new line. It also seems to me we've been talking past one another a bit. I've been trying to find a means to transfer sda(x) and you fall back on suggesting the method to transfer a folder _in_ sda(x). I've got about 50 of those just in sda3 and will buy an external drive (adapter) instead, if that's the only option. The above attempt though refers to your suggestion; that is by opening an xterm within sda(x). I've also tried to transfer the "home" folder in /mnt (it being in the same directory, but so much smaller than sda(x)); but with the same non-result. I looked at /dev too, but nothing there to open. I've only established a working network by pinging. Should that be enough or is there another method by which to test this?

@Chris Appreciate your butting-in too, but the options you offered haven't panned out for me yet either. Teamviewer seems a bit complicated, having to set up accounts on both machines, but I may still end up doing that. Booting a miniXP on both units seemed the easiest, but the eth0 NICs in both of them needed "unavailable" resources; and I don't know how to free those up, so that the NICs can be made active. I've been burning half a dozen of DVD toasters trying to do a direct transfer. Don't know if I've got lousy media or the lens need cleaning. Do you need a special cloth for that? I don't want to end up scratching it.

If I can't get the partitions copied over a network, I guess I'll end up buying a usb-hdd adapter (thanks for the suggestion) and take the hdd out. There's nothing wrong with my drive. The reason I can't boot vista is because my screen overheated (it being in the path of a hot air stream) and shut the unit down into hibernation mode. Now when I boot vista, it autom. goes into hibernation after having loaded a bunch of drivers. Acer doesn't want to supply the information which of its (corrupted) drivers are involved, and wants me to do a destructive "system restore" instead. And the reason I bought another laptop is because my screen now flickers or is off about 5% of the time and I'm using an external monitor for it.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#8 Post by rcrsn51 »

This method will work fine when booting off the Puppy CD's. You don't need to do an install.

If you had this working, you could transfer all of the folders in one shot by using the * wildcard instead of "Documents and Settings".

The fact that you are not getting any errors on the sending machine suggests a networking problem. Read here. However, these instructions appear to have the IP addresses switched.

Also, see the instructions below.
Last edited by rcrsn51 on Mon 24 Oct 2011, 16:13, edited 3 times in total.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#9 Post by rcrsn51 »

OK. I don't own a crossover cable, so I connected two machines to a little 5-port hub using regular cables.

I booted both machines off a Puppy 4.3.1 CD because it does not do auto-networking.

On the sending machine I typed

Code: Select all

ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up
ifconfig
The second command confirmed the IP address 192.168.0.1

On the receiving machine I typed

Code: Select all

ifconfig eth0 192.168.0.2 netmask 255.255.255.0 up
ifconfig
The second command confirmed the IP address 192.168.0.2

On each machine, I pinged the other.

On the receiving machine, I opened the destination folder and typed

Code: Select all

nc -l -p 1234 | tar -zxf -
The above command has an "ell" in it.

On the sending machine, I opened the source folder and typed

Code: Select all

tar -zcf - * | nc -w 2 192.168.0.2 1234
When both commands terminated, all the content in the source folder had been transferred to the destination folder.
Last edited by rcrsn51 on Mon 24 Oct 2011, 10:26, edited 1 time in total.

Nicky
Posts: 10
Joined: Tue 11 Oct 2011, 00:06

#10 Post by Nicky »

You're right, it worked!! Don't know what I did different this time though. There was a hiccup in my 4-Gig music folder (unexpected EOF error message at the destination end, and a 7MB space filled up with 0s error message at the source end. Transferred that folder all by itself, re-transferred the * and no more problems. Except I ended up with a 7MB undeletable (nested) file (from the first transfer) at the destination end. But what the heck, main problem is solved. Thanks a lot! I'm sure a lot of people are going to take advantage of those two simple lines of code.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#11 Post by rcrsn51 »

What Puppy did you use to make the transfer?

How did you set up your networking?

How long did it take to do the file transfer? Per GB?

This is useful information for other community members.

Nicky
Posts: 10
Joined: Tue 11 Oct 2011, 00:06

#12 Post by Nicky »

What Puppy did you use to make the transfer?

5.0.1


How did you set up your networking?

As per the crossover-cable HOWTO you suggested (I'd found it before)


How long did it take to do the file transfer? Per GB?

I'd say roughly about a GB/min.


This is useful information for other community members

Glad to have been of some help too

Post Reply