Re: moving a disk

2009-08-24 Thread PJ
PJ wrote:
 I am trying to move a 7.2 installation to another computer where it is
 to be the only OS acting as a server for the lan.
 On bootup I get the message:
 Using drive 0, partition 3.
 And there it hangs.
 I have tried to rewrite the mbr but that did absolutely nothing.
 fik ad0 returns:
 partitions 1,2,3 are UNUSED
 Parrtition 4 give the cylinder, heads, sectors, blocks stuff

 The disk did boot up on another box...

 What should I do? And what information do I need to supply or look for
 to solve this.
 I'd rathernot go through another installation even if this is farly
 elementary.
 Oh, yes... all my former problems were definitely software related as I
 have checked and double, triple checked my HDDs and cannot find any
 problems therewith.

here is what I have found in looking at the disk when it's mounted
on another FBSD system through an USB interface:
it is mounted on /dev/ad0
fdisk ad0 --- returns partitions 1,2,3 as UNUSED; partition 4 is
marked for sysid 166 OpenBSD (this seems to be left over from an
installation that was never completed)

fdisk ad0s4 --- returns same, except partition 4 is: sysid 165
(FreeBSD,NetBSD/386BSD)

I also note that the other functioning FBSD 7.2 has partitions 2-4 as
UNUSED and partition 1 has the cylinder parameters.

I get the impression that I should use the disklabel editor to change
all that but am not familiar with it and am not sure how to use it.

Here is what bsdlabel shows:

# /dev/ad0s4:  #this is the one that does not boot
8 partitions:
#size   offsetfstype   [fsize bsize bps/cpg]
  a:  2097152   634.2BSD 2048 16384 28552
  b:  2097152  2097215  swap   
  c: 12594897   63unused0 0 # raw part,
don't edit
  d:  2097152  41943674.2BSD 2048 16384 28552
  e:  2097152  62915194.2BSD 2048 16384 28552
  f:  4204544  83886714.2BSD 2048 16384 28552
partition c: partition extens past end of unit
disklabel: partition c doesn't start at 0!
disklabel An incorrect partition c may cause problems for standard
system utilities


# /dev/ad4s1: #this one boots
8 partitions:
#size   offsetfstype   [fsize bsize bps/cpg]
  a:  419430404.2BSD 2048 16384 28552
  b:  6291456  4194304  swap   
  c: 1563014250unused0 0 # raw part,
don't edit
  d:  6291456 104857604.2BSD 2048 16384 28552
  e:  4194304 167772164.2BSD 2048 16384 28552
  f: 69206016 209715204.2BSD 2048 16384 28552
  g: 66123889 901775364.2BSD 2048 16384 28552 

Is there a way to fix this thingy?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: moving a disk

2009-08-24 Thread Roland Smith
On Mon, Aug 24, 2009 at 11:50:28AM -0400, PJ wrote:
 PJ wrote:
  I am trying to move a 7.2 installation to another computer where it is
  to be the only OS acting as a server for the lan.
  On bootup I get the message:
  Using drive 0, partition 3.
  And there it hangs.

Probably because the boot code can't find the 3rd stage loader... It is
strange that it is trying partition 3 instead of partition 4.

Did you prepare the disk as explained in the handbook (§16.3 Adding Disks)?
I get the impression that you didn't. And that can have caused the problem. 

Try booting again, and press any key to interrupt the boot process to get to
the boot prompt. You should see something like:

 FreeBSD/i386 BOOT
 Default: 0:ad(0,a)/boot/loader
 boot:

At this boot prompt, type

0:ad(0,4,a)/boot/loaderENTER

This will try to boot from the 4th partition. See boot(8). N.B. the boot
manpage uses the term 'slice' for partitions. By default the boot code looks
for either the active slice or the first slice with the freebsd type.

  I have tried to rewrite the mbr but that did absolutely nothing.

That is not surprising, The mbr is only part of the boot process. The problem
seems to be that it cannot locate the rest... Read the chapter The FreeBSD
Booting Process from the FreeBSD Handbook. And see
http://en.wikipedia.org/wiki/Master_boot_record

This will provide insight into how FreeBSD actually boots. It is a bit of a
convoluted process due to historical restrictions of the PC
architecture. Reading the manual pages for fdisk(8), boot(8) and loader(8)
might also prove enlightening.

  fik ad0 returns:
  partitions 1,2,3 are UNUSED
  Parrtition 4 give the cylinder, heads, sectors, blocks stuff

