archives: moving all file (including symlinks) to new partition

From: Joey Kelly <looseduk_at_ductape.net>
Date: Fri, 21 Dec 2001 18:13:39 +0000
Message-Id: <011221181339FR.01203@rahab>

-- 
Joey Kelly
< Minister of the Gospel | Computer Networking Consultant >
http://joeykelly.dhs.org
"When Government fears the people, it's liberty.
When people fear the Government, it's tyranny."
-- Benjamin Franklin

attached mail follows:


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Trying to move files from / to /mnt/32gb

$ df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda8 4192800 2022816 2169984 48% /
/dev/hda1 31277592 32840 31244752 0% /mnt/32gb
/dev/hda6 46636 6660 37568 15% /boot
/dev/hda7 4192800 1394264 2798536 33% /home
/dev/hdc2 59912580 3036036 56876544 5% /mnt/60gb

$ tar --version
tar (GNU tar) 1.13.19
$ rpm -qa|grep reiser
reiserfsprogs-3.x.0i-3mdk
$ cd /mnt/60gb
$ tar cvjpsSlf root.tar.bz2 /
[snip *whole lots*]
$ dir root.tar.bz2
- -rw-r--r-- 1 root root 690575050 Oct 7 15:05 root.tar.bz2
$ cd /mnt/32gb
$ tar xfvj /mnt/60gb/root.tar.bz2
[snip *whole lots*]
Tar: Error exit delayed from previous errors

What could be going wrong? Any help greatly appreciated.

Thanks,
Ron
- --
+------------------------------------------------------------+
| Ron Johnson, Jr. Home: ron.l.johnson@home.com |
| Jefferson, LA USA http://ronandheather.dhs.org:81 |
| |
| "Those who would give up essential Liberty to purchase a |
| little temporary safety, deserve neither Liberty nor |
| safety." |
| Ben Franklin |
+------------------------------------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7wNq+jTz5dS9Us5wRAsTYAJ9ljsAdwq6h/Vmpuw64IMeB7dKTbACeIpZO
7t/RNquS2z/cFOYyMhHOHdk=
=9/v5
-----END PGP SIGNATURE-----
_______________________________________________
Nolug mailing list
Nolug@nolug.org
http://mail2.nolug.org:81/mailman/listinfo/nolug
List archives available - http://mail.nolug.org/pipermail/nolug

attached mail follows:


READ AND UNDERSTAND FULLY BEFORE TAKING ANY ACTION.

Relevant man pages:

     man lilo
     man cp

See below for detailed instructions.

On Sun, 2001-10-07 at 16:44, Ron Johnson wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Trying to move files from / to /mnt/32gb
>
> $ df
> Filesystem 1k-blocks Used Available Use% Mounted on
> /dev/hda8 4192800 2022816 2169984 48% /
> /dev/hda1 31277592 32840 31244752 0% /mnt/32gb
> /dev/hda6 46636 6660 37568 15% /boot
> /dev/hda7 4192800 1394264 2798536 33% /home
> /dev/hdc2 59912580 3036036 56876544 5% /mnt/60gb
>
I'm not sure if you want /home and /boot copied as directories or kept
as distinct partitions (I'm assuming "kept as distinct partitions" for
the course of these instructions as it appears you are just transferring
"/" to a bigger partition on the same drive, but you can adjust this if
not). If your system uses devfs (MDK 8.1, recent cooker), you need only
mkdir the new /dev/ directory, but if you use the traditional /dev (MDK
8.0 and older) then don't do the mkdir for /dev and add /dev to the cp
line.

cd /
mkdir -p /mnt/32gb/mnt/cdrom
mkdir -p /mnt/32gb/mnt/floppy
mkdir /mnt/32gb/proc
mkdir /mnt/32gb/home
mkdir /mnt/32gb/boot
mkdir /mnt/32gb/dev
cp -a bin etc initrd lib opt root sbin swap tmp usr var \
      /mnt/32gb/

perl -pi.bak -e 's|hda8|hda1|;' /mnt/32gb/etc/fstab

umount /boot
mount -t auto /dev/hda6 /mnt/32gb/boot
/sbin/lilo -r /mnt/32gb

# Notes on copying:

DO NOT ATTEMPT TO DIRECTLY COPY THE /proc DIRECTORY AND ITS CONTENTS.
Files under /proc do not really exist on your drive as /proc represents
the system in memory. Notice that if you run:

     mount

you will see that /proc has a filesystem of sorts (the proc filesystem)
mounted to it.

