1 msg[OT] mdadm+lvm2+mkfs
14 msgHome page slowness
15 msg[wildly OT]advice for a wireless antenna?
1 msgSOLVED: booting to grub prompt, but config works
16 msgdf showing rootfs
8 msgbooting to grub prompt, but config works
3 msgRe: Gnome CD automount fails without error
7 msgFun with Foo (matic) ?
10 msg2.6.23-gentoo-r7 causes blinking X display
1 msgxorg + synaptics|wacom
4 msgNew install boots but grub just says: grub>
16 msgBest anti-virus
8 msgportage & foomatic problem
9 msginstallation cd for P1 & P2
11 msg[OT] Reading, editing and then burning a new IS...
9 msgReinstall all packages needed by vim
7 msg'Insufficient space to store' on a network share
1 msgemerge-delta-webrsync fails
3 msgDisk upgrade sanity check pls

untaring backup as a test
\ Mark Knecht (8 May 2008)
. \ Wang, Baojun (8 May 2008)

Subject:Re: untaring backup as a test
Group:Gentoo-user
From:Wang, Baojun
Date:8 May 2008


 

在 2008-05-07三的 19:49 -0700,Mark Knecht写道:
> Hi,
> I'd just like to confirm this before I make a mistake and hurt my system.
>
> The existing system drive is /dev/sda:
>
> /dev/sda3 is root
> /dev/sda1 is boot
>
> That's all there is.
>
> Using the stage4 tar I idea I added a drive which is /dev/sdb and
> has these partitions of interest
>
> /dev/sdb3 will be new root
> /dev/sdb1 will be new boot
> /dev/sdb5 will be new var
> /dev/sdb6 will be new video
>
> I've mounted the new drive under /mnt like this:
>
> /dev/sdb3 /mnt/backups [[[This will be the new / ]]]
> /dev/sdb1 /mnt/backups/boot
> /dev/sdb5 /mnt/backups/var
> /dev/sdb6 /mnt/backups/video
>
> So this essentially creates a new file system that will eventually
> take over when I boot from this drive tomorrow. (Hopefully)
>
> Now, in the video directory I have my stage4 tar file which I want to
> untar into this new drive and not, hopfully, over my old drive. Will
> the following work?
>
> cd /mnt/backups
> tar xjpf video/Sector9-stage4-2008.05.07-custom.tar.bz2
>
> I'm just trying to be really careful here. I think this is all an
> extension of how we build a Gentoo machine by untaring a stage3 file
> but I'm doing it on a system that's live and I don't want to mess up
> the exiting drive.
I think you don't have to tar/untar, using rsync is more straight forward.

just like:

mount /dev/sdb3 /install
cd /install
rsync -av /* . --exclude=/dev --exclude=/proc --exclude=/sys
--exclude=/tmp --exclude=/var/tmp --exclude=/selinux --exclude=...
make sure /sys, /proc are not included (probably also /tmp, /var/tmp)

then:

mkdir -p tmp var/tmp
chmod 1777 tmp var/tmp

mount /dev/sda3 /mnt/temp # orignal / directory
cp -av /mnt/temp/dev . # rsync /dev, not directly because /dev is
dynamically mounted by udev.
mkdir -p sys proc selinux ...

please also don't forget mount /boot before rsync (or tar/untar).

> If this is correct then I'll chroot into the new environment for
> testing, adding grub, etc., and then do a BIOS change to boot off of
> the second drive and hopefully be live.
I think it will be easier to use LVM then you don't have to manage raw harddisk names like hdaX or hdbX, also it's more flexible and easier to management

for your instance, please also don't forget modify /etc/fstab (if
neccessary), but you could also use disklabel/uuid instead of raw
harddisk names), ie:

LABEL=/gentoo / ext3 noatime 0 0
UUID=whatever /var reiserfs noatime,notail,nosuid 0 0
...

> Thanks,
> Mark
--
Wang, Baojun Lanzhou University
Distributed & Embedded System Lab http://dslab.lzu.edu.cn
School of Information Science and Engeneering wangbj
Tianshui South Road 222. Lanzhou 730000 .P.R.China
Tel: +86-931-8912025 Fax: +86-931-8912022




© 2004-2008 readlist.com