Re: duplicate a drive

2008-10-26 Thread RW
On Sat, 25 Oct 2008 08:07:34 +0100
Matthew Seaman [EMAIL PROTECTED] wrote:

 RW wrote:
  On Fri, 24 Oct 2008 12:19:23 -0600 (MDT)
  Warren Block [EMAIL PROTECTED] wrote:
  
  http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html#NEW-HUGE-DISK
 
  
  The best way is to reinstall the OS on the new disk, then move the
  user data over. This is highly recommended if you have been
  tracking -STABLE for more than one release, or have updated a
  release instead of installing a new one.
  
  
  Highly recommended seems a very strange thing for the FAQ to be
  saying. It's implying that FreeBSD base-system upgrades are a
  bit flaky. It even goes on Should you decide not to do a fresh
  install, as if to say you have been warned.
  
  Unless my experience is abnormal, we seem to be publishing our own
  FUD.
 
 When does a valid assessment of the difficulty of a certain course of 
 action turn into an unjustified attempt to spread Fear, Uncertainty
 and Doubt?   This is not FUD because it is absolutely true.  You will
 get better results by making a new install on your new hard drive and 
 merging over your data.  ... install 7.x into a disk layout originally
 designed for 4.x you ... change from UFS1 to UFS2 ... across major
 version numbers

I don't think anyone would dispute that a new disk is a good
opportunity to avoid a major release upgrade, or to fix problems on a
very old installation. What it says is: highly recommended if you ...
have updated a release. 

If you have a system that's been across a few minor releases
and is working well, I would think the risks of screwing it up on a
reinstall greatly outweigh any benefits - particularly if it involves
reinstalling a lot of ports.  





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


Re: duplicate a drive

2008-10-25 Thread Matthew Seaman

RW wrote:

On Fri, 24 Oct 2008 12:19:23 -0600 (MDT)
Warren Block [EMAIL PROTECTED] wrote:


http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html#NEW-HUGE-DISK



The best way is to reinstall the OS on the new disk, then move the user
data over. This is highly recommended if you have been tracking -STABLE
for more than one release, or have updated a release instead of
installing a new one.


Highly recommended seems a very strange thing for the FAQ to be
saying. It's implying that FreeBSD base-system upgrades are a
bit flaky. It even goes on Should you decide not to do a fresh
install, as if to say you have been warned.

Unless my experience is abnormal, we seem to be publishing our own FUD.


When does a valid assessment of the difficulty of a certain course of 
action turn into an unjustified attempt to spread Fear, Uncertainty and 
Doubt?   This is not FUD because it is absolutely true.  You will get
better results by making a new install on your new hard drive and 
merging over your data.  Aside from anything else, the recommended 
partitioning has changed significantly over the years, and if you try 
and install 7.x into a disk layout originally designed for 4.x you will be a very unhappy bunny indeed[1].  Not to mention such things as the 
change from UFS1 to UFS2.


Base system upgrades /across major version numbers/ are difficult.  
Unless you have guru-like capabilities, a fanatical level of interest

in the OS internals and a great deal of luck, then it is entirely
likely that you will run into problems you will be unable to solve.
The 6.x to 7.x upgrade is really the first one that I've felt happy to 
do by re-compiling the system in-situ: even so, getting all the 
installed software correctly recompiled and linked against the new 7.x 
shlibs requires a deal of care to make work correctly.


Cheers,

Matthew

[1] Of course, if you'ld adopted the 'one big partition' layout which 
I've been known to advocate here and there, this wouldn't be a problem.


--
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
 Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
 Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature


duplicate a drive

2008-10-24 Thread Joey Mingrone
Hi,

My laptop died recently and to get back to work as quickly as
possible I simply took the laptop ide drive and put it into an old
desktop using a 2.5 - 3.5 ide adapter.  After loading a few new
drivers into the kernel everything is working quite well.

The next thing I've tried to do, without success, is mirror the
contents of the 2.5 drive to a 3.5 drive in the desktop.

The 2.5 drive is sliced/partitioned like this:

Filesystem  SizeMounted on
/dev/ad0s2a 989M   /
/dev/ad0s2d 989M   /tmp
/dev/ad0s2f  59G /usr
/dev/ad0s2e 989M   /var

ad0s1 is a 20GB slice that I have window installed on.

The drive's total capacity is 80G.

The 3.5 drive is only 70G so I'll have to skip the ad0s1 slice.
Ideally what I'd like to do is copy everything from the ad0s2 slice to
the 3.5 and run the OS off that drive.  Then, each dump the contents
of the 3.5 drive to the 2.5 drive.  That way if either drive dies
I'll, hopefully at worst, just have to switch which drive I boot from.

