Copying Ubuntu from a 20 Gig Hard drive to a 100 Gig Hard Drive?
Peter Whittaker
pwwnow at gmail.com
Wed Jan 31 13:34:54 UTC 2007
On Wed, 2007-01-31 at 07:39 -0500, Alfred wrote:
> Copying Ubuntu from a 20 Gig Hard drive to a 100 Gig Hard Drive?
>
> Is this simple or difficult to do?
It is simple, but is it what you want to do? In order to really answer
either question, we need to know more about your current drive and
current setup.
The most important question is this: Does your 20 GB drive have a single
partition (ignoring swap)?
If the answer is yes, then chances are that you are running out of room
in /home - that is, your user files are filling the drive. Instead of
copying everything to the 100 GB drive, you could consider doing the
following :
install the 100 GB in your machine
logout of gnome
ctrl-alt-f1 (to get the virtual console)
login
$ su
% mv /home /home_orig
% mkdir /home
% cat >> /etc/fstab
/dev/hd100GB /home ext3 defaults 0 0
^D # that's ctrl-D
% mount -a
% mv /home_orig/* /home
% exit
$ exit
This assumes you have already formatted the 100 GB drive as an ext3
filesystem (if you've formatted otherwise, change the ext3 to the
appropriate value in the command above).
What this does is turn the 100 GB drive into your /home partition, where
your users live. That leaves the 20 GB drive to be just the OS
(/, /etc, /var, etc.). Chances are that 20 GB will be loads for your OS,
and chances are you'll not run out of room on the 100 GB for a while.
If your 20 GB has more than one partition, things may or may not be more
complicated, but we need more information. Run the following commands
and include their output in another email (in line is fine, there won't
be that much):
df
sudo du -sh /*
These two commands will tell us quite a bit about your setup and allow
us to provide better advice.
Finally, if you do want to copy the 20 GB to the 100 GB, you could boot
with the live CD and use dd, along the lines of
dd if=/dev/hd20GB of=/dev/hd100GB
This will take quite a while. Get a beverage.
The argument to if should be the device associated with the mountable
partition (/) on your 20 GB; if if is the underlying device this command
will also copy your swap file, etc.
If the two drives are the same type (IDE, ATA, SATA, etc.), then
shutting down, disconnecting the 20, connecting the 100 where the 20
was, and rebooting should be fine (I believe - confirmation from another
reader would be great). Otherwise, you will likely have to modify
the /etc/fstab appropriately, again while running the live CD.
Without knowing more about your specific hardware, it is hard to be more
specific, hard to provide correct command arguments.
pww
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-ca/attachments/20070131/81a7288d/attachment.pgp>
More information about the ubuntu-ca
mailing list