FW: [GOLUM] HD Question

epsas at inflicted.net epsas at inflicted.net
Fri Aug 17 16:14:10 PDT 2001


Rob, 

I'll spare you the 2x4 - since I've been laid off, I've found it's harder to pay for injury claims caused by the more conventional information packing tools. - I'll give you a textual rundown on how that command line works instead:

	$ cd /home/rob/test; tar -cvpf - ./ | (cd /mnt/newHD/test; tar -xvpf -)

'Okay, what is happening here?'  

    The basic idea behind this tar command is to: first, Create an archive and output it to stdout ('tar -cf - '); and then to eXtract the archive piped through stdin (`tar -xf -`).   The hyphen used in the place of a filename (foo.tar) orders tar to process an archive as either a stream from stdin, or to stdout.

	$ tar -xf - ./ | tar -cf -

    Using tar to archive and extract files through a pipe is not very useful unless you find a way to move your Present Working Directory (PWD) to a new location in your filesystem; `tar -cf - ./|tar -xf -` is one way to get yourself nowhere, (not so) quick...  One way to change your PWD is by using the `cd` command to change your location in the filesystem BEFORE you begin the archive eXtraction process.  This can be done by creating a Compound Command by using parentheses (list); where 'list' is the sequence of commands that you wish to execute.     
    


I hope that this helps you out a little bit.  Tar is the best way to copy heinous amounts of data between filesystems, and compound shell commands are always good party tricks to have in your Unix repertoire.

Also, I'll be looking for a good FAQ or HOWTO on using `dd` to duplicate partition information on heterogenous hard drives.  I know how to do it, but I do not want to give you advice that I cannot first test on my own hardware- and I do not have a spare drive installed on my machines.

Adidas,
Charles





On Fri, Aug 17, 2001 at 12:52:03PM -1000, Hershberger, Robert T Mr (CPF N63RTH) wrote:
>   OK I'm going to start again, using tar this time.  My problem at the
> moment is one of cleverness.  I looked at what you wrote below, read the man
> page, and the --help, but I don't think I really understand.  Here is what I
> think is suppose to happen:
> 
>   at a CLI I type (I'm not going to use -X exclude_file, right off) exactly
> as shown (/mnt/newHD is the root directory for the new Hard Drive):
> 
>      cd /
>      tar -cvpf - ./| (cd /mnt/newHD; tar -xvpf -)
> 
>   and just sit back and watch it spin?  And that should do what I want
> better then the cp command?  I apologize, but the piping has me confused as
> to actually what is happening, so I really need to be spoon fed this or have
> a long winded explanation complete with 2X4s (information packing tool).
>   Alright thanks in advance.
> 
> Robert
> 
> 
> 
> 
> 
> -----Original Message-----
> From: epsas at inflicted.net [mailto:epsas at inflicted.net]
> Sent: Thursday, August 16, 2001 11:16 AM
> To: Linux & Unix Advocates & Users
> Subject: [luau] Re: FW: [GOLUM] HD Question
> 
> 
> Robert,
> 
> Okay, it looks like you opened a can of worms when copying over the
> partition data...  and it is hard to diagnose the situation without detailed
> information from your syslog and dmesg.
> 
> For the xfs situation - 
>   
>   After booting, I would grep dmesg, or the syslog (or /var/log/messages) to
> find out what happens when the xfs init.d script is run, if it is being run
> at all. - if that doesn't yield any clues, try running the init.d script by
> hand - `/etc/rc.d/init.d/xfs start` (usage may vary between different
> distributions, I don't have much experience with Redhat(?), so the actual
> location of the xfs script for your system is an unknown.
> 
> 
> For .bashrc - 
> 
>   I would, as root, call bash through strace or truss:  `strace bash` - take
> a close look at the output to see where there might be an error.  It might
> be something as simple as a permissions glitch. 
> 
> 
> As for copying copious amounts of data... (This is nitpicking really :) - 
>   
>   I usually use tar instead of cp to copy heinous amounts of system data.
> cp is "safe" - however, it isn't very efficient, and I've never trusted it
> enough to copy an entire / filesystem.  
> 
>     sh# cd /
>     sh# tar -X exclude_file -cvpf - ./| (cd /mnt/; tar -xvpf -)
>     (Where 'exclude_file' is a text list of directories that you do NOT want
> to archive, usually, /mnt/, /tmp)
> 
> 
> Also, check the permissions for /tmp - they may be set wrong.  Did you copy
> over the complete /var directory?
> 
> 
> Again, check the logs, check the logs, check the logs.
> 
> 
> As for your partitions - You could have used `dd` to copy over the raw
> partition data for / to your new drive.  In fact, I would reccomend doing
> this instead of using `tar` or `cp`.  After you have the new partition
> created, you can then slice and dice the remaining HD space however you want
> to offload /usr and /home to seperate partitions. 
> 
> If this machine is "production," I would strongly reccomend doing the
> partition replication over again.  It sounds like you already have too many
> problems with the system to be completely sure that another show-stopping
> bug is waiting for you in the coming weeks.
> 
> Bon chance avec tout,
> Charles
> 
> 
> On Thu, Aug 16, 2001 at 10:58:25AM -1000, Hershberger, Robert T Mr (CPF
> N63RTH) wrote:
> > All,
> > 
> >   I got a new HD, partitioned it, copied files from my old drive to the
> new
> > and got the whole thing to boot.  the command I used to copy was 'cp -dpRx
> > {source} {destination}' and all that worked out.  But now that I've gotten
> > past that hurtle I have other problems ...
> > 
> >   root does not read any .bashrc file (user accounts do on the other hand)
> > when I log in.  If I /bin/bash the second shell does so.
> >   X doesn't work due to the fact that the xfs daemon doesn't start up on
> > boot.  here is the output of ps & chkconfig  fresh from boot:
> > 
> > 	ps -aux | grep xfs
> > 	root      1261  0.0  0.4  1516  580 tty1     S    10:24   0:00 grep
> > xfs
> > 
> > 	chkconfig --list xfs
> > 	xfs            	0:off	1:off	2:on	3:on	4:on	5:on
> > 6:off
> > 
> > 
> >   when I force xfs to start, using xfs -daemon, I can start X no problem.
> 
> >   the user accounts also have problems.  using netscape I can surf and
> read
> > email, but if I attempt to send email the app tells me that it could not
> > create a temporary file and so failed to send the email.  So that are the
> > most apparent problems right off the bat.  does anyone know what sort of
> > things I need to do at this point to get it all working again?  TIA
> > 
> > Robert Hershberger
> > 
> > 
> > ---
> > You are currently subscribed to luau as: epsas at inflicted.net
> > To unsubscribe send a blank email to $subst('Email.Unsub')
> > 
> 
> ---
> You are currently subscribed to luau as: hershberger at bigfoot.com
> To unsubscribe send a blank email to $subst('Email.Unsub')
> 
> ---
> You are currently subscribed to luau as: epsas at inflicted.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> 



More information about the LUAU mailing list