Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 30 Sep 2014, 14:39
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
How to Rescue Windows Files Across a Network
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [12 Posts]  
Author Message
rcrsn51


Joined: 05 Sep 2006
Posts: 9148
Location: Stratford, Ontario

PostPosted: Sun 11 Sep 2011, 21:35    Post subject:  How to Rescue Windows Files Across a Network  

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:
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:
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:
nc -l -p 1234 | zcat | ntfsclone --restore-image --overwrite /dev/sda1 -

2: On the sending machine:
Code:
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, 06:21; edited 3 times in total
Back to top
View user's profile Send private message 
Nicky

Joined: 10 Oct 2011
Posts: 5

PostPosted: Thu 20 Oct 2011, 21:20    Post subject:  

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) Sad

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?
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 9148
Location: Stratford, Ontario

PostPosted: Fri 21 Oct 2011, 03:47    Post subject:  

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, 07:19; edited 1 time in total
Back to top
View user's profile Send private message 
Nicky

Joined: 10 Oct 2011
Posts: 5

PostPosted: Fri 21 Oct 2011, 13:14    Post subject:  

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!
Back to top
View user's profile Send private message 
cthisbear

Joined: 29 Jan 2006
Posts: 3417
Location: Sydney Australia

PostPosted: Fri 21 Oct 2011, 14:33    Post subject:  

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.
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 9148
Location: Stratford, Ontario

PostPosted: Fri 21 Oct 2011, 16:07    Post subject:  

Quote:
Is there anything special about port 1234?

No. you can pick any port number you want.
Quote:
Would this be taking hrs or days?

It's probably more like minutes than hours.
Quote:
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.
Quote:
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.
Back to top
View user's profile Send private message 
Nicky

Joined: 10 Oct 2011
Posts: 5

PostPosted: Sun 23 Oct 2011, 17:24    Post subject:  

@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.
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 9148
Location: Stratford, Ontario

PostPosted: Sun 23 Oct 2011, 18:32    Post subject:  

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, 12:13; edited 3 times in total
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 9148
Location: Stratford, Ontario

PostPosted: Sun 23 Oct 2011, 19:47    Post subject:  

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:
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:
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:
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:
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, 06:26; edited 1 time in total
Back to top
View user's profile Send private message 
Nicky

Joined: 10 Oct 2011
Posts: 5

PostPosted: Mon 24 Oct 2011, 04:26    Post subject:  

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.
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 9148
Location: Stratford, Ontario

PostPosted: Mon 24 Oct 2011, 05:00    Post subject:  

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.
Back to top
View user's profile Send private message 
Nicky

Joined: 10 Oct 2011
Posts: 5

PostPosted: Mon 24 Oct 2011, 11:57    Post subject:  

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
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [12 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0905s ][ Queries: 12 (0.0040s) ][ GZIP on ]