Can anyone with experience doing something this make suggestions?

Thanks,

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


Re: duplicate a drive

2008-10-24 Thread Jeremy Chadwick
On Fri, Oct 24, 2008 at 01:29:18PM -0300, Joey Mingrone wrote:
 Hi,
 
 My laptop died recently and to get back to work as quickly as
 possible I simply took the laptop ide drive and put it into an old
 desktop using a 2.5 - 3.5 ide adapter.  After loading a few new
 drivers into the kernel everything is working quite well.
 
 The next thing I've tried to do, without success, is mirror the
 contents of the 2.5 drive to a 3.5 drive in the desktop.
 
 The 2.5 drive is sliced/partitioned like this:
 
 Filesystem  SizeMounted on
 /dev/ad0s2a 989M   /
 /dev/ad0s2d 989M   /tmp
 /dev/ad0s2f  59G /usr
 /dev/ad0s2e 989M   /var
 
 ad0s1 is a 20GB slice that I have window installed on.
 
 The drive's total capacity is 80G.
 
 The 3.5 drive is only 70G so I'll have to skip the ad0s1 slice.
 Ideally what I'd like to do is copy everything from the ad0s2 slice to
 the 3.5 and run the OS off that drive.  Then, each dump the contents
 of the 3.5 drive to the 2.5 drive.  That way if either drive dies
 I'll, hopefully at worst, just have to switch which drive I boot from.
 
 Can anyone with experience doing something this make suggestions?

ports/sysutils/cpdup?

-- 
| Jeremy Chadwickjdc at parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

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


Re: duplicate a drive

2008-10-24 Thread Warren Block

On Fri, 24 Oct 2008, Joey Mingrone wrote:


The next thing I've tried to do, without success, is mirror the
contents of the 2.5 drive to a 3.5 drive in the desktop.

The 2.5 drive is sliced/partitioned like this:

Filesystem  SizeMounted on
/dev/ad0s2a 989M   /
/dev/ad0s2d 989M   /tmp
/dev/ad0s2f  59G /usr
/dev/ad0s2e 989M   /var

ad0s1 is a 20GB slice that I have window installed on.

The drive's total capacity is 80G.

The 3.5 drive is only 70G so I'll have to skip the ad0s1 slice.
Ideally what I'd like to do is copy everything from the ad0s2 slice to
the 3.5 and run the OS off that drive.  Then, each dump the contents
of the 3.5 drive to the 2.5 drive.  That way if either drive dies
I'll, hopefully at worst, just have to switch which drive I boot from.

Can anyone with experience doing something this make suggestions?


http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html#NEW-HUGE-DISK

-Warren Block * Rapid City, South Dakota USA
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: duplicate a drive

2008-10-24 Thread Jerry McAllister
On Fri, Oct 24, 2008 at 01:29:18PM -0300, Joey Mingrone wrote:

 Hi,
 
 My laptop died recently and to get back to work as quickly as
 possible I simply took the laptop ide drive and put it into an old
 desktop using a 2.5 - 3.5 ide adapter.  After loading a few new
 drivers into the kernel everything is working quite well.
 
 The next thing I've tried to do, without success, is mirror the
 contents of the 2.5 drive to a 3.5 drive in the desktop.
 
 The 2.5 drive is sliced/partitioned like this:
 
 Filesystem  SizeMounted on
 /dev/ad0s2a 989M   /
 /dev/ad0s2d 989M   /tmp
 /dev/ad0s2f  59G /usr
 /dev/ad0s2e 989M   /var
 
 ad0s1 is a 20GB slice that I have window installed on.
 
 The drive's total capacity is 80G.
 
 The 3.5 drive is only 70G so I'll have to skip the ad0s1 slice.
 Ideally what I'd like to do is copy everything from the ad0s2 slice to
 the 3.5 and run the OS off that drive.  Then, each dump the contents
 of the 3.5 drive to the 2.5 drive.  That way if either drive dies
 I'll, hopefully at worst, just have to switch which drive I boot from.
 
 Can anyone with experience doing something this make suggestions?

Are you saying that you have 70GB available on the 3.5 drive?
So the 64 GB of the 2.5 drive (not counting the MS part) will fit?

It is going to be really tight, but it should be doable.  Maybe
you can actually trim that /usr partition down a little if it
isn't full.

To do all of what you want (according to what you say here) you
will either have to use a fixit CD boot or multiple passes with
the current disks.   Presuming you will just nuke that MS part,
you can do the following.   (you might actually be able to use a
utility such as gpart or Partition Magic to squeeze that MS slice
down enough to keep it if you want if /usr is not very full, or you
can just leave it alone where it is)

It sounds like you are currently booting from the 2.5 drive from
the laptop.  If that is true, you only need two major steps.

First, you will need to be able to put both drives in to the desktop
machine and mount their filesystems (except the ms part).

Lets say, when you finally get that accomplished, that they
device name out as: 
  2.5 MS slice  = ad0s1
  2.5 FreeBSD slice = ad0s2
  3.5 Old drive = ad1
If the names come out differently, then you will have to adjust.

Boot the system up on the 2.5 drive.

Wipe and initialize the 3.5 disk with fdisk.
Doing a dd to it first might make it go more smoothly.
It may not be needed.

  dd if=/dev/zero of=/dev/ad1 bs=512 count=1000

  fdisk fdisk -BI ad1

That fdisk initializes it and puts on an MBR - the standard FreeBSD one.
This form makes it all in one large slice - so it creates ad1s1

Now, use bsdlabel to create the partition table and write the
boot block on it.

  bsdlabel -w -B ad1s1

The boot block is where the system jumps from the MBR when you 
select to boot that slice (if there is only one slice, there is
no selection, it just goes there after doing MBR stuff).

Now, edit the partition table in slice one to have the partitions
you want.

  bsdlabel -e ad1s1

This will bring up an edit screen - probably in vi unless you have
set your main editor to something else.   In that screen, it will
show only the  c: partition as containing the whole space and marked
unused and a note to  'don't edit'.  

It will look something like this:
8 partitions:
#size   offset  fstype   [fsize bsize bps/cpg]
  c: 78316875  0unused  0 0   # raw part, don't edit

Do not change the c partition line.
But, the easiest way to make new lines is to copy it.  
In vi do that by putting the cursor on it and hitting  dd  then
hitting p enough times for the number of copies you want (6 times in this 
case).

One thing you didn't mention was swap.  It is normal to make the 'b'
partition be swap space.   Maybe you left that out because it doesn't
show up in a df.   But, your system needs it.

So, then change the first line to be an a partition.  Make it a BSD4.2
type.Make the second line a b partition and change its type to swap
Make your d, e and f partition lines.   

The offset for both the c and the a partions  should be 0
After that you don't have to worry, because newer versions of bsdlabel
(and the previous disklabel) will calculate the offsets for you.
It will also calculate the size of the last partition if you want
it to be a catch all for the amount of space that remains.  (Usually
one makes that the largest one then)  To get it to do the calculations,
just put an asterisk in the field.   

Note: the sizes are given in 512 byte blocks.  You can use others
such as 1G or 1024M for 1GB, but I find this easier to keep track of.

It should look something like the following.  This example 
makes r00t, swap, tmp, var all be 1GB and usr (part f) get all the rest.

8 partitions:
#size   offset  fstype   [fsize bsize bps/cpg]
  a:  20971520   4.2BSD2048 16384 32776
  b:  2097152* 

Re: duplicate a drive

2008-10-24 Thread RW
On Fri, 24 Oct 2008 12:19:23 -0600 (MDT)
Warren Block [EMAIL PROTECTED] wrote:

 http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html#NEW-HUGE-DISK
 

The best way is to reinstall the OS on the new disk, then move the user
data over. This is highly recommended if you have been tracking -STABLE
for more than one release, or have updated a release instead of
installing a new one.


Highly recommended seems a very strange thing for the FAQ to be
saying. It's implying that FreeBSD base-system upgrades are a
bit flaky. It even goes on Should you decide not to do a fresh
install, as if to say you have been warned.

Unless my experience is abnormal, we seem to be publishing our own FUD.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: How do you duplicate a drive?

2004-10-02 Thread Jerry McAllister
 
 
 I have a RAID mirror (2x 160GB) which I would like to back up onto a spare 
 160GB drive.
 
 I do not have a hot-swap caddy so I was planning on powering down the 
 system to get the backup drive in and out.
 
 But once I have the new blank drive in, what is the best way to duplicate 
 the RAID? Ideally I would like to create a disk that could boot the system 
 (and rebuild the RAID) in case disaster strikes.
 
 Can dd do this?
 
 I am new to Unix disk operations... Many thanks in advance for the help.

I am just a bit unsure of what you are asking.   Do you mean to try
and duplicate the raid mirror set on the single 160GB spare disk?  

Or do you mean that you just want to make a backup copy of the files
on the raid mirror set to the spare drive?

I don't think you can do the first.   But the second would be
easily accomplished using dump(8) (and restore(8) if you wish).

