Solved

Migrating root partition

Posted on 1998-10-15
3
271 Views
Last Modified: 2010-04-20
I have my root partition in /dev/hdb1 and would like to
move it to a larger disk, /dev/hda2. What are the steps
required to do this and avoid a headache or screwing up
the filesystem?
0
Comment
Question by:golfsd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
ghjm earned 40 total points
ID: 1638279
Assuming that you have /dev/hda2 mounted under /mnt/hda2:

cp --archive --verbose --one-file-system / /mnt/hda2

This will copy recursively, preserving file permissions, ownership, etc, everything on the root mouted filesystem but nothing else (ie no /mnt/cdrom, other mounted drives, or recursive descent into /mnt/hda2 itself) to /mnt/hda2. Then, just edit /etc/lilo.conf to reflect the new root partition, run /sbin/lilo, and reboot. (Make sure you propagate the changes to /etc/lilo.conf to the copy on the new partition, or you'll get a nasty surprise later...)

-Graham
0
 

Author Comment

by:golfsd
ID: 1638280

This may be obvious, but: Do I need to boot off a floppy
and have my /dev/hdb1 mounted as RO? According to ghjm's
answer, it seems I could "cp" everything, even though
/dev/hbd1 is an open filesystem ... I'm just trying to be
extra-cautious here.
0
 
LVL 1

Expert Comment

by:ghjm
ID: 1638281
No, you do not need to boot from a floppy. The only concern is to make sure that you get a consistent file set, i.e. that there weren't any processes writing to files at the time you did the copy. And, of course, So if you're running anything like a database server or whatever, you should probably kill it before you copy. If you want to be extra-paranoid, kill all processes but the bare minimum.

0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
winscp where are logs stored 3 75
ignore other .htaccess 2 71
How does PHP Storm display on Linux high resolution laptops? 1 68
Linux 3 37
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question