[Gllug] moving system from one disc to another

t.clarke tim at seacon.co.uk
Wed Sep 1 09:35:10 UTC 2010


Hi guys

thanks for the various responses on the above subject

One thing I have learned over the years I have been dealing with computers is
that you never stoip learning !

I was not aware of either resize2fs or dump  - most of my work being on a SCO
Unix system.  The linux systems are mainly used as firewalls/mailservers/web-
servers!

I use dd frequently to backup complete filesystems to spare partitions on
another disc.  This is a great way of doing quick backups, as although dd has
to copy the entire partition, it is vastly quicker than having to read though
the directory heirarchy and write individual files to an archive or copy
filesystem.  The image-copy filesystem on the other partition can then be backed
up to tape at leisure.

With regard to resize2fs, am I correct in assuming that if a complete partition/
filesystem is copied over to a larger partition using dd,  resize2fs can then
be used to 'expand' the copied filesystem into the new partition?   If so,
this would seem to be the optimum way of copying-over?
Obviously the use of dd requires the filesystem to be unmounted  - necessitating
a 'recovery disc' CDrom boot as already mentioned.

With regard to 'dump' it seems from the man page that one cannot restrict the
archive to 'base' filesystem only (ie if / is the filesystem to be dumped
anything mounted on it will also be archived).   So I guess this would also
require a CDrom boot.



What I actually did in the end was to:
1) add a new disc to the system and reboot normaly, but in single-user
2) create the required partitions on the new disc:
   1  /boot
   2  swap
   3  /
3) mkfs on partition 1 as ext2  and partition 3 as ext3
   mkswap on 2
4) create directories  /bcopy and /ccopy
5) mount /dev/hdb1 on /bcopy and /dev/hdb3 on /ccopy
5) copy /boot to /bcopy
6) copy / to /ccopy  using
   find ./ -mount | cpio -p /ccopy
The creates everything need on the copy disc,  but is unbootable

I believe that:
grub
root (hd1,0)
setup (hd1)    would create a grub MBR on the copy disc

but I was running scared of possibly wrecking my main disc, so in the end I
shut down, re-booted off a CDrom with the new drive only connected (re-jumpered
as a master) and did
grub
root (hd0,0)
setup (hd0)


Incidentally, for some reason the info on grub I found on the web suggested
that:
grub
find /boot/grub/stage1
would return the necessary disk parameters for the subsequent root command

However this refused to work on a disc setup as previously described, but
would only work when /boot was located within the root filesystem (on partition
1) rather than in its own private filesystem/partition.



Tim
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list