Why did you install on partition 4? Normally one would use parition 1.

  What should I do? And what information do I need to supply or look for
  to solve this.

See below.

  I'd rathernot go through another installation even if this is farly
  elementary.

With any luck you don't have to.

  Oh, yes... all my former problems were definitely software related as I
  have checked and double, triple checked my HDDs and cannot find any
  problems therewith.

 here is what I have found in looking at the disk when it's mounted
 on another FBSD system through an USB interface:
 it is mounted on /dev/ad0
 fdisk ad0 --- returns partitions 1,2,3 as UNUSED; partition 4 is
 marked for sysid 166 OpenBSD (this seems to be left over from an
 installation that was never completed)

It should be type 165 for FreeBSD! _Or_ partition 4 should be marked as active
(flag 80). Is it? If not you can use the -a flag of fdisk to update the active
partition.  I think you should use something like 'fdisk -u -a -4 ad0'. Look
at the fdisk manual page to see what this does. I'm not sure if this is the
right invocation. I have never dealt with this problem.

Setting the active partition _should_ be enough. If that doesn't work, you're in
trouble. As far as I know there is no easy way to just change the partition
type, without starting over. In theory you can set the type by fiddling some
bits in the partition table, but that is probably harder than it sounds. Maybe
sysinstall can do it, but I haven't tried.

Next time you want to install FreeBSD on a disk, read §16.3 Adding Disks of
the FreeBSD handbook first, and follow the steps laid out there! That would
create and active a single partition which would almost certainly have avoided
this problem.

 I also note that the other functioning FBSD 7.2 has partitions 2-4 as
 UNUSED and partition 1 has the cylinder parameters.

 I get the impression that I should use the disklabel editor to change
 all that but am not familiar with it and am not sure how to use it.

No. The disklabel works at a lower level.

Historically PC harddisks can be divided into 4 partitions (This is what fdisk
does). So the disk ad0 can have partitions 1--4: ad0s1--ad0s4. In older FreeBSD
literature these are called slices, hence the 's' in the partition name.

FreeBSD can subdivide a partition in labeled sections. These sections are
labeled with a letter, so partition ad0s1 can be divided (in 7.x) into labeled
pieces a--g: ad0s1a--ad0s1g. This is what the bsdlabel(8) program does. And it
is usually on these subdivisions that filesystems are created with newfs(8).

 Is there a way to fix this thingy?

Make sure that partition 4 is the active partition. That should fix it. 

Roland
-- 
R.F.Smith   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)


pgpi0YwFf2svf.pgp
Description: PGP signature


Re: moving a disk

