LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 10-17-2002, 01:44 PM   #1
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
copying linux to another drive?


I just got a new drive (40 gig 7200rpm), so I partitioned it 39.5 gigs ext2, .3 gig swap. I want to move my linux (all the files from my current partition) from my current drive hda5 to my new drive hdb1. I don't want to reinstall linux on my new drive, it would be pointless, and I would have to reinstall all my drivers, kde3 and all that crap. Does anyone know of an easy way of doing this??
 
Old 10-17-2002, 02:14 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
You can copy all the files. They you need to modify fstab and install LILO (after making modifucations in lilo.conf). If you have doubts (or you'd like to read a more detailed text), post again.
 
Old 10-17-2002, 03:55 PM   #3
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
I'd use dump and restore to do the filesystem backup ... after that you have of course modify /etc/fstab, grub.conf / lilo.conf and reinstall the bootloader ...
 
Old 10-17-2002, 05:31 PM   #4
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Original Poster
Rep: Reputation: 32
okay.. I'm just going to do what I originally planned on, making a cp script. Quick Q? - what flag is there to copy hidden files?
k, the only problem is I have to mount it (/hdb) so I have to cp all the directories form the root except /hdb. Well, I odn't have many directories there any way
cp -pR xxxx /hdb
sound good? Well im gonna try :P
 
Old 01-07-2003, 12:36 AM   #5
mark_umr
LQ Newbie
 
Registered: Sep 2002
Posts: 29

Rep: Reputation: 15
Did this ever work out for you? How'd you end up doing it?

I'm about to do the same for a friend tomorrow. He has linux on a bigger partition now, and we are moving to a smaller one. I'm not sure yet if dump is an option because I'm not sure where we'd be able to dump to. Hopefully he has enough extra space on his current larger partition to hold the dump and the current install, and then we can restore to the smaller partition (which I'm also hoping is large enough for his current install, I suspect it is but we haven't checked yet).

Obviously files in /proc and /tmp do not need to be copied, but I assume virtually everything else can be, even logs since they'll just be continued later or overwritten.
 
Old 01-07-2003, 09:44 AM   #6
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
I don't know if you've already done this, but just use tar:
as root:
Code:
cd /src_dir
tar --exclude /dest_dir -cf - . |(cd /dest_dir; tar xf -)
man tar, you can exclude whatever dirs you need to, and
/proc should be excluded (though created after you are done)

Last edited by moses; 01-07-2003 at 09:46 AM.
 
Old 01-07-2003, 09:13 PM   #7
Aussie
Senior Member
 
Registered: Sep 2001
Location: Brisvegas, Antipodes
Distribution: Slackware
Posts: 4,590

Rep: Reputation: 58
I did this just before xmas (moved my install from two old drives to one new drive), have a look here to see how I did it.
 
  


Reply



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
Seeing a Linux drive from Windows and copying files from the Linux drive? Alvis Linux - Software 4 03-26-2005 07:03 PM
Copying whole drive to new one? BajaNick Linux - General 2 08-24-2004 09:41 PM
need help copying a hard drive valueduser Linux - General 6 10-17-2003 08:26 AM
Copying From A FAT32 Drive salvatore Linux - Newbie 3 10-16-2003 09:48 PM
Copying to floppy drive kau Linux - Newbie 3 05-13-2002 10:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:27 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration