[NTLUG:Discuss] Need a little more elbow room.
Jason Bucata
jbucata at erols.com
Tue Dec 14 23:16:07 CST 1999
On Tue, Dec 14, 1999 at 10:45:39PM -0600, Stephen Klein wrote:
> I'm getting a little short on space on my 4.3GB drive (too much source
> code lying around I guess ;-) ), I have a new 13GB drive that I decided
> to use for an upgrade. Anyone know a quick and relatively way to
> transfer the contents of the old drive to a new larger drive. I need to
> end up with an exact duplicate of the old filesystem.
You can't (or rather, you shouldn't) put an exact duplicate of the current
filesystem(s? You didn't say how many partitions you're using--it should be
at least two) onto a larger hard drive. Part of the characteristic of the
filesystem is its size--you can't change the size of a filesystem and keep
it otherwise exactly the same. (If Partition Magic supports ext2fs these
days, it might be able to assist you by growing the filesystem while
otherwise preserving its contents.) You could copy the filesystem over but
you wouldn't use any of the extra space (unless this is what you wanted to
accomplish, in which case see below).
Why I believe you probably have more than one partition: Linux puts its swap
space in a separate partition. Unless Slackware does something *really*
fancy (or you have no swap space), you probably don't have one huge
partition mounted as / that covers the whole drive.
> I'll probably boot with the old drive mounted read-only, mount the new
> drive with write-enabled, and then transfer the data. That's the point
> where I need help, what do I do to copy the entire contents of the old
> disk to the new disk. I could probably figure it out eventually, but
> with my job I just don't have time. I also have plans for the old drive
> that are limited by time somewhat.
*If* you're just copying filesystems that are exactly the same size from one
place to another (here place = partition, on the same or a different disk),
you could use the dd command.
This also doesn't take into account having multiple partitions: You'll want
to get straight how much room to allocate to what (IMO the most fun part of
a new OS install :) ) and get the partitions set up before trying to copy
anything over.
If you wanted to just copy the files without transferring the underlying
filesystem structure, I'd probably use cp --archive (courtesy of GNU), or
else some use of find and tar or cpio which somebody else would be better
able to go into.
----------
Here's my idea mentioned above: Pretend you have one partition for
everything (extrapolate appropriately for more than one). Make a partition
at the beginning of the new drive that's *exactly* the same size (for
sufficiently exact amounts of "exactly"--I don't know if having extra is a
problem, though being short surely is), and use dd to copy from one to the
other. Ideally, remount the source partition as read-only so it's not
changing beneath you.
Then, use the extra space for a new partition which will be mounted
somewhere in your existing filesystem--let's pretend /home (assuming it's
not already a separate partition, and again extrapolating to everything
else). Everything else currently in /home would need to be moved
out--renaming it to old_home would suffice. Then mount the new partition as
/home and copy/move again.
Having said all that, I think it's easier to just do a file-based copy,
which will be faster (since you're not copying empty space, if nothing
else), and if there's nothing that requires a particular partition/file
system size (I assume not, but...).
As for actually performing the switcheroo once you get everything copied,
I'll defer to the wiser voices on the list.
Speaking of all this, I think there's a HOWTO that specifically deals with
replacing an old hard drive with a newer one...
Jason B.
More information about the Discuss
mailing list