2009-08-24 Thread PJ
Roland Smith wrote:
 On Mon, Aug 24, 2009 at 11:50:28AM -0400, PJ wrote:
   
 PJ wrote:
 
 I am trying to move a 7.2 installation to another computer where it is
 to be the only OS acting as a server for the lan.
 On bootup I get the message:
 Using drive 0, partition 3.
 And there it hangs.
   

 Probably because the boot code can't find the 3rd stage loader... It is
 strange that it is trying partition 3 instead of partition 4.

 Did you prepare the disk as explained in the handbook (�16.3 Adding Disks)?
 I get the impression that you didn't. And that can have caused the problem. 

 Try booting again, and press any key to interrupt the boot process to get to
 the boot prompt. You should see something like:

  FreeBSD/i386 BOOT
  Default: 0:ad(0,a)/boot/loader
  boot:

 At this boot prompt, type

 0:ad(0,4,a)/boot/loaderENTER

 This will try to boot from the 4th partition. See boot(8). N.B. the boot
 manpage uses the term 'slice' for partitions. By default the boot code looks
 for either the active slice or the first slice with the freebsd type.

   
 I have tried to rewrite the mbr but that did absolutely nothing.
   

 That is not surprising, The mbr is only part of the boot process. The problem
 seems to be that it cannot locate the rest... Read the chapter The FreeBSD
 Booting Process from the FreeBSD Handbook. And see
 http://en.wikipedia.org/wiki/Master_boot_record

 This will provide insight into how FreeBSD actually boots. It is a bit of a
 convoluted process due to historical restrictions of the PC
 architecture. Reading the manual pages for fdisk(8), boot(8) and loader(8)
 might also prove enlightening.

   
 fik ad0 returns:
 partitions 1,2,3 are UNUSED
 Parrtition 4 give the cylinder, heads, sectors, blocks stuff
   

 Why did you install on partition 4? Normally one would use parition 1.

   
 What should I do? And what information do I need to supply or look for
 to solve this.
   

 See below.

   
 I'd rathernot go through another installation even if this is farly
 elementary.
   

 With any luck you don't have to.

   
 Oh, yes... all my former problems were definitely software related as I
 have checked and double, triple checked my HDDs and cannot find any
 problems therewith.
   

   
 here is what I have found in looking at the disk when it's mounted
 on another FBSD system through an USB interface:
 it is mounted on /dev/ad0
 fdisk ad0 --- returns partitions 1,2,3 as UNUSED; partition 4 is
 marked for sysid 166 OpenBSD (this seems to be left over from an
 installation that was never completed)
 

 It should be type 165 for FreeBSD! _Or_ partition 4 should be marked as active
 (flag 80). Is it? If not you can use the -a flag of fdisk to update the active
 partition.  I think you should use something like 'fdisk -u -a -4 ad0'. Look
 at the fdisk manual page to see what this does. I'm not sure if this is the
 right invocation. I have never dealt with this problem.

 Setting the active partition _should_ be enough. If that doesn't work, you're 
 in
 trouble. As far as I know there is no easy way to just change the partition
 type, without starting over. In theory you can set the type by fiddling some
 bits in the partition table, but that is probably harder than it sounds. Maybe
 sysinstall can do it, but I haven't tried.

 Next time you want to install FreeBSD on a disk, read �16.3 Adding Disks of
 the FreeBSD handbook first, and follow the steps laid out there! That would
 create and active a single partition which would almost certainly have avoided
 this problem.

   
 I also note that the other functioning FBSD 7.2 has partitions 2-4 as
 UNUSED and partition 1 has the cylinder parameters.

 I get the impression that I should use the disklabel editor to change
 all that but am not familiar with it and am not sure how to use it.
 

 No. The disklabel works at a lower level.

 Historically PC harddisks can be divided into 4 partitions (This is what fdisk
 does). So the disk ad0 can have partitions 1--4: ad0s1--ad0s4. In older 
 FreeBSD
 literature these are called slices, hence the 's' in the partition name.

 FreeBSD can subdivide a partition in labeled sections. These sections are
 labeled with a letter, so partition ad0s1 can be divided (in 7.x) into labeled
 pieces a--g: ad0s1a--ad0s1g. This is what the bsdlabel(8) program does. And it
 is usually on these subdivisions that filesystems are created with newfs(8).

   
 Is there a way to fix this thingy?
 

 Make sure that partition 4 is the active partition. That should fix it. 

   
Hi Roland,
I'm going to keep this email as a valued reminder of what to do and not
to do.
I'm afraid I was a bit impatient and messed up the already messed up
disk... frankly, I don't recall whatever happened to the thing in the
first place. I did install a good working 7.2 with samba, mysawl, php
and that's about it. It booted fine and I just left it alone not being
sure of what I would do with 

Re: moving a disk

2009-08-24 Thread Tim Judd
On 8/24/09, Roland Smith rsm...@xs4all.nl wrote:
 On Mon, Aug 24, 2009 at 11:50:28AM -0400, PJ wrote:
 PJ wrote:
  I am trying to move a 7.2 installation to another computer where it is
  to be the only OS acting as a server for the lan.
  On bootup I get the message:
  Using drive 0, partition 3.
  And there it hangs.

 Probably because the boot code can't find the 3rd stage loader... It is
 strange that it is trying partition 3 instead of partition 4.

0-based.  OpenBSD when set to install and use all of a disk, sets it
to the last primary partition (1-based = 4, 0-based = 3).


 Did you prepare the disk as explained in the handbook (§16.3 Adding
 Disks)?
 I get the impression that you didn't. And that can have caused the problem.

 Try booting again, and press any key to interrupt the boot process to get to
 the boot prompt. You should see something like:

  FreeBSD/i386 BOOT
  Default: 0:ad(0,a)/boot/loader
  boot:

 At this boot prompt, type

 0:ad(0,4,a)/boot/loaderENTER

 This will try to boot from the 4th partition. See boot(8). N.B. the boot
 manpage uses the term 'slice' for partitions. By default the boot code looks
 for either the active slice or the first slice with the freebsd type.

This drive still is likely having OpenBSD bootblocks in the MBR and
track.  I don't expect OpenBSD to boot FreeBSD.


  I have tried to rewrite the mbr but that did absolutely nothing.

 That is not surprising, The mbr is only part of the boot process. The
 problem
 seems to be that it cannot locate the rest... Read the chapter The FreeBSD
 Booting Process from the FreeBSD Handbook. And see
 http://en.wikipedia.org/wiki/Master_boot_record

 This will provide insight into how FreeBSD actually boots. It is a bit of a
 convoluted process due to historical restrictions of the PC
 architecture. Reading the manual pages for fdisk(8), boot(8) and loader(8)
 might also prove enlightening.

  fik ad0 returns:
  partitions 1,2,3 are UNUSED
  Parrtition 4 give the cylinder, heads, sectors, blocks stuff

 Why did you install on partition 4? Normally one would use parition 1.

and sysinstall would use (0-based = 0, 1-based = 1) the first partition too.


  What should I do? And what information do I need to supply or look for
  to solve this.

 See below.

  I'd rathernot go through another installation even if this is farly
  elementary.

 With any luck you don't have to.

  Oh, yes... all my former problems were definitely software related as I
  have checked and double, triple checked my HDDs and cannot find any
  problems therewith.

 here is what I have found in looking at the disk when it's mounted
 on another FBSD system through an USB interface:
 it is mounted on /dev/ad0
 fdisk ad0 --- returns partitions 1,2,3 as UNUSED; partition 4 is
 marked for sysid 166 OpenBSD (this seems to be left over from an
 installation that was never completed)

 It should be type 165 for FreeBSD! _Or_ partition 4 should be marked as
 active
 (flag 80). Is it? If not you can use the -a flag of fdisk to update the
 active
 partition.  I think you should use something like 'fdisk -u -a -4 ad0'. Look
 at the fdisk manual page to see what this does. I'm not sure if this is the
 right invocation. I have never dealt with this problem.

 Setting the active partition _should_ be enough. If that doesn't work,
 you're in
 trouble. As far as I know there is no easy way to just change the partition
 type, without starting over. In theory you can set the type by fiddling some
 bits in the partition table, but that is probably harder than it sounds.
 Maybe
 sysinstall can do it, but I haven't tried.

 Next time you want to install FreeBSD on a disk, read §16.3 Adding Disks
 of
 the FreeBSD handbook first, and follow the steps laid out there! That would
 create and active a single partition which would almost certainly have
 avoided
 this problem.

 I also note that the other functioning FBSD 7.2 has partitions 2-4 as
 UNUSED and partition 1 has the cylinder parameters.

 I get the impression that I should use the disklabel editor to change
 all that but am not familiar with it and am not sure how to use it.

 No. The disklabel works at a lower level.

 Historically PC harddisks can be divided into 4 partitions (This is what
 fdisk
 does). So the disk ad0 can have partitions 1--4: ad0s1--ad0s4. In older
 FreeBSD
 literature these are called slices, hence the 's' in the partition name.

 FreeBSD can subdivide a partition in labeled sections. These sections are
 labeled with a letter, so partition ad0s1 can be divided (in 7.x) into
 labeled
 pieces a--g: ad0s1a--ad0s1g. This is what the bsdlabel(8) program does. And
 it
 is usually on these subdivisions that filesystems are created with newfs(8).

 Is there a way to fix this thingy?

 Make sure that partition 4 is the active partition. That should fix it.

 Roland
 --
 R.F.Smith   http://www.xs4all.nl/~rsmith/
 [plain text _non-HTML_ PGP/GnuPG encrypted/signed 

Re: moving a disk

2009-08-24 Thread Roland Smith
On Mon, Aug 24, 2009 at 02:33:25PM -0400, PJ wrote:
 I'm afraid I was a bit impatient 

Patience is a virtue. Installing stuff can take hours, and a split-second can
suffice to screw it all up. Been there  done that. :-)

 and messed up the already messed up
 disk... frankly, I don't recall whatever happened to the thing in the
 first place.

Can I give you a tip? If you are doing something new or hairy, keep a laptop
or even a paper notebook handy and make notes of what you do. Write down the
commands that you use and any error messages that you get.

My favorite technique is to open emacs (preferably on another machine), start
a terminal/ssh session inside an emacs buffer and then do my thing. This gives
me a complete record of what I've done. Save these session (with some added
explanations) to a file and you'll know what to do next time, or at least you
can explain to others what you've been doing.

 anyway, I'm just practicing another minimal install... it's not as bad as I
 had thought... I'm getting it all together now.  

There is an extremely easy way to get all ports that you need onto a new
machine, provided that you have a (base) machine of (a) the same FreeBSD major
version of (b) the same hardware architecture and (c) up-to-date installed
ports available.

On the base machine, make dump(8)s of the filesystem(s) containing /usr/local,
/var/db/ports and /var/db/pkg and save them to files. Transfer those dump
files to an external harddisk or DVD. Using restore(8) interactively on the
new machine, restore these three directories to their respective filesystems
and you've got all ports up and running save for some editing of /etc/rc.conf.

 Thanks much, I'm beginning
 to understand a bit more... this boot stuff sure is complicated...

Yep. PC booting is a throwback to an earlier era when 640 kB RAM was all there
was and 512 bytes seemed big enough for boot code, because you were writing in
machine language or assembly anyway.

If you want a real hair-raising story about the time that assemblers were
luxuries, google 'the story of Mel' and be amazed (or horrified). It predates
PCs, but I think it shows the mind-set of the begin time of (personal)
computing.

Roland
-- 
R.F.Smith   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)


pgp1sVY5UbbCi.pgp
Description: PGP signature


Re: moving a disk

2009-08-24 Thread PJ
Roland Smith wrote:
 On Mon, Aug 24, 2009 at 02:33:25PM -0400, PJ wrote:
   
 I'm afraid I was a bit impatient 
 

 Patience is a virtue. Installing stuff can take hours, and a split-second can
 suffice to screw it all up. Been there  done that. :-)

   
 and messed up the already messed up
 disk... frankly, I don't recall whatever happened to the thing in the
 first place.
 

 Can I give you a tip? If you are doing something new or hairy, keep a laptop
 or even a paper notebook handy and make notes of what you do. Write down the
 commands that you use and any error messages that you get.

 My favorite technique is to open emacs (preferably on another machine), start
 a terminal/ssh session inside an emacs buffer and then do my thing. This gives
 me a complete record of what I've done. Save these session (with some added
 explanations) to a file and you'll know what to do next time, or at least you
 can explain to others what you've been doing.

   
 anyway, I'm just practicing another minimal install... it's not as bad as I
 had thought... I'm getting it all together now.  
 

 There is an extremely easy way to get all ports that you need onto a new
 machine, provided that you have a (base) machine of (a) the same FreeBSD major
 version of (b) the same hardware architecture and (c) up-to-date installed
 ports available.

 On the base machine, make dump(8)s of the filesystem(s) containing /usr/local,
 /var/db/ports and /var/db/pkg and save them to files. Transfer those dump
 files to an external harddisk or DVD. Using restore(8) interactively on the
 new machine, restore these three directories to their respective filesystems
 and you've got all ports up and running save for some editing of /etc/rc.conf.

   
I'm not that organized, yet... ;-)  but I have saved my rc.conf,
smb.conf, httpd.conf. httpd-vhosts.conf 7 a number of other handy
configuration files that I copy to new installations and tweak, if
necessary; even the certificates for ssl work fine... so, now I think
I'll follow your suggestion and keep a record and do the copy stuff - it
also saves bandwidth so you don'
t have to download all the distfiles... but I don't do any hairy stuff
:-(  just trying to K.I.S.S - and this will make it even simpler.
Thanks again... learned again...
 Thanks much, I'm beginning
 to understand a bit more... this boot stuff sure is complicated...
 

 Yep. PC booting is a throwback to an earlier era when 640 kB RAM was all there
 was and 512 bytes seemed big enough for boot code, because you were writing in
 machine language or assembly anyway.

 If you want a real hair-raising story about the time that assemblers were
 luxuries, google 'the story of Mel' and be amazed (or horrified). It predates
 PCs, but I think it shows the mind-set of the begin time of (personal)
 computing.

 Roland
   

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