Re: copy /var/spool/mail

From: Bill Schindler (wbs_at_wschindler.net)
Date: 01/20/04


Date: Tue, 20 Jan 2004 02:58:09 GMT


"Peter" <peter@visors.com.hk> wrote in message
news:buhvuv$4lq1@imsp212.netvigator.com...
> Hi,
>
> I am going to copy my /var/spool/mail from one hard disk onto another hard
> disk. I am using Redhat Linux 6.2. Originally this system only has one
> hard disk. Can I just plug in the source hard disk as a slave and the
other
> as a master and then copy the /var/spool/mail from the slave to the
master.
> Will Linux automatically recognize the slave that I put in?
>
> Do I have to run any mount commands?
>
> Thanks.
>
> Peter
>
>
>
>
>Hi Peter,

 I am assuming that you are copying from a smaller to larger disk on the
same machine.

Doing what you want is easy. I would like to clarify what I think you are
trying to do though. I assume one computer with a "new" disk drive as the
boot disk and the "old" as the one containing the /var/spool/mail.

If you attach the old drive as a "secondary" or "slave" drive on the same
interface (cable) as the boot drive, then your new (boot) disk is /dev/hda
and your old disk is /dev/hdb. Become root with:

su
<password>
mkdir /mnt/olddisk
mount /dev/hdb3 /mnt/olddisk

NOTE: It has been a while since I ran 6.2 and I almost never use default
mount points, so I am only assuming that /dev/hdb3 contains your /var mount
point.

By doing the mount you can now copy the old mail files to the new drive with
the copy command:

cp /mnt/olddisk/var/spool/mail /var/spool/mail

Be careful, you will overwrite all the files of the same name on the new
drive. You may want to backup your target before you do this.

You can then do

/sbin/shutdown -h now

to shut down your machine and remove the old drive.

Be careful when doing this, I migrate file systems all the time when
upgrading hardware, but you don't sound too sure about this kind of
procedure and you should not attempt to do this kind of thing unless you
understand what is happening.

You may want to look at

man mount
man cp

to review what these commands do.

HTH

Bill



Relevant Pages

  • SUMMARY: Creating bare-metal recovery disks
    ... Copy system disk ... To create an ADVFS root and /usr partition, ... Next you are going to need to make the following mount points: ... mkdir /rootclone ...
    (Tru64-UNIX-Managers)
  • Re: having trouble mounting disk image on loopback device
    ... a dd image taken from a physical disk. ... Therefore, to mount each partition, I used these commands: ... mount command will not suffice...For that matter, ... The device must contain a filesystem recognizable ...
    (comp.os.linux.misc)
  • Re: NFS mounts not largefiles by default?
    ... > That's simply because there is no such mount option for nfs filesystems. ... >>up several terminal sessions on the console which appeared to be hung ... three Sun Rays, and I don't normally use its console, just the Rays. ... directories are on a separate disk. ...
    (comp.unix.solaris)
  • Re: Diagnosing the colored pinwheel
    ... Your boot drive needs a minimum of 15% unused disk space so it can create files for swapping and other system-related activity. ... Activity Monitor and top do specific work that will not highlight some symptoms an app or system may exhibit. ... Boot drive means that mount that the system and kernel was loaded from, typically the one given the "/" designation. ...
    (comp.sys.mac.apps)
  • Re: USB stick access freezing up system?
    ... would expect the application to fail, but the stick is just a mount in ... How can it corrupt a filesystem on a device that's been removed? ... corruption of its filesystem, ... I have transported an MFM disk that had not been parked with the ...
    (comp.unix.bsd.freebsd.misc)