LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 07-14-2004, 07:43 PM   #1
robthebob
Member
 
Registered: Aug 2003
Location: York, UK
Distribution: Gentoo, WinXP
Posts: 40

Rep: Reputation: 15
Moving partitions from one hard drive to another


At the moment I have a system with two hard drives: hda and hdc

/dev/hda3 /
/dev/hda4 /home

/dev/hdc1 /boot
/dev/hdc2 /tmp

hdc is slowly dying so I need to move the partitions across to hda. Could I do this as simply as copying the data in them to the appropriate folders on hda?

Or could I create new partitions on hda and use some program to copy them across intact?

Obviously fstab will need to be modified in either case, but I'm not sure if there is something else I'm missing.

Any help appreciated
 
Old 07-14-2004, 09:34 PM   #2
rickenbacherus
Member
 
Registered: Mar 2003
Location: colorado springs. colorado
Distribution: Debian-Sid 2.6.24-rt1
Posts: 290

Rep: Reputation: 30
Re: Moving partitions from one hard drive to another

Quote:
Originally posted by robthebob
At the moment I have a system with two hard drives: hda and hdc

/dev/hda3 /
/dev/hda4 /home

/dev/hdc1 /boot
/dev/hdc2 /tmp

hdc is slowly dying so I need to move the partitions across to hda. Could I do this as simply as copying the data in them to the appropriate folders on hda?

Or could I create new partitions on hda and use some program to copy them across intact?

Obviously fstab will need to be modified in either case, but I'm not sure if there is something else I'm missing.

Any help appreciated
You can do either. Linux couldn't care less if /boot is on the same partition as / or on its own.
Just create new partitions and use cp.

man cp says

-a, --archive
same as -dpR

So that's all you need.

mount /dev/hda5 /mnt/hda5
cd /boot
cp -a* /mnt/hda5

Edit fstab so that /hda5 gets mounted to /boot

I always have a live cd handy just in case you hose something up you can chroot in and fix it.
 
Old 07-15-2004, 05:47 AM   #3
robthebob
Member
 
Registered: Aug 2003
Location: York, UK
Distribution: Gentoo, WinXP
Posts: 40

Original Poster
Rep: Reputation: 15
Thanks very much - that's very clear and helpful.

Can I just check that basically all lilo cares about is finding the root ( / ) partition on boot, from which it can load all the others via /etc/fstab? This would seem to make it very easy to move a linux install about across hard drives intact.
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving Hard Drive After Install PiscisBos Linux - Software 2 02-14-2005 01:14 AM
Moving Hard drive between PC's the_imax Linux - Hardware 13 11-20-2004 01:55 PM
Moving linux to second hard drive rjayaram Linux - General 10 09-11-2003 06:23 PM
moving to a new hard drive n1wil Linux - Software 4 05-21-2003 03:38 PM
moving my hard drive illtbagu Linux - General 2 02-08-2003 05:56 PM


All times are GMT -5. The time now is 10:20 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration