Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 05-19-2009, 12:25 AM   #1
LQ Newbie
Registered: Jul 2004
Posts: 10

Rep: Reputation: 0
Moving root filesystem to another disk

Hi there,

Iíve setup a filesystem on a RAID 0+1 and am looking at moving root filesystem from a single disk to the new one. I could not install CentOS on mirrored filesystem as the RAID card did not have a pre-built driver for CentOS 5.3, so I had to compile the driver after installing the system.

What Iím going to do now is:

1. Mount the new mirrored filesystem under /root1
2. use find | cpio to copy everything from the existing / to /root1
3. use grub to create a boot record on /root1
4. edit /root1/etc/fstab to point / to the new disk
5. reboot the system and keep my fingers crossed

Is this the way to go? Am I missing anything?

Thanks very much.
Old 05-19-2009, 12:33 AM   #2
Senior Member
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
The problem you might have is that you intend to boot /root1 then move everything into /root1 while the system is running out of that partition.

You'll probably be OK, but not certainly.

I think if I were you that I would identify exactly where in the system your raid driver was installed, and I would then make sure that I had a copy of that driver tucked away, and anything in /etc/modules, or /etc/modules.conf or /etc/conf.modules (depending on distro) tucked away safely also. Then, after doing my copy and before rebooting, I'd check all the relevant files to make sure they were there and they were right.

If, after copying, the system didn't work (which could happen), I'd have a Linux Live CD sitting ready, and I'd boot into that to make the checks of the filesystem, then I'd boot into it.
Old 05-19-2009, 01:25 AM   #3
Senior Member
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
I've done this sort of thing with a liveCD using "cp -axu from to". There's also the issue of whether you're using fakeraid or mdadm to create your raid. If fakeraid you need dmraid, and you need to update the initfs for the kernel so it can access the raid when the kernel boots up. If mdadm, you need the conf file in the right place and setup correctly on the new drive. In any case, do this stuff from a liveCD to avoid the bulk of the problems during the copy; such as trying to copy /dev, /proc, etc.
Old 05-21-2009, 12:32 AM   #4
LQ Newbie
Registered: Jul 2004
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks a lot for your replies. I'll boot from live cd and then do the copy, will see what happens.


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
disk crashing and moving /home to a new server but all permissions are root HELP! nocnoc Linux - Newbie 4 11-29-2006 11:29 AM
Complete Hard-Disk & Root Filesystem Backup taylor_venable *BSD 1 11-18-2005 02:20 PM
dm-crypt: Moving Encrypted Filesystem hamish Linux - Security 2 07-21-2005 02:57 AM
Encrypted Root Filesystem HOWTO and /dev filesystem tmillard Linux From Scratch 0 10-18-2004 03:58 PM
howto boot root filesystem from SATA disk? david.skinner Linux - Hardware 4 06-17-2004 12:51 AM > Forums > Linux Forums > Linux - Software

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

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