LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Data Transfer From Redhat Linux Partition to Fat32 Partition (https://www.linuxquestions.org/questions/linux-general-1/data-transfer-from-redhat-linux-partition-to-fat32-partition-409621/)

saraturtle 01-30-2006 09:35 AM

Data Transfer From Redhat Linux Partition to Fat32 Partition
 
I have a computer with redhat linux on it that is using clarkconnect as a firewall. I need to save the data on the hard drive, because it is important information to the person who owns the computer.

To get to a prompt (sh-3.00#) I have to be in single user mode. I do not know if that is an important fact or not.

So far, thanks to the help of coderoot, who generously took 2 days out of his life to help a newbie like me, we are almost done.

The current status is that I now have 2 hard drives in the system. One is formatted with a FAT32 partition, and the other is the original hard drive with the linux partition and information.

My problem now is that I need to transfer the data from the linux hard drive, to the FAT32 hard drive. That way the information is safe, and I can format the linux drive to put Server on it. Then I will just transfer the data from one hard drive to the other through windows (which I can do myself)

Any help or opinion is greatly appreciated.

saraturtle 01-30-2006 09:39 AM

Update/ New Problem
 
Before I state the new problem let me clarify that the reason I am transferring the data to another hard drive and not a disk or cd is that because it is too big to fit on either media.

__________________________________________________
Through another source, I used the following codes.

mkdir /a

***mount /dev/hdd1 /mnt /a***

(not sure about the above code in ****** because it was wiped off of the screen by the next code...but it worked i think)

The next code i used (the one that wiped all previous codes off of the screen ) was given to me like this:

cp -ar /filesyouwant /a/newdir

I typed in

cp -ar /home /a/newdir

All the files I need were in "home" and I wasnt sure if newdir was just the helpful person's way of letting me know I need to name a directory for the files to be put in to on the new drive.....or if it was a command. I left it like that because if it was a command it would be executed....and if it was just his way of saying i need to make up a directory name...."newdir" sounded good as any

The problem comes from when i hit <enter> after typing:

cp -ar /home /a/newdir

It goes through all the files in "home" (all the files i need) but it says:

" cp: failed to preserve ownership for 'a/newdir/mikesg/.bash_profile Operation not permitted "

That is just ONE of the files....it says that for every file..could it be because of the firewall? Bad code? Incorrect or incomplete code? help?

michaelk 01-30-2006 09:55 AM

FAT32 can not handle linux file permissions. One method of preserving file permissions would be to tar everything first.

saraturtle 01-30-2006 12:40 PM

Okay then my next question is....how do you "tar"?

michaelk 01-30-2006 01:40 PM

tar -cvf /a/newdir/backup.tar /home

gilead 01-30-2006 01:40 PM

There are a lot of options you can use with tar. A simple one would be:

Code:

tar -cvf /tmp/backup.tar -C / etc home
This would create an archive called /tmp/backup.tar that contained your /etc and /home directories. You could then compress this with:

Code:

bzip2 -zv /tmp/backup.tar
You will then have a single file called /tmp/backup.tar.bz2 that you can extract with:

Code:

cd /tmp && tar -jxpvf backup.tar.bz2
This will create the etc and home directories from the archive in your /tmp directory.

saraturtle 01-31-2006 11:01 AM

Ok before I got the response from you guys, another source gave me a code that seemed to work. It is a slight variation of the first code I tried. The directory is different than the first one, just to be on the safe side.

first code:

cp -ar /home /a/newdir

Error:

cp: failed to preserve ownership for 'a/newdir/mikesg/.bash_profile Operation not permitted

Revised Code:

mkdir /work
mount /dev/hdd1 /work
cp --preserve=timestamps -r /home/* /work/
umount /dev/hdd1

Error:

Cannot create directory because there is no space left on the device.

Revised Code #2:

(once again to eliminate any errors....a different directory was made - work2 instead of work)

mount /dev/hdd1 /work2
rm -rf /work2/*
cp --preserve=timestamps -r /home/* /work2/
umount /dev/hdd1

Error: None

Assuming that the data has copied correctly because there was no error given, I unplugged the Linux hard drive and left just the windows hard drive to boot up (it has windows 98). Anyway I still cannot see the data from Windows...and I cant even see the directory. Am I looking in the wrong place? Is there something more I need to do? Should I go back and try to TAR the information instead?

saraturtle 01-31-2006 11:13 AM

Another person gave me this idea, and I wanted to know if it was safe. I would have tried it first, except that the file is 700 MB and I am on dialup...it would take years! But if it is a viable solution, I may try anyway.

Letter from alternate source:

Maybe I'm not understanding your situation correctly, but you have a Linux-formatted hard drive inside of a Windows XP computer and want to save the data on the Linux drive? Is that correct?

(this was before I used the cp command)

The easiest way to do this is download a Knoppix CD, burn it as a disk image (using Nero, Roxio, or CDBurnerXP), make sure your BIOS are set to boot from CD-ROM, then pop the Knoppix CD in.

(I have NERO and can do what she says)

Knoppix is a live Linux CD that runs entirely off the CD itself and your computer's RAM. Once it's booted up, you should see every single hard drive and partition appear as icons on your desktop. My guess is that your Windows hard drive will appear as /dev/hda1 and the Linux drive will appear as /dev/hdb1.

Just click on /dev/hdb1 and it will automatically be mounted and readable. Then pop in whatever you choose to back it up with (blank CD, external hard drive) and copy over the contents.

When you shut down, you'll be prompted to take the Knoppix CD out first, and then you can reboot into Windows as you normally would.

michaelk 01-31-2006 12:43 PM

The -a or -p option for cp will save permissions but not the --preserve=timestamps which is why the command completed successfully. In reality using a different directory will not eliminate errors since your still copying to hdd1 no matter what its mount point is called, if it was indeed mounted correctly. Go look at the /work2 directory without doing any mount commands and if you see files then hdd1 was not mounted.

I am still fuzzy on your drive configuration? Is hdd1 your Win98 c: drive? If you really mounted hdd1 to /work2 then your entire c: drive should of been erased when you executed "rm -rf /work2/*". If hdd1 is your c: drive then by copying files to /work2 they would of ended up in your c:\. You need to create a subdirectory in /work2 and then copy the files to /work2/subdirectory

I assumed when I first read your thread that you would copy the files back to /home which is why saving permissions would be a good thing. If not then do not use the -a option. I do not see an advantage using knoppix over your Redhat.

saraturtle 01-31-2006 02:37 PM

The code I used to view the directory (please tell me if it is wrong) is:

more /work2

the result I get is:

*** /work2: directory ***

There is nothing below that phrase except my prompt (sh-3.00#)

I assume if the code I used is correct..that hdd1 was mounted

Go look at the /work2 directory without doing any mount commands and if you see files then hdd1 was not mounted

saraturtle 01-31-2006 02:42 PM

correct.....hdd1 is my windows 98 c: drive

No it was not erased, because it will still boot to windows 98 without error.


So you are saying that the files I copied would be at the address c:/files_i_copied or is it c:/work2/files_i_copied

As for making a subdirectory for work2...what is the code for that?

mkdir /work2/subdirectory

???? or do I need to do something else

michaelk 01-31-2006 02:50 PM

more is a command for paging through text one screen at a time. The ls command will display files in a directory.
ls /work2
if you want to see one a page at a time then:
ls /work2 | more

Quote:

I assume if the code I used is correct..that hdd1 was mounted
Which code?

The mount command with no options will display all filesystems currently mounted.

saraturtle 01-31-2006 03:41 PM

ok i typed

ls /work2

The output is:

sh: ls/work2: No such file or directory

Just out of curiosity I typed in

ls /work

(/work if you remember was from a previous code I tried that gave me the "cannot create directory because there is no space on the device error. It was after I received this error that I used the "--preserve=timestamps" code with the /work2 directory..that i thought was successfull...I guess it wasnt)

Output=

2003 brandi joella kiwi pam stevie webmaster
battlefield classifieds junk messages peachw terry
bhmag daisha Kelly mikesg shared ut2004

saraturtle 01-31-2006 03:45 PM

typing just "mount" at the prompt gave this output

/dev/hda3 on / type ext3 (rw)
none on / proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw, gid=5, mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/hda1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

michaelk 01-31-2006 04:09 PM

So there is something on /work but I would guess that hdd1 was not mounted and so the files were copied to /work on the hda3.

How to proceed...
Are you going to copy these files back once you get the server running?


All times are GMT -5. The time now is 12:58 AM.