PDA

View Full Version : One PC, 2 drives, copying/moving date from one to the other



Torriatte
11-16-2004, 08:40 PM
Hi Folks,

Very new to Knoppix but VERY impresed. Had a key users's HD "croak"; at least according to Windows...

So I stuck this HD into another working PC that had a HD in it and room for a second and booted up Knoppix.

I can see both drives fine.

The original HD (to this working PC) shows as Hard Disk Partition (hda1)
The problem HD shows as Hard Disk Partition (hdb1)

scottknl
11-16-2004, 09:49 PM
There are a couple of ways you can do things.

Easy way: Mount both drives and use cp or mv to copy or move the data from one to the other. cp makes a copy of the data. mv moves the data from one spot to another.

mount /dev/hda1 /mnt/hda1
mount /dev/hdb1 /mnt/hdb1

cp /mnt/hda1/* /mnt/hdb1/
or
mv /mnt/hda1/* /mnt/hdb1/
Be sure to unmount the drives when youre done.
cd /
umount /dev/hda1
umount /dev/hdb1
A common problem in unmounting drives is that you have some console window pointing at the drive. The system will not let you unmount the drive until no command prompt is pointing to it.


Another way is to create an image of the data and then store the image on the other drive.
mount /dev/hdb1 /mnt/hdb1
dd if=/dev/hda1 of=/mnt/hdb1/image_of_hda1.img bs=64000
To read the data again you would mount the drive, and then mount the image
mount /dev/hdb1 /mnt/hdb1
cd /mnt/hdb1
mkdir hdamount
mount -o loop /mnt/hdb1/image_of_hda1.img hdamount
Now when you look at the directory hdamount, you will see the image of the drive you copied.
Once you're finished with your data, remember to unmount the drives.
First the image file:
cd /mnt/hdb1
umount /mnt/hdb1/image_of_hda1.img
Then the drive:
cd /
umount /dev/hdb1

Hope this helps

Torriatte
11-17-2004, 03:24 PM
Wow - that had to be the dumbest post to this list (by me NOT you !).

I had started that post and was trying some other stuff before buggnig folks and spaced this. I guess it went ahead and posted it for me (?). Can it do that if a certain amount of time has passed ?

Thanks for your reply anyway, that is awesome :-)

What you mention doing requirs me to not be in the GUI correct ? How do I do that since this boots up in the GUI ?

I tried doing it from Terminal and that was a no go. I don't know a whole heck of a lot about Linux, obviously :-)

I was HOPING to do it from the GUI. I can open both drives, but if I "hover" over them before actually opening either one, you get the drive info and the both say Writable: NO so does that prevent me from "dragging" the one folder I want on hdb1 to hda1 ?

I try and do that and it just "sits" there...

So confused; sorry !

Chuck

OErjan
11-17-2004, 05:24 PM
you can be in gui just fine.
open a console and type the scomands.
you get a console by clicking that icon looking like a screen that has a shell glued to the front:


sudo mount -t vfat /dev/hda1 /mnt/hda1
sudo mount -t vfat /dev/hdb1 /mnt/hdb1
this is if you have fat32 filesystem on the drives.
if you have NTFS you must read some on captive NTFS and use that for the disk you are writing to.
a safer option (that will wipe the new disk) is to format it to fat32, but that makes it hard to get linux writing files larger than 2Gb and NECESARY that NO file is larger than 4Gb-1B (one byte less than 4G), that is limit of the filesystem.
now to copy iu would use

cp -a /mnt/hda1/* /mnt/hdb1/
the -a makes it an ARCHIVE copy, that is, permisions, filestructure, directories... are as close a "clone" as can be made short of dd.

Harry Kuhman
11-17-2004, 09:02 PM
Hi Folks,

Very new to Knoppix but VERY impresed. Had a key users's HD "croak"; at least according to Windows...

So I stuck this HD into another working PC that had a HD in it and room for a second and booted up Knoppix.

I can see both drives fine.

The original HD (to this working PC) shows as Hard Disk Partition (hda1)
The problem HD shows as Hard Disk Partition (hdb1)

Yiou know, I don't see a question anywhere in the post.

I also am not sure why Knoppix was even used, after the "bad" CD was moved to a second Windows computer, could that computer read the other drive? Did you try? If there was an error, what was it?

What sizes are the disks, and, if you are actually trying to recover something, how big is what you want to recover? And since you seem to have things working, are you actually asking the group anything, or just happy to report that Knoppix could see the drive and let you at the file?

Torriatte
11-17-2004, 09:29 PM
Harry,

I had posted an explanation to the misfire earlier today :-)

My problems is I had a key PC say the HD was bad.
So I stuck that drive in another PC that could hold a second drive and boot with Knoppix OK (this PC with the bad drive would not boot into the GUI. It is a Celeron and all the others are Pentium. Not sure if that would have caused that ? Plus it could only handle on drive and I needed to get data OFF of the bad drive and onto something else).

When I try doing the Copy (click on the folder I want on HDB1 and "drag" it to HDA1 or click on it and select Copy and the click on HDA1 and selet Paster) in the GUI a box pops up tellig the # of files, etc and its says the process is "Stalled".

Any idea what is going on ?

Thanks !

Chuck

Harry Kuhman
11-17-2004, 10:10 PM
Any idea what is going on ?

I'm still missing a lot of what's going on and going wrong.

I understand that you moved the drive into a second computer (not sure that was needed, but it's there now). OK, you couldn't boot that drive's windows (since it's in a computer is wasn't installed for), but you should be able to boot the original copy of windows for that computer (and you did install the drive you moved as a second drive, rather than replacing the drive that was in that computer. What happens if you just boot windows? Can you see the second drive at all?

Even if you could only boot the computer into DOS (maybe even if you used a DOS floppy), you should still be able to see both drives and see and move files.

But this is a Knoppix forum, so lets assume that we want to find a way to use Knoppix to recover whatever you want to recover. Just what is that? What do you need to recover, how many files and what total size? Do you haveplenty of space on the other hard drive?

What format is each partition on each drive? Are you aware that Knoppix can write to a FAT partition, but should never be used to write to a NTFS partition? Do you know that you have to remount a partition as read/write before you can write to it, and did you do that?

Torriatte
11-17-2004, 10:23 PM
Harry,

I am SO sorry I am confusing this. If that initial post had not gotten posted until I was done filling it out :-(

This "bad: drive is 20GB and the "good" one is 80GB. You cannot boot the "bad" drive.

I installed it into this second PC because I have about 1.6GB of stuff on the bad drive that I need to recover. I tried my usual Windows/DOS utilities with not luck. So another mailing list I subscribe mentioned Knoppix and I downloaded that and THAT CD is in the CD drive on this computer and I am booting Knoppix up and working (or trying to) within it.

So can I stay on the Knoppix forum ? :)

Thanks !

Chuck

Harry Kuhman
11-17-2004, 10:42 PM
So can I stay on the Knoppix forum ? :)

Thanks !

Chuck

You can certainly stay on the forum, but since I still don't know the partition types or if the destination partition has been opened read/write, I think there's not much more I can do to help in that area.

I recently took part in a discussion with another user who was trying to recover files. He had a CD writer on a computer, and I fould I could create a bootable CD and then write up to 650 megs of additional files to it, that could then be recovered on another system later. (the CD was no longer bootable after this, but that's a very minor issue, it had the needed data, which was the point). If making a few of these CDs sounds of interest to you read this thread: http://www.knoppix.net/forum/viewtopic.php?t=14781&start=0

We know very little about your situation, other than you have at least two computers. Rather than moving hard drives I would have tried to network them and transfer the files between them. (I'm a Linux lightweight and when I have files I'm in fear of loseing is not the time I want to fight with things like Samba, so I would likely just transfer then with FTP. I'm just saying that's what I would do, not that's what you are doing should not work, and I don't know if you have the hardware to network your computers.

Torriatte
11-18-2004, 07:05 PM
Thanks for lettting me stay Harry :-)

I'm sorry I'm not being clear enough on this. The other PC would not let me boot up into Windows OR Knoppix. So I could do nothing like FTP, Samba, etc.
That is why I took the drive out and stuck it into another PC. At first I was just interested in seeing what Knoppix could do. We had gotten quote THOUSANDS of $'s to recover the HD and that did not go over well :-)

I read that link thanks but still do not understand why I cannot do what I need under Knoppix via the GUI.

I have the bad drive (20GB and a good drive (80GB) in this other PC.

If I hover over the drives on the Desktop in the Knoppix GUI I see:

(Good Drive) Hard Disk Partition hda5 (this dricve changed from the earlier hda1 that was having issues - when it rains it poors...)

Type: Desktop Config
Size: 390B
Modified: 11/17/04 03.52 pm
Owner: knoppix - knoppox
Permissions: -rw-r--r--
Name: Hard Disk Partition [hda5]
Type: Device
Device: /dev/hda5
File System: auto
Mount Point: /mnt/hda5
Writable: No

(Problem Drive) Hard Disk Partition hdb1

Type: Desktop Config
Size: 390B
Modified: 11/17/04 03.52 pm
Owner: knoppix - knoppox
Permissions: -rw-r--r--
Name: Hard Disk Partition [hdb1]
Type: Device
Device: /dev/hdb1
File System: auto
Mount Point: /mnt/hdb1
Writable: No

I can access either drive. On hdb1 (bad) I can go to the data directory, pick a Word or Excel file and open it in OpenOffice.

But when I try to copy and paste from an hdb1 window to an hda1 window it opens:

Copy File(s) Progess window
Source: file:/mnt/hdb1/Data Lee Supply
Destination: file/mnt/hda5
0%
156 folder 1327 files
Stalled

Keep this window open after transfer is complete

Open File (greyed out) Open Destination Cancel

And it just sits there.

That help ? :-)

Thanks,

Chuck

Cuddles
11-18-2004, 08:05 PM
Torriatte,

I think the frustration is; one, due to the fact that Linux ( Knoppix ) is NOT windows, and thus, does not do like Windows does, its a little different. Two, people are trying to help you, but, to help, the best we can, we need information on your situation. So, when someone is asking for something, we are basing a "solution" on the information provided...

Harry is working on the premise that you said the systems were "Windows", windows uses, at last count, five different formats; fat, fat16, fat32, VFat, NTFS - of these formats, Linux has problems with those that are "proprietary", like NTFS - So, if your drives are formated as NTFS, you might have problems anyway. But, lets assume, since you aren't answering that "posted" question, that they are in fat / Vfat, and proceed...

Knoppix doesnt work the same way as your Windows, lets get that out of the way first. You dont click on a shortcut on the desktop and drag it, thats a Windows thing, not Linux. Those shortcuts for your drives, on your desktop, in Knoppix, are not the PHYSICAL drive, but, simply shortcuts, if you did manage to copy one, all you would be doing is copying the shortcut, not the data on that shortcut. To copy the "data" you have to do things a little differently, in Knoppix...

First thing, Knoppix 101:
If a shortcut to a drive, on your desktop, has a little corner in the bottom right, it means the drive is mounted, or openned, if it doesnt have this, it is possibly not mounted.

Knoppix opens things with one mouse click, left button, and gives "options" when you right click. If you left mouse click on a drive shortcut, if the drive is not mounted, it will try and mount the drive, before displaying its contents in a window.

By default, Knoppix will ALWAYS mount a drive as READ-ONLY -=- this is, by nature, for your protection, and the protection of your drives.

To accomplish a copy of data, from one drive to another, you will need to do a combination of mounting, and changing the write mode, from READ-ONLY to READ & WRITE, on your target drive - the one that you want to move / copy the files to...

Lets get you working:
RIGHT-CLICK on the drive that you want to copy the data TO, or, the TARGET drive.
If you have an option to MOUNT the drive, then select that, if the option does not show up, or an option saying "UNMOUNT" is available, then the drive is already mounted.
Now, RIGHT-CLICK on that same drive, this time, look for the option "Make Writtable", or something like that, and select that. That drive SHOULD now be able to be written to.
LEFT-CLICK on the FROM drive, the one that is "defunct" and you want to copy / move data off of. This should bring up a window of the disks contents.
LEFT-CLICK on the TO drive, the one that we want to copy / move the data to, and the same drive we did all the above operations on. This should also bring up, another, window of the disks contents.

Now the copy move process:
In the window that displays the DEFUNCT drives contents, RIGHT-CLICK on a file you want to copy / move, and choose either COPY or CUT ( copy will make a copy of the file, and cut will "ultimately" move the file )

Go to the window that displays where you want to copy / move the file to, navigate through the folders, or create any folders, till you are where you want that file to go. Then, RIGHT-CLICK and select PASTE. The file should either now exists in both locations, or be deleted in the FROM / SOURCE and only exist in the TO / TARGET ( depending on if you wanted to copy, or move, the file )

Do this process for every file, or folder, you want to...

When you are done. You need to unmount the drives, first, close the two windows you were using to view the contents of the two drives. Then, RIGHT-CLICK on each of the drives icons on the desktop, and select UNMOUNT from the options. Do this for both shortcuts to your drives.

I think this should do what you want,
Hope this helps,

Harry Kuhman
11-18-2004, 11:00 PM
And it just sits there.

That help ? :-)

Yes Chuck, it helps a lot. I can see exactly what is wrong from the information you posted.

I could tell you what it is, but I already guessed that was what was wrong in a previous post and you completely ignored it. Now you have confirmed that my guess was right. Since you still are not answering other questions I have asked, it would be dangerous and irresponsiable of me to give you a simple one line fix (it could risk the data on your other good drive since I don't know something important that I've asked about), so I'll leave it to you to go back and read what help you have already been given.

Of course, you could follow the other link I gave you and make some CD's that you could rescue your files to, but you seem to want to ingnore that solution. That's OK with me.

And I still wonder why, once the second drive was in a working windows box, you didn't just access that drive from windows. But clearly you can't be bothered to answer straight forward questions like that.

Sure seem like a lot of work just to get a date from that hard drive you moved, doesn't it?

Torriatte
11-29-2004, 01:43 PM
Hi Folks and sorry I am frustrasting everyone and failing to post enough info. I'm in a real juggling act here most of the tmie and constantly interupted. My apologies.

FIRST of all the drive is NTFS.

I could NOT read the drive via a DOS boot, etc. so that is why I am trying what I am trying.

I did not try the CD deal because I was trying to learn how to use Knoppix and the GUI and figured that was enought to wade through. I did think the CD deal was interesting and was goint to investigate it when I had a chance. My thought process was that Knoppix should be able to do this OK.

And I understand how to copy now, thanks ! The drives both show mounted. The drives show writable, etc. but it gets an error that it cannot be written to. So is this the NTFS issue ?

Thanks and sorry for the delay in responding.

Chuck

Cuddles
11-29-2004, 02:02 PM
Hi Folks and sorry I am frustrasting everyone and failing to post enough info. I'm in a real juggling act here most of the tmie and constantly interupted. My apologies.

FIRST of all the drive is NTFS.

...

The drives both show mounted. The drives show writable, etc. but it gets an error that it cannot be written to. So is this the NTFS issue ?

Quite possible... I would take a look at your /etc/fstab file entry for the drive, it sounds like the drive is being mounted as a VFAT, and when you attempt to write to the disk, it yells about it being incorrect... I havent worked with the NTFS, either native in Windows, or through Linux, but, I think you need to have "captive NTFS" - or something... NTFS is proprietary to Microsoft, and only through some "magic" has it been able to be added into Linux. From what I know, and hear, NTFS in Linux is in its "infancy" stage, not sure how much testing, or how much "working" it is. I have no clue, but, as an educated guess, I would try to get NTFS through Windows first, it knows "more" about the format, than any other OS, but, thats just me... ( you can use a screwdriver as a hammer, but, you cant use a sledgehammer as a screwdriver, kind of thing )

Hope this helps,

Harry Kuhman
11-29-2004, 07:59 PM
.......
FIRST of all the drive is NTFS.
....... an error that it cannot be written to. So is this the NTFS issue ?.....
You have the drive mounted read only (you gave us that much in a previous post)


Type: Desktop Config
Size: 390B
Modified: 11/17/04 03.52 pm
Owner: knoppix - knoppox
Permissions: -rw-r--r--
Name: Hard Disk Partition [hda5]
Type: Device
Device: /dev/hda5
File System: auto
Mount Point: /mnt/hda5
Writable: No

I did not post back how to make the drive read/write, because you had not posted what type of drive it was and writing to a NTFS partition from Knoppix can corrupt the entire partition. Now we know it was an NTFS partition.

I would still suggest the other ideas I offered, such as writing the sata to CD or transfering it to another system across a network.

Torriatte
11-29-2004, 08:25 PM
Thanks folks,

Yep, at that point the drive was not "writable" but I figured that out and got it changed. Changed the perimssions, etc. and I still cannot get it to work so it must be something to do with NTFS. What fun.

I will investigate the CD solution.

As far as transferring it across a network, are you refering to FTP or something else ?

Thanks !

Chuck

Harry Kuhman
11-29-2004, 08:33 PM
Yep, at that point the drive was not "writable" but I figured that out and got it changed......
Boy, sounds like you're just asking for it.


As far as transferring it across a network, are you refering to FTP or something else ?
I would use FTP. Others frequently use something else. More than one way to remove the outer covering of a feline.