Depending on whether you want to access the files in place while they 
are on the spare disk or you want to just have a convenient backup
of the raid mirrot set in case something happened you would either:

 - dump the file system[s] on the raid mirror set to [a] file[s] on
   the spare disk.   
   example:  if you had a file systems named /usr and /home on the mirror
 dump 0af /spare/usr.dump /usr
 dump 0af /spare/home.dump /home
   would give you an easily accessible dump files of /usr and /home
   You would have to  'restore -if'  any files that you want to use
   from the dump files.  But if the mirror crashed, it would be easy
   to (first repair or replace it) and then do a standard restore of
   the whole dump files in to the rebuilt mirror file systems.
or

 - pipe the dump[s] of file system[s] on the raid mirror to restore[s]
   on the spare disk.   You need to premake at least directories on the
   spare to receive the dumps.  Better to make file systems on the spare
   for each file system on the mirror set.  In case you ever need to do
   a complete restore of the mirror set then you can just do a reverse
   of this  dump | restore
   So, assuming you have done the slicing, partitioning and newfsing of
   the needed size file systems on the spare disk and mounted them
   as something like   /spareusr and /sparehome  then:
 cd /spareusr
 dump 0af - /usr | restore -rf -
 cd /sparehome
 dump 0af - /home | restore -rf -
   would duplicate the file systems and make the files all usable in place.
   To rebuild the mirror set if it crashed and after you repaired it
   and rebuilt the filesystems and mounted them in their original places
   you would have to reverse the dump-restore as is
 cd /usr
 dump 0af - /spareusr | restore rf -
   Or you could just remount the spares as /usr and /home and use them
   just like that without reviving the raid.


Anyway, using dd to copy the device would not work I don't think because 
it would try a byte for byte copy and the spare disk is definitely not
an identical device to the raid mirror set.

Hope that is all clear.

jerry 
 
 ___
 [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]


How do you duplicate a drive?

2004-10-01 Thread Matt Staroscik
I have a RAID mirror (2x 160GB) which I would like to back up onto a spare 
160GB drive.

I do not have a hot-swap caddy so I was planning on powering down the 
system to get the backup drive in and out.

But once I have the new blank drive in, what is the best way to duplicate 
the RAID? Ideally I would like to create a disk that could boot the system 
(and rebuild the RAID) in case disaster strikes.

Can dd do this?
I am new to Unix disk operations... Many thanks in advance for the help.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: How do you duplicate a drive?

2004-10-01 Thread Steve Bertrand

 I have a RAID mirror (2x 160GB) which I would like to back up onto a
 spare
 160GB drive.

 I do not have a hot-swap caddy so I was planning on powering down the
 system to get the backup drive in and out.

 But once I have the new blank drive in, what is the best way to
 duplicate
 the RAID? Ideally I would like to create a disk that could boot the
 system
 (and rebuild the RAID) in case disaster strikes.

 Can dd do this?

# man rsync

Steve


 I am new to Unix disk operations... Many thanks in advance for the
 help.


 ___
 [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: How do you duplicate a drive?

2004-10-01 Thread knowtree
 
 I have a RAID mirror (2x 160GB) which I would like to back up onto a spare 
 160GB drive.
 
 I do not have a hot-swap caddy so I was planning on powering down the 
 system to get the backup drive in and out.
 
 But once I have the new blank drive in, what is the best way to duplicate 
 the RAID? Ideally I would like to create a disk that could boot the system 
 (and rebuild the RAID) in case disaster strikes.
 
 Can dd do this?

As far as I know (never having done it myself) yes, byte for byte.

Before you do that I suggest you read up on vinum, the FreeBSD mirroring
service. There is man vinum, and a lot more in the on-line handbook, and
even more in Greg Lehey's The Complete FreeBSD. Greg wrote vinum, BTW.

(Greg, no charge for the plug.)

Gary Dunn
Honolulu


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


Re: How do you duplicate a drive?

2004-10-01 Thread Remko Lodder
Matt Staroscik wrote:
I have a RAID mirror (2x 160GB) which I would like to back up onto a 
spare 160GB drive.

I do not have a hot-swap caddy so I was planning on powering down the 
system to get the backup drive in and out.

But once I have the new blank drive in, what is the best way to 
duplicate the RAID? Ideally I would like to create a disk that could 
boot the system (and rebuild the RAID) in case disaster strikes.

Can dd do this?
I am new to Unix disk operations... Many thanks in advance for the help.
I think that dd if=/dev/raiddisk of=/dev/newdisk would work in 
duplicating the entire raid disk. I don't know if there are better ways, 
so if someone knows them, we would like to know ;)

Cheers!
--
Kind regards,
Remko Lodder   |[EMAIL PROTECTED]
Reporter DSINet|[EMAIL PROTECTED]
Projectleader Mostly-Harmless  |[EMAIL PROTECTED]
Founder Tienervaders   |[EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]