Re: Please help. Can't see HD
On Sun, Dec 28, 2003 at 08:54:06PM -0500, Francisco Reyes wrote: Upgraded to stable like so many countless times. All was fine after reboot. After a few more reboots while troubleshooting why a port was not coming up at bootup the machine froze right after loading the kernel... at the part with the spinning lines... |/-\ == like those.. H... This is pretty drastic. The boot loader is failing to read the kernel from the disk. This part of the boot process really precedes anything that could be fixed using fsck(8), contrary to what others have said. It's not bad advice, just that there are some more basic things to fix first. There are two possibilities I can think of: i) Your hard drive has bitten the dust. There's nothing you can do to fix the drive. The disklabel seems to be right on a bad spot of the disk and unless the disk has sufficient spare blocks you can't remap that location. In any case you'ld have to have a record of the previous disklabel so that you could recreate it. ii) You've been fiddling with the disk addressing mode in the BIOS and somehow left it in a different mode to what it was before. In this case, you should be able to try the various modes one by one until you get back to the one that works. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK pgp0.pgp Description: PGP signature
Re: Fwd: Re: Please help. Can't see HD
On Mon, 29 Dec 2003 17:09, Francisco Reyes wrote: On Mon, 29 Dec 2003 14:57:13 +1030, Malcolm Kay wrote: How big was the image you copied to the disk? -- that should tell you how much of your drive is overwritten. The image was about 4MB. Before or after decompression; It probably doesn't matter anyway. If you were using the slice partition for BSD (not necessarily slice slice 1; but) the first one physically after the MBR then then it is likely you have overwritten the disklabel and a substantial part of the 'a' or root partition whether 4Mb is the compressed or expanded size. And without some form of dual boot we can guess that this is the only slice carrying a file-system (or systems). Given that the above assumptions are valid we are lead to the conclusion that the first sector of the BSD slice has gone along with the disklabel information and a substantial prt of the root file system. It is probable your disklabel has also disappeared, so you probably need to reconstruct both the slice table in the MBR and the disklabel in the first slice. With some vague recollections of what you did originally to install FBSD it is possible that some lucky guesses might work. How would I go about that? OK; how did you install initially? Was the whole disk used for BSD? Did you follow the defaults during installation? If both the latter questions are answered in the affirmative then you might go back to installation and try to create the same slices, partitions and mount points. It looks as though the root partition has been destroyed but you might hope that the rest are intact. Make sure that you mark the 'a' partition for a new file system and all others as already existing. The partitions are marked 'Y' or 'N' in the installation menu but I can't remember which is which -- read the help explanation. Proceed with a minimum installation and you should (with luck) retain anything you have added to the non-root partitions. After booting into the recreated system you'll need to recreate users with their original UIDs. You can see what these are by using ls -l in the user directories /usr/home/{user-name} when the numericl uid will be displayed instead of the user name.] If either of the questions were answered in the negative we'll need to look for a different approach and some more difficult guesses! If you can find the first sector of a slice carrying an installed file system then this might hold a copy of the slice table allowing reconstruction of the original MBR with some confidence. How? Hopefully as above. Other than not playing around with dd how can one safeguard from something like this in the future? Only issue instructions as 'root' when you are fully awake and thinking clearly about what you are doing and then double chheck evry command before hitting Enter. Keep operation under user root to an absolute minimum. You are unlikely to be permitted to create this degree of havoc as an ordinary user. Is there a way to backup the disklable and slice info? Yes, disklabel and fdisk have facilities for outputting their current state and this can be redirected to file and then stored on your backup media or a floppy disk. I do this on a regular basis for a number of machines under my control. I also include a copy of /etc/fstab and the output from df. After all this is cleared I am also going to check what is the best way to keep a working copy of my entire system. On windows I have a program, driveimage, which I use to every night keep an image of the entire disk while the system is on. Has saved me many times.. In my opinion dump and restore are the best backup and recovery mechanisms for BSD. But to duplicate, in its entirety, the original setup you need to also save fdisk and disklabel information. Disk images are unreasonably expensive in time since they also backup empty space, require a physically identical disk for recovery and can give some difficlties as the image is usually of an open file system which checks out as unclean. Malcolm Kay ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Fwd: Re: Please help. Can't see HD
On Mon, 29 Dec 2003 14:57:13 +1030 Malcolm Kay [EMAIL PROTECTED] probably wrote: On Mon, 29 Dec 2003 14:39, Francisco Reyes wrote: On Mon, 29 Dec 2003 14:27:01 +1030, Malcolm Kay wrote: This is likely your problem source!!! /dev/rad[n] is an alias of /dev/ad[n]; that is it refers to IDE drive n. (Historically they had somewhat different meanings but even then still refered to the same physical device -- the 'r' means raw) If n was 2 you have over written the beginning of ad2. Well I guess the good news is that the HD is probably ok then. :-) Yes; should be. In FAT I seem to recall there are two copies of the boot sector. Does FreeBSD has anything like that? I seem to recall some options or utilities under MS-DOS that did something like that, but think this was mainly for floppies. Certainly there are duplicate copies of the FAT allocation tables, but these are next to one another on the disk so don't really protect against this sort of calamity. I guess the nearest thing in FreeBSD is mutiple copies of the superblocks within the file system, but unless you can reconstruct the slice table(partition in MS terms) I don't believe it will help. If what I did trashed the first sectors would that have affected all mount points? How big was the image you copied to the disk? -- that should tell you how much of your drive is overwritten. It is probable your disklabel has also disappeared, so you And the superblock, and some large piece of data. probably need to reconstruct both the slice table in the MBR and the disklabel in the first slice. With some vague recollections of what you did originally to install FBSD it is possible that some lucky guesses might work. For the `slice table' (MBR) sysutils/gpart could be of some help. Not sure about the disklabel, though. If you can find the first sector of a slice carrying an installed file Where `find' might mean # hd /dev/ad6s1 | grep 54 19 01 00 if looking for a ufs1 filesystem or # hd /dev/ad6s1 | grep 19 01 54 19 for ufs2. (see the archive for details; in the discussion the method seemed to work) system then this might hold a copy of the slice table allowing reconstruction of the original MBR with some confidence. Malcolm Kay ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] -- DoubleF Vote for ME -- I'm well-tapered, half-cocked, ill-conceived and TAX-DEFERRED! pgp0.pgp Description: PGP signature
Re: Fwd: Re: Please help. Can't see HD
On Mon, 29 Dec 2003 20:53:06 +1030, Malcolm Kay wrote: OK; how did you install initially? Was the whole disk used for BSD? Did you follow the defaults during installation? If both the latter questions are answered in the affirmative then you might go back to installation and try to create the same slices, partitions and mount points. I thought I had recorded my partition sizes, but I had not saved them. I found enough data in my backups so the data loss is minimal. At this stage I want to concentrate on improving my backups for the next time. Is there a way to backup the disklable and slice info? Yes, disklabel and fdisk have facilities for outputting their current state and this can be redirected to file and then stored on your backup media or a floppy disk. I do this on a regular basis Could you share the commands please? In my opinion dump and restore are the best backup and recovery mechanisms for BSD. I will work on a dump/restore mechanism. I will do that weekly. Have a database running which may not backup well. On weekends I can shutdown everything for the dump process. I plan to dump to a file in the second HD if that is possible. I also just bought a DVD burner to backup to it essential data to take offsite besides the copy on the second HD. Thanks for the advice. If I had only had a backup of the disk info this whole experience would have been less problematic. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Fwd: Re: Please help. Can't see HD
On Tue, 30 Dec 2003 01:12, Francisco Reyes wrote: On Mon, 29 Dec 2003 20:53:06 +1030, Malcolm Kay wrote: OK; how did you install initially? Was the whole disk used for BSD? Did you follow the defaults during installation? If both the latter questions are answered in the affirmative then you might go back to installation and try to create the same slices, partitions and mount points. I thought I had recorded my partition sizes, but I had not saved them. I found enough data in my backups so the data loss is minimal. At this stage I want to concentrate on improving my backups for the next time. Is there a way to backup the disklable and slice info? Yes, disklabel and fdisk have facilities for outputting their current state and this can be redirected to file and then stored on your backup media or a floppy disk. I do this on a regular basis Could you share the commands please? # fdisk ad2 ad2.fdisk # disklabel ad2s1 ad2s1.disklabel In my opinion dump and restore are the best backup and recovery mechanisms for BSD. I will work on a dump/restore mechanism. I will do that weekly. Have a database running which may not backup well. On weekends I can shutdown everything for the dump process. I plan to dump to a file in the second HD if that is possible. I also just bought a DVD burner to backup to it essential data to take offsite besides the copy on the second HD. Thanks for the advice. If I had only had a backup of the disk info this whole experience would have been less problematic. If you have dumps of all partitions then the slicing and partitioning sizes are not too important so long as thay are big enough. Just use say 'fdisk -BI ad2' to set it up with one slice for BSD. Then use disklabel on ad2s1 first to obtain a skeleton file then fill in the partitions and sizes you want and write it back with # disklabel -R -B ad2s1 prototypelabel Now create file systems in the partitions to be mounted (newfs). You should now be able to restore your backups to each partition in turn. Malcolm Kay ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Please help. Can't see HD
Upgraded to stable like so many countless times. All was fine after reboot. After a few more reboots while troubleshooting why a port was not coming up at bootup the machine froze right after loading the kernel... at the part with the spinning lines... |/-\ == like those.. Upon bootup I am able to get the boot prompt if I press space bar, but the only thing I am able to do is 'boot kernel'. Booting from a CD I was able to see the HD, but it lost it's label information. I went and purchased a new HD and am in the process of restoring most of my data from a second HD I have on that machine just for backup purposes. I still have a couple of things that are not backed up and would like to try and recover. Is there a way to recover the label info? I don't know if the HD is dying or whether the filesystem/HD boot sector is messed up. If I go using /stand/sysinstall and try the partition option it tells me that the disk geometry is wrong, but I also got the same for the new HD I installed today. After pressing OK the HD lists the entire HD space as free. Any suggestions? ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Please help. Can't see HD
On Sun, 28 Dec 2003 20:54:06 -0500 Francisco Reyes [EMAIL PROTECTED] wrote: Upgraded to stable like so many countless times. All was fine after reboot. After a few more reboots while troubleshooting why a port was not coming up at bootup the machine froze right after loading the kernel... at the part with the spinning lines... |/-\ == like those.. Upon bootup I am able to get the boot prompt if I press space bar, but the only thing I am able to do is 'boot kernel'. Booting from a CD I was able to see the HD, but it lost it's label information. I went and purchased a new HD and am in the process of restoring most of my data from a second HD I have on that machine just for backup purposes. I still have a couple of things that are not backed up and would like to try and recover. Is there a way to recover the label info? I don't know if the HD is dying or whether the filesystem/HD boot sector is messed up. newfs -N will *probably* give the alternate superblocks so that you could do a fsck_ufs -b. -- IOnut Unregistered ;) FreeBSD user ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Fwd: Re: Please help. Can't see HD
On Sun, 28 Dec 2003 20:54:06 -0500, Francisco Reyes wrote: Is there a way to recover the label info? I don't know if the HD is dying or whether the filesystem/HD boot sector is messed up. More info.. When starting /stand/sysinstall it shows: ad2: raw partition size != slice size ad2: start 0, end 78168359, size 78165360 ad2c: start 0, end 10239, size 10240 This after upgrading to 4.9 stable as of 12-29-2003. The other thing I did today which I don't know if is related. I enabled USB today and was writing to a CF card in preparation to install M0n0wall on a soekris machine. After installing USB support and seen the card I did: gzcat net45xx-pbxrxxx.img | dd of=/dev/rad[n] bs=16k Where the xxx were the version for the image and [n] was 1... /dev/rad1 (or was it.. 0..). Isn't that the CF card writer? I got the number after looking at camcontrol and usbdevs (can't remember which one from)... Did I messed up the drive when writing that image? ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Please help. Can't see HD
On Mon, 29 Dec 2003 04:06:27 +0200, Ion-Mihai Tetcu wrote: On Sun, 28 Dec 2003 20:54:06 -0500 Francisco Reyes [EMAIL PROTECTED] wrote: Is there a way to recover the label info? I don't know if the HD is dying or whether the filesystem/HD boot sector is messed up. newfs -N will *probably* give the alternate superblocks so that you could do a fsck_ufs -b. Could you elaborate a little? Looked at man page for newfs and it says it just gives info of newfs without doing operation. How will that be used? I am not familiar with the tools to manage disks. I usually have used /stand/systinstall to prepare HDs and allocate mount points. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Fwd: Re: Please help. Can't see HD
On Mon, 29 Dec 2003 13:29, Francisco Reyes wrote: On Sun, 28 Dec 2003 20:54:06 -0500, Francisco Reyes wrote: Is there a way to recover the label info? I don't know if the HD is dying or whether the filesystem/HD boot sector is messed up. More info.. When starting /stand/sysinstall it shows: ad2: raw partition size != slice size ad2: start 0, end 78168359, size 78165360 ad2c: start 0, end 10239, size 10240 This after upgrading to 4.9 stable as of 12-29-2003. The other thing I did today which I don't know if is related. I enabled USB today and was writing to a CF card in preparation to install M0n0wall on a soekris machine. After installing USB support and seen the card I did: gzcat net45xx-pbxrxxx.img | dd of=/dev/rad[n] bs=16k This is likely your problem source!!! /dev/rad[n] is an alias of /dev/ad[n]; that is it refers to IDE drive n. (Historically they had somewhat different meanings but even then still refered to the same physical device -- the 'r' means raw) If n was 2 you have over written the beginning of ad2. Where the xxx were the version for the image and [n] was 1... /dev/rad1 (or was it.. 0..). Isn't that the CF card writer? I got the number after looking at camcontrol and usbdevs (can't remember which one from)... Did I messed up the drive when writing that image? The scsii / usb devices appear under names such as da[n] or rda[n]. Yes; I think you did. Likely you will need to reconfigure your drive and reinstall from your backup. Malcolm Kay ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Fwd: Re: Please help. Can't see HD
On Mon, 29 Dec 2003 14:27:01 +1030, Malcolm Kay wrote: This is likely your problem source!!! /dev/rad[n] is an alias of /dev/ad[n]; that is it refers to IDE drive n. (Historically they had somewhat different meanings but even then still refered to the same physical device -- the 'r' means raw) If n was 2 you have over written the beginning of ad2. Well I guess the good news is that the HD is probably ok then. :-) In FAT I seem to recall there are two copies of the boot sector. Does FreeBSD has anything like that? If what I did trashed the first sectors would that have affected all mount points? ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Please help. Can't see HD
On Sun, 28 Dec 2003 22:07:00 -0500 Francisco Reyes [EMAIL PROTECTED] wrote: On Mon, 29 Dec 2003 04:06:27 +0200, Ion-Mihai Tetcu wrote: On Sun, 28 Dec 2003 20:54:06 -0500 Francisco Reyes [EMAIL PROTECTED] wrote: Is there a way to recover the label info? I don't know if the HD is dying or whether the filesystem/HD boot sector is messed up. newfs -N will *probably* give the alternate superblocks so that you could do a fsck_ufs -b. Could you elaborate a little? Looked at man page for newfs and it says it just gives info of newfs without doing operation. How will that be used? I am not familiar with the tools to manage disks. I usually have used /stand/systinstall to prepare HDs and allocate mount points. it/usr/ports/audio/xmms-kde# newfs -N ad3 /dev/ad3: 38166.7MB (78165360 sectors) block size 16384, fragment size 2048 using 208 cylinder groups of 183.77MB, 11761 blks, 23552 inodes. super-block backups (for fsck -b #) at: 160, 376512, 752864, 1129216, 1505568, 1881920, 2258272, 2634624, 3010976, 3387328, 3763680, 4140032, 4516384, 4892736, After which you could do a fsck_ufs -b 752864 device_node (first time with -n also) and see if one of the alternate superblocks fits. -- IOnut Unregistered ;) FreeBSD user ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Fwd: Re: Please help. Can't see HD
On Mon, 29 Dec 2003 14:39, Francisco Reyes wrote: On Mon, 29 Dec 2003 14:27:01 +1030, Malcolm Kay wrote: This is likely your problem source!!! /dev/rad[n] is an alias of /dev/ad[n]; that is it refers to IDE drive n. (Historically they had somewhat different meanings but even then still refered to the same physical device -- the 'r' means raw) If n was 2 you have over written the beginning of ad2. Well I guess the good news is that the HD is probably ok then. :-) Yes; should be. In FAT I seem to recall there are two copies of the boot sector. Does FreeBSD has anything like that? I seem to recall some options or utilities under MS-DOS that did something like that, but think this was mainly for floppies. Certainly there are duplicate copies of the FAT allocation tables, but these are next to one another on the disk so don't really protect against this sort of calamity. I guess the nearest thing in FreeBSD is mutiple copies of the superblocks within the file system, but unless you can reconstruct the slice table(partition in MS terms) I don't believe it will help. If what I did trashed the first sectors would that have affected all mount points? How big was the image you copied to the disk? -- that should tell you how much of your drive is overwritten. It is probable your disklabel has also disappeared, so you probably need to reconstruct both the slice table in the MBR and the disklabel in the first slice. With some vague recollections of what you did originally to install FBSD it is possible that some lucky guesses might work. If you can find the first sector of a slice carrying an installed file system then this might hold a copy of the slice table allowing reconstruction of the original MBR with some confidence. Malcolm Kay ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Fwd: Re: Please help. Can't see HD
On Mon, 29 Dec 2003 14:57:13 +1030, Malcolm Kay wrote: How big was the image you copied to the disk? -- that should tell you how much of your drive is overwritten. The image was about 4MB. It is probable your disklabel has also disappeared, so you probably need to reconstruct both the slice table in the MBR and the disklabel in the first slice. With some vague recollections of what you did originally to install FBSD it is possible that some lucky guesses might work. How would I go about that? If you can find the first sector of a slice carrying an installed file system then this might hold a copy of the slice table allowing reconstruction of the original MBR with some confidence. How? Other than not playing around with dd how can one safeguard from something like this in the future? Is there a way to backup the disklable and slice info? After all this is cleared I am also going to check what is the best way to keep a working copy of my entire system. On windows I have a program, driveimage, which I use to every night keep an image of the entire disk while the system is on. Has saved me many times.. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]