2 Dec 2011 03:48
2 Dec 2011 04:25
Re: Relabel disk?
Greg Troxel <gdt <at> ir.bbn.com>
2011-12-02 03:25:49 GMT
2011-12-02 03:25:49 GMT
I'm slightly fuzzy, but disk layout is generally: 0: 1st-stage boot 1: disklabel 2-15: 2nd-stage boot 16-N: filesystem In other words, the first 16 sectors of a ffs filesystem are left empty for boot/disklabel stuff. So if you know what the fs layout is (perhaps just one big fs), you should be able to write the disklabel without breaking the fs. (via rsd0c presumably, which is whole disk on sparc, again if I remember right)
2 Dec 2011 04:28
Re: Relabel disk?
AGC <agcarver+netbsd <at> acarver.net>
2011-12-02 03:28:23 GMT
2011-12-02 03:28:23 GMT
On 12/1/2011 19:25, Greg Troxel wrote: > > I'm slightly fuzzy, but disk layout is generally: > > 0: 1st-stage boot > 1: disklabel > 2-15: 2nd-stage boot > 16-N: filesystem > > In other words, the first 16 sectors of a ffs filesystem are left empty > for boot/disklabel stuff. > > So if you know what the fs layout is (perhaps just one big fs), you > should be able to write the disklabel without breaking the fs. > (via rsd0c presumably, which is whole disk on sparc, again if I remember > right) It was root and swap but I don't remember what was where. I suspect I'm just hosed and have to reinstall if I can't figure out what the partitions were.
2 Dec 2011 04:32
2 Dec 2011 05:51
Re: Relabel disk?
AGC <agcarver+netbsd <at> acarver.net>
2011-12-02 04:51:58 GMT
2011-12-02 04:51:58 GMT
On 12/1/2011 19:32, River Tarnell wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > AGC: >> It was root and swap but I don't remember what was where. > > Perhaps scan_ffs(8) might be useful? From the man pages online that sounds like a very useful utility. Unfortunately it's not on the NetBSD install CD :(
2 Dec 2011 06:35
Re: Relabel disk?
Mouse <mouse <at> Rodents-Montreal.ORG>
2011-12-02 05:35:04 GMT
2011-12-02 05:35:04 GMT
> My IPX won't boot because it's missing a disk label. I can boot from > the installation CD but I'm not sure how to restore the disk label on > the disk without wiping and reinstalling everything. sunlabel(8)? I don't know whether it's on the install CD, but if you extract it from the CD manually and make it available via NFS, you can probably boot the install CD and run it off an NFS mount. /~\ The ASCII Mouse \ / Ribbon Campaign X Against HTML mouse <at> rodents-montreal.org / \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
2 Dec 2011 07:00
Re: Relabel disk?
Alexander Carver <agcarver <at> acarver.net>
2011-12-02 06:00:20 GMT
2011-12-02 06:00:20 GMT
On 12/1/2011 21:35, Mouse wrote: >> My IPX won't boot because it's missing a disk label. I can boot from >> the installation CD but I'm not sure how to restore the disk label on >> the disk without wiping and reinstalling everything. > > sunlabel(8)? I don't know whether it's on the install CD, but if you > extract it from the CD manually and make it available via NFS, you can > probably boot the install CD and run it off an NFS mount. I found it in the base.tgz file. I managed to extract it to one of the other system drives but it doesn't run: # mount /dev/sd3c /mnt2 # mount_cd9660 /dev/cd0a /mnt # cd /mnt2; mkdir cddata ; cd cddata # tar -xzf /mnt/sparc/binary/sets/base.tgz "./usr/sbin/sunlabel" ./usr/sbin/sunlabel # cd /mnt2/cddata/usr/sbin/ # ./sunlabel sh: sunlabel: not found Not found? It's right there unless I missed something.
2 Dec 2011 07:02
Re: Relabel disk?
AGC <agcarver+netbsd <at> acarver.net>
2011-12-02 06:02:36 GMT
2011-12-02 06:02:36 GMT
On 12/1/2011 21:35, Mouse wrote: >> My IPX won't boot because it's missing a disk label. I can boot from >> the installation CD but I'm not sure how to restore the disk label on >> the disk without wiping and reinstalling everything. > > sunlabel(8)? I don't know whether it's on the install CD, but if you > extract it from the CD manually and make it available via NFS, you can > probably boot the install CD and run it off an NFS mount. I found it in the base.tgz file. I managed to extract it to one of the other system drives but it doesn't run: # mount /dev/sd3c /mnt2 # mount_cd9660 /dev/cd0a /mnt # cd /mnt2; mkdir cddata ; cd cddata # tar -xzf /mnt/sparc/binary/sets/base.tgz "./usr/sbin/sunlabel" ./usr/sbin/sunlabel # cd /mnt2/cddata/usr/sbin/ # ./sunlabel sh: sunlabel: not found Not found? It's right there unless I missed something.
2 Dec 2011 07:14
Re: Relabel disk?
Mouse <mouse <at> Rodents-Montreal.ORG>
2011-12-02 06:14:19 GMT
2011-12-02 06:14:19 GMT
>> sunlabel(8)? > I found it in the base.tgz file. I managed to extract it to one of > the other system drives but it doesn't run: > # mount /dev/sd3c /mnt2 > # mount_cd9660 /dev/cd0a /mnt > # cd /mnt2; mkdir cddata ; cd cddata > # tar -xzf /mnt/sparc/binary/sets/base.tgz "./usr/sbin/sunlabel" > ./usr/sbin/sunlabel > > # cd /mnt2/cddata/usr/sbin/ > # ./sunlabel > sh: sunlabel: not found > Not found? It's right there unless I missed something. I don't see any ls or equivalent confirming that it is, though what you quote certainly looks to me as though it should be. I do note that it's "sh: sunlabel: not found" rather than "sh: ./sunlabel: not found", though I don't know enough to know whether that's significant. It strikes me that this could be a missing library; on a 5.1 machine I have handy (I don't see anything saying what OS rev you're at) sunlabel is linked dynamic with -ltermcap and -lutil as well as -lc, and I don't know whether any of those are available in .so form on the install pseudo-live-CD system. If the disk label is the only thing that got destroyed, you should be able to mount /dev/sd3c if your root partition begins at the beginning of the disk. Of course, if you split your system up into a lot of partitions, just mounting root may not get you all that much. (If it(Continue reading)
2 Dec 2011 06:57
Re: Relabel disk?
Mouse <mouse <at> Rodents-Montreal.ORG>
2011-12-02 05:57:17 GMT
2011-12-02 05:57:17 GMT
> I'm slightly fuzzy, but disk layout is generally: > 0: 1st-stage boot > 1: disklabel > 2-15: 2nd-stage boot > 16-N: filesystem This does not sound right, and checking reveals that it is not how the disk is laid out on my IPX. Rather, what I see is - Sector 0 contains the disklabel - Sectors 1-15 contain first-stage bootblocks - The filesystem begins at sector 0 as far as things such as newfs are concerned, but it is an FFS filesystem, and FFS deliberately avoids using the first 16 sectors of its partition, for exactly this reason: to leave space for bootblocks (and, later, disklabels). - Second-stage bootblocks, if used, are in a location that depends on the code in the first-stage bootblocks. In the case of my IPX, the block numbers of this code are written into the first-stage booter when the latter is installed; I have also seen first-stage bootblocks that know enough FFS to read the second-stage bootstrap out of the filesystem. The disklabel must be in sector 0 of the drive. I believe the first-stage bootblocks must be in sectors 1-15 of the boot partition;(Continue reading)
RSS Feed