Re: Copying Linux to a new drive
hi ya...
am assuming that /dev/md0 is mounted as / and /dev/md1 is mounted
as /mnt/raid/xxx and /dev/md2 is mounted as /mnt/raid/something
and while copying, dont bother to copy /tmp either...
- and you need to run lilo to put an mbr onto the cloned disks
lilo -C /etc/lilo.Clone.conf
- or run dd of the first few blocks
- you probably need to fix /mnt/raid/etc/raidtab too...
c ya
alvin
On Tue, 31 Jul 2001, George Karaolides wrote:
>
> On Tue, 31 Jul 2001, Willi Dyck wrote:
>
> > I would like to know if tar handels the device files right!
>
> It looks like it. I am making a root-raid system. I have created my
> raid arrays, formatted and mounted them under /mnt/raid in the same
> hierarchy as they will be mounted once the system is complete.
> Then:
>
> earth:~# cd /
> earth:/# tar cpf - dev | tar xvpf - -C /mnt/raid
> earth:/# ls -l /dev/md[0-3]
> brw-rw---- 1 root disk 9, 0 Jul 29 12:45 /dev/md0
> brw-rw---- 1 root disk 9, 1 Jul 29 12:45 /dev/md1
> brw-rw---- 1 root disk 9, 2 Jul 29 12:45 /dev/md2
> brw-rw---- 1 root disk 9, 3 Jul 29 12:45 /dev/md3
> earth:/# ls -l /mnt/raid/dev/md[0-3]
> brw-rw---- 1 root disk 9, 0 Jul 29 12:45 /mnt/raid/dev/md0
> brw-rw---- 1 root disk 9, 1 Jul 29 12:45 /mnt/raid/dev/md1
> brw-rw---- 1 root disk 9, 2 Jul 29 12:45 /mnt/raid/dev/md2
> brw-rw---- 1 root disk 9, 3 Jul 29 12:45 /mnt/raid/dev/md3
>
> It looks OK to me (thanks for getting me to check; I didn't think about
> the device files, I was more worried about permissions and owners).
>
> I proceed similarly for all top-level directories in /, changing only the
> source dir. name for each command:
>
> earth:/# tar cpf - bin | tar xvpf - -C /mnt/raid
> earth:/# tar cpf - boot | tar xvpf - -C /mnt/raid
>
> etc., except for /proc and /mnt, for obvious reasons:
>
> earth:/# mkdir /mnt/raid/proc
> earth:/# mkdir /mnt/raid/mnt
>
> This is also the reason why this won't work:
> earth:/# cd /
> earth:/# tar cpf - . | tar xvpf - -C /mnt/raid
>
> You do need the separate commands for each dir.
>
> Since the target filesystems are mounted, everything ends up in the right
> place without worrying about only tarring in the source filesystem,
> changing working dirs. etc. I am very lazy, I can be very absent-minded,
> and my typing is awful... :) so this is what I do to make my life easy.
>
> It "seems to work"(TM); i was just worried that I was overlooking
> something (cf. "No; it can't be that easy; this is UNIX, after all... :) )
>
Reply to: