Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Migrating root partition

Posted on 1998-10-15
3
Medium Priority
?
288 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 160 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

670 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