On Sunday 14 March 2004 03:52 pm, Russell Hires wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello All...
>
> It's been a long time that I've been away, but I'm back!
>
> Here's my problem: Debian sarge, kernel 2.4.25 currently rests on a 4 GB
> hard drive, is split into 5 linux partitions, / /usr /home /tmp /var. I'm
> doing two things at once. I'm going to move each of these partitions to a
> larger disk (80 GB), and the filesystem is going to be xfs. The partitions
> are going to be the same as the smaller disk. At some point, the larger
> disk is going to do everything, and the smaller disk will be reassigned
> some new duty.
>
> How do I move everything over from each partition on the smaller disk to
> each partition on the larger disk?
>
> I've tried various things, such as cp -ax / /mnt/ (for example), and then
> reboot, and I'm told that there are some read only stuff that should be
> read-write. I can't use dd, since that take the ext2 filesystem on the
> smaller disk to the larger disk. I've tried rsync as well, but I don't
> understand that enough to actually do it right. I've also had concerns with
> mtab, since it doesn't seem to reflect fstab when I boot with the new /.
> Also, every bit of advice that I've seen on the net talks about not
> copying /proc over to the new device, since...something bad will happen,
> but I don't know what. Then I get a message about there being nothing in
> /proc. This just tells me that I don't know what I'm doing... ;-)
>
> So...pointers? Answers? Help?
>
> Russell
>
As root of coarse ;-)
# Make mount point
mkdir /mnt/new_hd
# Mount all the partitions together... replace ROOT, HOME etc. with the
# proper device (e.g. /dev/hda1).
mount -t xfs /dev/ROOT /mnt/new_hd
mount -t xfs /dev/HOME /mnt/new_hd/home
mount -t xfs /dev/USR /mnt/new_hd/usr
mount -t xfs /dev/TMP /mnt/new_hd/tmp
mount -t xfs /dev/VAR /mnt/new_hd/var
# Use rsync to archive all the files onto the new HD. Add more
# --exclude=/DIRif needed, one for each /DIR you want to exclude.
# Use --dry-run to see what will be copied and remove it to do the actual
# sync.
rsync -av --progress --exclude=/proc --dry-run / /mnt/new_hd
# Make the new /proc directory
mkdir /mnt/new_hd/proc
# OPTIONAL
# If you want to copy the master boot record over to the new HD. Replace
# OLD_HD and NEW_HD with the proper /dev (e.g. /dev/hda)
dd if=/dev/OLD_HD of=/dev/NEW_HD bs=512 count=1
# Unmount the new partitions
umount /mnt/new_hd/var /mnt/new_hd/tmp /mnt/new_hd/usr \
/mnt/new_hd/home /mnt/new_hd
That should get you going.
The optional master boot record copying above assumes that the /boot dir is on
the same partition on both the old and new HD's and it looks like its in / so
as long as / is on the same partition on both HD's you should be fine.
(e.g. / == /dev/hda1 on both).
The /etc/mtab will be rebuilt when you reboot. Only currently mounted file
systems are listed in mtab.
Hope that helps. Good luck.
-- Rob
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.
This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:19:29 EDT