Skip to Content.
Sympa Menu

baslinux - Re: [BL] hard drive resets during 'find'

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: Sindi Keesan <keesan AT iamjlamb.com>
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] hard drive resets during 'find'
  • Date: Tue, 30 Dec 2003 20:38:13 -0500 (EST)

Why do you say that we cannot copy the contents of hda3 (current linux
partition on an 8G hard drive) to hdb (only partition on a 400MB second
hard drive on the same controller) but only to hdb1 or hdb2 etc.? Are
hard drives always numbered even if there is only one on the controller?
Or are you reminding me that if we want to copy all the files to another
drive for use in another computer we should have a DOS and a linux
partition? Unfortunately we cannot do that in this case as it would give
us five primary partitions, so I was just thinking of using the second
copy of linux

1) to test whether the first hard drive is the problem (is it what is
causing the frequent resets)

2) to put into another computer that already has a DOS and a linux
partition and copy linux to hda2 on that computer.

These are all excellent ideas. As usual, linux always has at least three
ways to do anything (as in the case of my SiS video chip which seems to be
usable with four different servers). Thanks. (no more comments below)

> You pipe the output of tar -c to tar -x
> ------------------------------------------
> #!/bin/bash
> ##copy a directory or partition
> tar -C "$1" -cOl . | tar -C "$2" -xpf -
> ------------------------------------------
> The first parameter ($1) is the source directory.
> The second parametner ($2) is the target directory.
>
> Note: if the target directory is mounted somewhere below
> the source directory (eg. /mnt), you could end up with the
> target directory (and its subdirectories) being included
> in the copy (recursively). The cleanest way to do this
> copy is from a third filesystem (eg. ramdisk BasicLinux).
>
> If you are using the ramdisk BasicLinux to do the copy,
> you could use the send/receive utility instead of the
> above tar script. Although send/receive were designed
> for use across a network, they can also be used on a single
> system. Simply mount the source and target partitions, cd
> to the target partition and execute:
> -------
> receive
> -------
> Then press ALT-F2 and login again. cd to the source partition
> and execute:
> ----
> send
> ----
> When asked for the hostname of the target, enter: localhost
>
> So, for example, to copy the entire filesystem from /dev/hda3
> to /dev/hdb2:
> (1) mke2fs /dev/hdb2
> (2) mount /dev/hdb2 /hd
> (3) cd /hd
> (4) receive
> (5) [second login]
> (6) mount /dev/hda3 /mnt
> (7) cd /mnt
> (8) send
> (9) localhost
> (10) *
>
> You may be wondering why we don't simply copy (cp) the filesystem
> from the source partition to the target partition. The problem is
> that a simple cp messes up the permissions and links. You can get
> around this by using the -a parameter for cp, but I've still found
> that links occasionally get fouled this way. The safests way to
> handle such a transfer is via tar (which is what send/receive use).
>
> > Are you suggesting that we archive/zip all the files into one
> > large one on the other partition?
>
> Yes, it can be done that way (and is probably best for newbies).
> --------------------
> cd /
> tar -zcvf temp.tgz *
> --------------------
> That gives you a big temp.tgz file in /. Now mount the target
> partition and cd to it.
> -------------------
> tar -zxvf /temp.tgz
> -------------------
> That will unzip the compressed filesystem to the target partition
>
> With this method there is no risk of recursion (as long as you
> don't mount the target partition until after temp.tgz has been
> created). And, as a two-step process, it is easier to newbies
> to sort out problems. As long as you have room on the source
> partition for temp.tgz, this is the method I would recommend.
>
> > really don't follow how you suggest copying all the linux
> > files from hda3 to hdb.
>
> They won't go to hdb. They will go to hdb1 or to hdb2 or to
> hdb3 ...
>
> > Is tar used instead of (DOS) xcopy?
>
> cp is the closest equivalent of DOS xcopy. Feel free to use
> it (with -a parameter), but don't be surprised if you get an
> occasional link that wasn't carried over. Most experienced
> Linux users prefer tar for this purpose.
>
> > I don't think there is room on the linux partition that we
> > have to copy all the files to a .tgz file on that partition.
>
> Any partition (even DOS) will suffice for temp.tgz
>
> Cheers,
> Steven
> _______________________________________________
> BasLinux mailing list
> BasLinux AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/baslinux
>





Archive powered by MHonArc 2.6.24.

Top of Page