"cp -a" copies recursively, maintains uid/gid and permissions, and
symlinks as symlinks. The perl command adjusts the new systems fstab to
account for the moved "/". You could just as easily fire up vi, emacs
or pico on that file and do it by hand. The lilo command reinstalls the
boot loader to boot from hda1 instead of hda8 (note the -r option to
specify the new root). The remount of /boot is to put the boot files in
the proper place for the lilo command. Lastly, with any semi-recent
edition of MDK, you have a new enough version of lilo that you don't
need the separate boot partition. If you want to do away with a
separate /boot partition, simply don't do the following commands:

     mkdir /mnt/32gb/boot
     umount /boot
     mount -t auto /dev/hda6 /mnt/32gb/boot

Then add "boot" to the list of directories to be cp'd and remove the
entry for /boot in /mnt/32gb/etc/fstab. You may or may not want to keep
the /home partition separate; if not though, follow the same conversion
instructions as for /boot (no mkdir, add it to cp and edit out the mount
point in the new fstab).

Lastly, note that if you leave the current "/" partition alone (don't
erase it just yet) you can reboot to it by typing at the boot prompt:

     linux root=/dev/hda8

If you want to test the new "/" while not changing the boot loader just
yet, don't do the umount, mount and lilo commands, reboot the machine
and at the boot prompt:

     linux root=/dev/hda1

Feel free to fire questions if you have any.

-- 
     Woody (woody@linif.org)
---------------------------------------------------------------
Gatewood Green         Web Developer
http://www.linux.org/  The first stop for Linux info on the Net
Email:                 Gatewood.Green@linux.org
---------------------------------------------------------------
All opinions expressed by me are my own and not necessarily
endorsed by Linux Online, Inc. or Linux Headquarters, Inc.
_______________________________________________
Nolug mailing list
Nolug@nolug.org
http://mail2.nolug.org:81/mailman/listinfo/nolug
List archives available - http://mail.nolug.org/pipermail/nolug

attached mail follows:


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

1. The problem is symlinks...
   After I sent the email, I tried the "tar xvfj" with
   "2> err.lis" and this showed lots of errors similar to this:
 tar: bin/zcat: Cannot link to bin/zcat: Invalid cross-device link
   
   "cp -a" will retain soft symlinks, but they will now point to
   their original hosts on the original partition... Not what
   I want.

2. Pay attention:
   From my original post "$ tar cvjpsSlf root.tar.bz2 /"
                                      ^
  (Hopefully you are using monospaced fonts and the caret is
  under the "l".) The "-l" option specifies
     "stay in local file system when creating an archive".

On Monday 08 October 2001 11:24 am, Woody Green wrote:
> READ AND UNDERSTAND FULLY BEFORE TAKING ANY ACTION.
>
> Relevant man pages:
>
> man lilo
> man cp
>
> See below for detailed instructions.
>
> On Sun, 2001-10-07 at 16:44, Ron Johnson wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Trying to move files from / to /mnt/32gb
> >
> > $ df
> > Filesystem 1k-blocks Used Available Use% Mounted on
> > /dev/hda8 4192800 2022816 2169984 48% /
> > /dev/hda1 31277592 32840 31244752 0% /mnt/32gb
> > /dev/hda6 46636 6660 37568 15% /boot
> > /dev/hda7 4192800 1394264 2798536 33% /home
> > /dev/hdc2 59912580 3036036 56876544 5% /mnt/60gb
>
> I'm not sure if you want /home and /boot copied as directories or
> kept as distinct partitions (I'm assuming "kept as distinct
> partitions" for the course of these instructions as it appears you
> are just transferring "/" to a bigger partition on the same drive,
> but you can adjust this if not). If your system uses devfs (MDK 8.1,
> recent cooker), you need only mkdir the new /dev/ directory, but if
> you use the traditional /dev (MDK 8.0 and older) then don't do the
> mkdir for /dev and add /dev to the cp line.
>
> cd /
> mkdir -p /mnt/32gb/mnt/cdrom
> mkdir -p /mnt/32gb/mnt/floppy
> mkdir /mnt/32gb/proc
> mkdir /mnt/32gb/home
> mkdir /mnt/32gb/boot
> mkdir /mnt/32gb/dev
> cp -a bin etc initrd lib opt root sbin swap tmp usr var \
> /mnt/32gb/
>
> perl -pi.bak -e 's|hda8|hda1|;' /mnt/32gb/etc/fstab
>
> umount /boot
> mount -t auto /dev/hda6 /mnt/32gb/boot
> /sbin/lilo -r /mnt/32gb
>
>
> # Notes on copying:
>
> DO NOT ATTEMPT TO DIRECTLY COPY THE /proc DIRECTORY AND ITS CONTENTS.
> Files under /proc do not really exist on your drive as /proc
> represents the system in memory. Notice that if you run:
>
> mount
>
> you will see that /proc has a filesystem of sorts (the proc
> filesystem) mounted to it.
>
> "cp -a" copies recursively, maintains uid/gid and permissions, and
> symlinks as symlinks. The perl command adjusts the new systems fstab
> to account for the moved "/". You could just as easily fire up vi,
> emacs or pico on that file and do it by hand. The lilo command
> reinstalls the boot loader to boot from hda1 instead of hda8 (note
> the -r option to specify the new root). The remount of /boot is to
> put the boot files in the proper place for the lilo command. Lastly,
> with any semi-recent edition of MDK, you have a new enough version of
> lilo that you don't need the separate boot partition. If you want to
> do away with a separate /boot partition, simply don't do the
> following commands:
>
> mkdir /mnt/32gb/boot
> umount /boot
> mount -t auto /dev/hda6 /mnt/32gb/boot
>
> Then add "boot" to the list of directories to be cp'd and remove the
> entry for /boot in /mnt/32gb/etc/fstab. You may or may not want to
> keep the /home partition separate; if not though, follow the same
> conversion instructions as for /boot (no mkdir, add it to cp and edit
> out the mount point in the new fstab).
>
> Lastly, note that if you leave the current "/" partition alone (don't
> erase it just yet) you can reboot to it by typing at the boot prompt:
>
> linux root=/dev/hda8
>
> If you want to test the new "/" while not changing the boot loader
> just yet, don't do the umount, mount and lilo commands, reboot the
> machine and at the boot prompt:
>
> linux root=/dev/hda1
>
> Feel free to fire questions if you have any.

- --
+------------------------------------------------------------+
| Ron Johnson, Jr. Home: ron.l.johnson@home.com |
| Jefferson, LA USA http://ronandheather.dhs.org:81 |
| |
| "Those who would give up essential Liberty to purchase a |
| little temporary safety, deserve neither Liberty nor |
| safety." |
| Ben Franklin |
+------------------------------------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7wlcsjTz5dS9Us5wRAq9qAJ9gQEP+GEmTBzM2McuD6e+YcKjyLgCfUP82
WdLdH8VGlLKL4Gyt6MkKiHg=
=CXoU
-----END PGP SIGNATURE-----
_______________________________________________
Nolug mailing list
Nolug@nolug.org
http://mail2.nolug.org:81/mailman/listinfo/nolug
List archives available - http://mail.nolug.org/pipermail/nolug

attached mail follows:


Heres how I always did it (from the linux tips howto)

 Quick way to move an entire tree of files from one disk to another

    (cd /source/directory && tar cf - . ) | (cd /dest/directory && tar xvfp -)

On Sun, Oct 07, 2001 at 05:44:07PM -0500, Ron Johnson wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Trying to move files from / to /mnt/32gb
>
> $ df
> Filesystem 1k-blocks Used Available Use% Mounted on
> /dev/hda8 4192800 2022816 2169984 48% /
> /dev/hda1 31277592 32840 31244752 0% /mnt/32gb
> /dev/hda6 46636 6660 37568 15% /boot
> /dev/hda7 4192800 1394264 2798536 33% /home
> /dev/hdc2 59912580 3036036 56876544 5% /mnt/60gb
>
> $ tar --version
> tar (GNU tar) 1.13.19
> $ rpm -qa|grep reiser
> reiserfsprogs-3.x.0i-3mdk
> $ cd /mnt/60gb
> $ tar cvjpsSlf root.tar.bz2 /
> [snip *whole lots*]
> $ dir root.tar.bz2
> - -rw-r--r-- 1 root root 690575050 Oct 7 15:05 root.tar.bz2
> $ cd /mnt/32gb
> $ tar xfvj /mnt/60gb/root.tar.bz2
> [snip *whole lots*]
> Tar: Error exit delayed from previous errors
>
> What could be going wrong? Any help greatly appreciated.
>
> Thanks,
> Ron
> - --
> +------------------------------------------------------------+
> | Ron Johnson, Jr. Home: ron.l.johnson@home.com |
> | Jefferson, LA USA http://ronandheather.dhs.org:81 |
> | |
> | "Those who would give up essential Liberty to purchase a |
> | little temporary safety, deserve neither Liberty nor |
> | safety." |
> | Ben Franklin |
> +------------------------------------------------------------+
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
>
> iD8DBQE7wNq+jTz5dS9Us5wRAsTYAJ9ljsAdwq6h/Vmpuw64IMeB7dKTbACeIpZO
> 7t/RNquS2z/cFOYyMhHOHdk=
> =9/v5
> -----END PGP SIGNATURE-----
> _______________________________________________
> Nolug mailing list
> Nolug@nolug.org
> http://mail2.nolug.org:81/mailman/listinfo/nolug
> List archives available - http://mail.nolug.org/pipermail/nolug

-- 
Scott Harney<scotth@scottharney.com>
_______________________________________________
Nolug mailing list
Nolug@nolug.org
http://mail2.nolug.org:81/mailman/listinfo/nolug
List archives available - http://mail.nolug.org/pipermail/nolug

attached mail follows:


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 08 October 2001 12:08 pm, Scott Harney wrote:
> Heres how I always did it (from the linux tips howto)
>
> Quick way to move an entire tree of files from one disk to another
>
>
> (cd /source/directory && tar cf - . ) | (cd /dest/directory &&
> tar xvfp -)

The problem is that soft symlinks stay pointing at their original
host files, not at the "new" files under /dest/directory.

> On Sun, Oct 07, 2001 at 05:44:07PM -0500, Ron Johnson wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Trying to move files from / to /mnt/32gb
> >
> > $ df
> > Filesystem 1k-blocks Used Available Use% Mounted on
> > /dev/hda8 4192800 2022816 2169984 48% /
> > /dev/hda1 31277592 32840 31244752 0% /mnt/32gb
> > /dev/hda6 46636 6660 37568 15% /boot
> > /dev/hda7 4192800 1394264 2798536 33% /home
> > /dev/hdc2 59912580 3036036 56876544 5% /mnt/60gb
> >
> > $ tar --version
> > tar (GNU tar) 1.13.19
> > $ rpm -qa|grep reiser
> > reiserfsprogs-3.x.0i-3mdk
> > $ cd /mnt/60gb
> > $ tar cvjpsSlf root.tar.bz2 /
> > [snip *whole lots*]
> > $ dir root.tar.bz2
> > - -rw-r--r-- 1 root root 690575050 Oct 7 15:05 root.tar.bz2
> > $ cd /mnt/32gb
> > $ tar xfvj /mnt/60gb/root.tar.bz2
> > [snip *whole lots*]
> > Tar: Error exit delayed from previous errors
> >
> > What could be going wrong? Any help greatly appreciated.
> >
> > Thanks,
> > Ron
> > - --
> > +------------------------------------------------------------+
> >
> > | Ron Johnson, Jr. Home: ron.l.johnson@home.com |
> > | Jefferson, LA USA http://ronandheather.dhs.org:81 |
> > |
> > | "Those who would give up essential Liberty to purchase a |
> > | little temporary safety, deserve neither Liberty nor |
> > | safety." |
> > | Ben Franklin |
> >
> > +------------------------------------------------------------+
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.0.6 (GNU/Linux)
> > Comment: For info see http://www.gnupg.org
> >
> > iD8DBQE7wNq+jTz5dS9Us5wRAsTYAJ9ljsAdwq6h/Vmpuw64IMeB7dKTbACeIpZO
> > 7t/RNquS2z/cFOYyMhHOHdk=
> > =9/v5
> > -----END PGP SIGNATURE-----
> > _______________________________________________
> > Nolug mailing list
> > Nolug@nolug.org
> > http://mail2.nolug.org:81/mailman/listinfo/nolug
> > List archives available - http://mail.nolug.org/pipermail/nolug

- --
+------------------------------------------------------------+
| Ron Johnson, Jr. Home: ron.l.johnson@home.com |
| Jefferson, LA USA http://ronandheather.dhs.org:81 |
| |
| "Those who would give up essential Liberty to purchase a |
| little temporary safety, deserve neither Liberty nor |
| safety." |
| Ben Franklin |
+------------------------------------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7wltUjTz5dS9Us5wRAh0bAJ44kB1QbHI8C8ehFtWp/DUYR9+MVgCcCn5j
7xISQs8ihfBbUFeRTYXFTuo=
=L2up
-----END PGP SIGNATURE-----
_______________________________________________
Nolug mailing list
Nolug@nolug.org
http://mail2.nolug.org:81/mailman/listinfo/nolug
List archives available - http://mail.nolug.org/pipermail/nolug
Received on 12/21/01

This archive was generated by hypermail 2.2.0 : 12/19/08 EST