LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-30-2006, 09:35 AM   #1
saraturtle
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Rep: Reputation: 0
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.
 
Old 01-30-2006, 09:39 AM   #2
saraturtle
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Original Poster
Rep: Reputation: 0
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?
 
Old 01-30-2006, 09:55 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,900

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
FAT32 can not handle linux file permissions. One method of preserving file permissions would be to tar everything first.
 
Old 01-30-2006, 12:40 PM   #4
saraturtle
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Original Poster
Rep: Reputation: 0
Okay then my next question is....how do you "tar"?
 
Old 01-30-2006, 01:40 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,900

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
tar -cvf /a/newdir/backup.tar /home
 
Old 01-30-2006, 01:40 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
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.
 
Old 01-31-2006, 11:01 AM   #7
saraturtle
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Original Poster
Rep: Reputation: 0
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?

Last edited by saraturtle; 01-31-2006 at 11:02 AM.
 
Old 01-31-2006, 11:13 AM   #8
saraturtle
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Original Poster
Rep: Reputation: 0
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.
 
Old 01-31-2006, 12:43 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,900

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
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.
 
Old 01-31-2006, 02:37 PM   #10
saraturtle
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Original Poster
Rep: Reputation: 0
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
 
Old 01-31-2006, 02:42 PM   #11
saraturtle
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Original Poster
Rep: Reputation: 0
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
 
Old 01-31-2006, 02:50 PM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,900

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
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.
 
Old 01-31-2006, 03:41 PM   #13
saraturtle
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Original Poster
Rep: Reputation: 0
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
 
Old 01-31-2006, 03:45 PM   #14
saraturtle
LQ Newbie
 
Registered: Jan 2006
Posts: 12

Original Poster
Rep: Reputation: 0
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)
 
Old 01-31-2006, 04:09 PM   #15
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,900

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
accessing a linux partition from a fat32 partition? abtimoteo Ubuntu 4 09-19-2005 10:41 PM
Software to help me recover 'Deleted' FAT32 Partition Data? flamesrock Linux - Software 8 07-26-2005 10:39 PM
Recovery of lost data from FAT32 partition... devis Linux - Software 1 07-11-2005 08:10 AM
Linux partition over written with Fat32 data! hi-clier Linux - Newbie 2 11-21-2004 07:35 PM
data loss on FAT32-Partition sem2 Linux - General 1 08-01-2003 11:03 PM


All times are GMT -5. The time now is 07:15 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration