Re: using a disk "mirrored" with dd

2004-08-03 Thread Jerry McAllister
> 
> Matt <[EMAIL PROTECTED]> wrote:
> 
> > I have a machine running 4.10-RELEASE-p2 with two identical hard disks
> > -- ad0 and ad2. I would like to make a complete copy of the first disk
> > to the second disk nightly for quick disaster recovery.
> > 
> > I've dd'ed the disk as follows
> > 
> > # dd if=/dev/ad0 of=/dev/ad2
> > 
> > and edited the disklabel of the second disk to change ad0s1 to ad2s1 as follows
> > 
> > # disklabel -e -r ad2
> > 
> > However, I'm still unable to mount the root partion (or any other
> > partition) of the second disk to tweak /etc/fstab etc. even though
> > 
> > # mount /dev/ad2s1a /mnt
> > mount: /dev/ad2s1a: Operation not permitted

Not an answer to your specific question, but I would suggest doing
the whole thing a little differently.

First fdisk, disklabel and newfs the drive to make the filesystems
you want, including making the slice bootable, etc.   Then copy
each filesystem on the previous disk using dump(8)/restore(8).   
If you have enough scratch space, you can dump to files in spare space 
and then restore from those.  Or, you can pipe a dump to a restore.  
It is preferable to using dd for something like this.

jerry

> 
> What is your securelevel?  See man securelevel.
> 
> > 
> > What am I missing? Is there anything else I need to do beyond editing
> > the disklabel to allow me to use the "mirrored" disk?
> > 
> > Output of disklabel for the two disks follows:
> > 
> > # disklabel ad0
> > # /dev/ad0c:
> > type: ESDI
> > disk: ad0s1
> > label: 
> > flags:
> > bytes/sector: 512
> > sectors/track: 63
> > tracks/cylinder: 255
> > sectors/cylinder: 16065
> > cylinders: 4864
> > sectors/unit: 78156162
> > rpm: 3600
> > interleave: 1
> > trackskew: 0
> > cylinderskew: 0
> > headswitch: 0   # milliseconds
> > track-to-track seek: 0  # milliseconds
> > drivedata: 0 
> > 
> > 8 partitions:
> > #size   offsetfstype   [fsize bsize bps/cpg]
> >   a:   40960004.2BSD 2048 1638497   # (Cyl.0 - 25*)
> >   b:  5242880   409600  swap# (Cyl.   25*- 351*)
> >   c: 781561620unused0 0 # (Cyl.0 - 4864*)
> >   e:  4194304  56524804.2BSD 2048 1638489   # (Cyl.  351*- 612*)
> >   f: 10485760  98467844.2BSD 2048 1638489   # (Cyl.  612*- 1265*)
> >   g: 18874368 203325444.2BSD 2048 1638489   # (Cyl. 1265*- 2440*)
> > 
> > # disklabel ad2
> > # /dev/ad2c:
> > type: ESDI
> > disk: ad2s1
> > label: 
> > flags:
> > bytes/sector: 512
> > sectors/track: 63
> > tracks/cylinder: 255
> > sectors/cylinder: 16065
> > cylinders: 4864
> > sectors/unit: 78156162
> > rpm: 3600
> > interleave: 1
> > trackskew: 0
> > cylinderskew: 0
> > headswitch: 0   # milliseconds
> > track-to-track seek: 0  # milliseconds
> > drivedata: 0 
> > 
> > 8 partitions:
> > #size   offsetfstype   [fsize bsize bps/cpg]
> >   a:   40960004.2BSD 2048 1638497   # (Cyl.0 - 25*)
> >   b:  5242880   409600  swap# (Cyl.   25*- 351*)
> >   c: 781561620unused0 0 # (Cyl.0 - 4864*)
> >   e:  4194304  56524804.2BSD 2048 1638489   # (Cyl.  351*- 612*)
> >   f: 10485760  98467844.2BSD 2048 1638489   # (Cyl.  612*- 1265*)
> >   g: 18874368 203325444.2BSD 2048 1638489   # (Cyl. 1265*- 2440*)
> > 
> > Thanks for any insight, and let me know if you need to see anything else.
> > 
> > -Matt
> > ___
> > [EMAIL PROTECTED] mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to "[EMAIL PROTECTED]"
> 
> 
> -- 
> Bill Moran
> Potential Technologies
> http://www.potentialtech.com
> ___
> [EMAIL PROTECTED] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"
> 

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: using a disk "mirrored" with dd

2004-08-03 Thread Bill Moran
Matt <[EMAIL PROTECTED]> wrote:

> I have a machine running 4.10-RELEASE-p2 with two identical hard disks
> -- ad0 and ad2. I would like to make a complete copy of the first disk
> to the second disk nightly for quick disaster recovery.
> 
> I've dd'ed the disk as follows
> 
> # dd if=/dev/ad0 of=/dev/ad2
> 
> and edited the disklabel of the second disk to change ad0s1 to ad2s1 as follows
> 
> # disklabel -e -r ad2
> 
> However, I'm still unable to mount the root partion (or any other
> partition) of the second disk to tweak /etc/fstab etc. even though
> 
> # mount /dev/ad2s1a /mnt
> mount: /dev/ad2s1a: Operation not permitted

What is your securelevel?  See man securelevel.

> 
> What am I missing? Is there anything else I need to do beyond editing
> the disklabel to allow me to use the "mirrored" disk?
> 
> Output of disklabel for the two disks follows:
> 
> # disklabel ad0
> # /dev/ad0c:
> type: ESDI
> disk: ad0s1
> label: 
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 255
> sectors/cylinder: 16065
> cylinders: 4864
> sectors/unit: 78156162
> rpm: 3600
> interleave: 1
> trackskew: 0
> cylinderskew: 0
> headswitch: 0   # milliseconds
> track-to-track seek: 0  # milliseconds
> drivedata: 0 
> 
> 8 partitions:
> #size   offsetfstype   [fsize bsize bps/cpg]
>   a:   40960004.2BSD 2048 1638497   # (Cyl.0 - 25*)
>   b:  5242880   409600  swap# (Cyl.   25*- 351*)
>   c: 781561620unused0 0 # (Cyl.0 - 4864*)
>   e:  4194304  56524804.2BSD 2048 1638489   # (Cyl.  351*- 612*)
>   f: 10485760  98467844.2BSD 2048 1638489   # (Cyl.  612*- 1265*)
>   g: 18874368 203325444.2BSD 2048 1638489   # (Cyl. 1265*- 2440*)
> 
> # disklabel ad2
> # /dev/ad2c:
> type: ESDI
> disk: ad2s1
> label: 
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 255
> sectors/cylinder: 16065
> cylinders: 4864
> sectors/unit: 78156162
> rpm: 3600
> interleave: 1
> trackskew: 0
> cylinderskew: 0
> headswitch: 0   # milliseconds
> track-to-track seek: 0  # milliseconds
> drivedata: 0 
> 
> 8 partitions:
> #size   offsetfstype   [fsize bsize bps/cpg]
>   a:   40960004.2BSD 2048 1638497   # (Cyl.0 - 25*)
>   b:  5242880   409600  swap# (Cyl.   25*- 351*)
>   c: 781561620unused0 0 # (Cyl.0 - 4864*)
>   e:  4194304  56524804.2BSD 2048 1638489   # (Cyl.  351*- 612*)
>   f: 10485760  98467844.2BSD 2048 1638489   # (Cyl.  612*- 1265*)
>   g: 18874368 203325444.2BSD 2048 1638489   # (Cyl. 1265*- 2440*)
> 
> Thanks for any insight, and let me know if you need to see anything else.
> 
> -Matt
> ___
> [EMAIL PROTECTED] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"


-- 
Bill Moran
Potential Technologies
http://www.potentialtech.com
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: using a disk "mirrored" with dd

2004-08-02 Thread Matt
On Tue, 3 Aug 2004 08:43:24 +0200 (CEST), Konrad Heuer <[EMAIL PROTECTED]> wrote:
> 
> 
> 
> On Tue, 3 Aug 2004, Matt wrote:
> 
> > I have a machine running 4.10-RELEASE-p2 with two identical hard disks
> > -- ad0 and ad2. I would like to make a complete copy of the first disk
> > to the second disk nightly for quick disaster recovery.
> >
> > I've dd'ed the disk as follows
> >
> > # dd if=/dev/ad0 of=/dev/ad2
> >
> > and edited the disklabel of the second disk to change ad0s1 to ad2s1 as follows
> >
> > # disklabel -e -r ad2
> >
> > However, I'm still unable to mount the root partion (or any other
> > partition) of the second disk to tweak /etc/fstab etc. even though
> >
> > # mount /dev/ad2s1a /mnt
> > mount: /dev/ad2s1a: Operation not permitted
> >
[snip]
> > Thanks for any insight, and let me know if you need to see anything else.
> 
> Did you do the dd-copy while the system was running multi-user from the
> first disk? I'd expect larger problems then because the file systems
> inconsistencies on the second disk may never be resolved.
> 
> If you did it in single user mode, a 'fsck -y' for each file system on the
> second disk before trying to mount may help.

Yep,  fsck -y did the trick.

Thanks Konrad
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: using a disk "mirrored" with dd

2004-08-02 Thread Konrad Heuer

On Tue, 3 Aug 2004, Matt wrote:

> I have a machine running 4.10-RELEASE-p2 with two identical hard disks
> -- ad0 and ad2. I would like to make a complete copy of the first disk
> to the second disk nightly for quick disaster recovery.
>
> I've dd'ed the disk as follows
>
> # dd if=/dev/ad0 of=/dev/ad2
>
> and edited the disklabel of the second disk to change ad0s1 to ad2s1 as follows
>
> # disklabel -e -r ad2
>
> However, I'm still unable to mount the root partion (or any other
> partition) of the second disk to tweak /etc/fstab etc. even though
>
> # mount /dev/ad2s1a /mnt
> mount: /dev/ad2s1a: Operation not permitted
>
> What am I missing? Is there anything else I need to do beyond editing
> the disklabel to allow me to use the "mirrored" disk?
>
> Output of disklabel for the two disks follows:
>
> # disklabel ad0
> # /dev/ad0c:
> type: ESDI
> disk: ad0s1
> label:
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 255
> sectors/cylinder: 16065
> cylinders: 4864
> sectors/unit: 78156162
> rpm: 3600
> interleave: 1
> trackskew: 0
> cylinderskew: 0
> headswitch: 0   # milliseconds
> track-to-track seek: 0  # milliseconds
> drivedata: 0
>
> 8 partitions:
> #size   offsetfstype   [fsize bsize bps/cpg]
>   a:   40960004.2BSD 2048 1638497   # (Cyl.0 - 25*)
>   b:  5242880   409600  swap# (Cyl.   25*- 351*)
>   c: 781561620unused0 0 # (Cyl.0 - 4864*)
>   e:  4194304  56524804.2BSD 2048 1638489   # (Cyl.  351*- 612*)
>   f: 10485760  98467844.2BSD 2048 1638489   # (Cyl.  612*- 1265*)
>   g: 18874368 203325444.2BSD 2048 1638489   # (Cyl. 1265*- 2440*)
>
> # disklabel ad2
> # /dev/ad2c:
> type: ESDI
> disk: ad2s1
> label:
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 255
> sectors/cylinder: 16065
> cylinders: 4864
> sectors/unit: 78156162
> rpm: 3600
> interleave: 1
> trackskew: 0
> cylinderskew: 0
> headswitch: 0   # milliseconds
> track-to-track seek: 0  # milliseconds
> drivedata: 0
>
> 8 partitions:
> #size   offsetfstype   [fsize bsize bps/cpg]
>   a:   40960004.2BSD 2048 1638497   # (Cyl.0 - 25*)
>   b:  5242880   409600  swap# (Cyl.   25*- 351*)
>   c: 781561620unused0 0 # (Cyl.0 - 4864*)
>   e:  4194304  56524804.2BSD 2048 1638489   # (Cyl.  351*- 612*)
>   f: 10485760  98467844.2BSD 2048 1638489   # (Cyl.  612*- 1265*)
>   g: 18874368 203325444.2BSD 2048 1638489   # (Cyl. 1265*- 2440*)
>
> Thanks for any insight, and let me know if you need to see anything else.

Did you do the dd-copy while the system was running multi-user from the
first disk? I'd expect larger problems then because the file systems
inconsistencies on the second disk may never be resolved.

If you did it in single user mode, a 'fsck -y' for each file system on the
second disk before trying to mount may help.

Best regards

Konrad Heuer
GWDG, Am Fassberg, 37077 Goettingen, Germany, [EMAIL PROTECTED]

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


using a disk "mirrored" with dd

2004-08-02 Thread Matt
I have a machine running 4.10-RELEASE-p2 with two identical hard disks
-- ad0 and ad2. I would like to make a complete copy of the first disk
to the second disk nightly for quick disaster recovery.

I've dd'ed the disk as follows

# dd if=/dev/ad0 of=/dev/ad2

and edited the disklabel of the second disk to change ad0s1 to ad2s1 as follows

# disklabel -e -r ad2

However, I'm still unable to mount the root partion (or any other
partition) of the second disk to tweak /etc/fstab etc. even though

# mount /dev/ad2s1a /mnt
mount: /dev/ad2s1a: Operation not permitted

What am I missing? Is there anything else I need to do beyond editing
the disklabel to allow me to use the "mirrored" disk?

Output of disklabel for the two disks follows:

# disklabel ad0
# /dev/ad0c:
type: ESDI
disk: ad0s1
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 4864
sectors/unit: 78156162
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0   # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0 

8 partitions:
#size   offsetfstype   [fsize bsize bps/cpg]
  a:   40960004.2BSD 2048 1638497   # (Cyl.0 - 25*)
  b:  5242880   409600  swap# (Cyl.   25*- 351*)
  c: 781561620unused0 0 # (Cyl.0 - 4864*)
  e:  4194304  56524804.2BSD 2048 1638489   # (Cyl.  351*- 612*)
  f: 10485760  98467844.2BSD 2048 1638489   # (Cyl.  612*- 1265*)
  g: 18874368 203325444.2BSD 2048 1638489   # (Cyl. 1265*- 2440*)

# disklabel ad2
# /dev/ad2c:
type: ESDI
disk: ad2s1
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 4864
sectors/unit: 78156162
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0   # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0 

8 partitions:
#size   offsetfstype   [fsize bsize bps/cpg]
  a:   40960004.2BSD 2048 1638497   # (Cyl.0 - 25*)
  b:  5242880   409600  swap# (Cyl.   25*- 351*)
  c: 781561620unused0 0 # (Cyl.0 - 4864*)
  e:  4194304  56524804.2BSD 2048 1638489   # (Cyl.  351*- 612*)
  f: 10485760  98467844.2BSD 2048 1638489   # (Cyl.  612*- 1265*)
  g: 18874368 203325444.2BSD 2048 1638489   # (Cyl. 1265*- 2440*)

Thanks for any insight, and let me know if you need to see anything else.

-Matt
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"