From owner-freebsd-questions Thu Jul 25 15:51:18 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DFAE837B405 for ; Thu, 25 Jul 2002 15:51:08 -0700 (PDT) Received: from sccrmhc02.attbi.com (sccrmhc02.attbi.com [204.127.202.62]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1900343EE8 for ; Thu, 25 Jul 2002 15:51:03 -0700 (PDT) (envelope-from paulbeard@mac.com) Received: from mac.com ([12.231.115.57]) by sccrmhc02.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020725225048.IZKP1451.sccrmhc02.attbi.com@mac.com>; Thu, 25 Jul 2002 22:50:48 +0000 Message-ID: <3D4080BE.5060304@mac.com> Date: Thu, 25 Jul 2002 15:50:38 -0700 From: paul beard User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.0rc3) Gecko/20020528 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jerry McAllister Cc: questions@FreeBSD.ORG Subject: Re: restoring disklabel from an active disk? References: <200207252227.g6PMR0j15849@clunix.cl.msu.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I seem not to have that anymore: the disklabel that I get back starts at 0. I seem to have trashed that as well while I was thrashing around with this. I take the point about writing the output of disklabel to a file AND lpr much more seriously than I did this morning. Thanks. Jerry McAllister wrote: >>I somehow wiped out my disklabel and while I am backing up my home >>directory in the event I need to start from scratch, I would like >>know if I can somehow extract a valid disklabel from a running >>system and re-apply it? > > > If you can get disklabel to print out the incore version of the label > and it looks correct, just pipe that output to a file and then use > that file as input to write the label. It is pretty well spelled > out in the man page for disklabel. If you use the file, you don't > need much else, just tell it to write the on disk copy of the label > and not just update the in core label. It's all there. > > In fact, it can be handy to keep a copy of your disklabels in > files on some other easily accessible online storage for such occasions. > > ////jerry > > >>I have everything mounted. >>Filesystem 1K-blocks Used Avail Capacity Mounted on >>/dev/ad0s2a 128990 42770 75902 36% / >>/dev/ad0s2f 257998 532 236828 0% /tmp >>/dev/ad0s2g 7179502 5481904 1123238 83% /usr >>/dev/ad0s2e 257998 225462 11898 95% /var >>procfs 4 4 0 100% /proc >> >>and disklabel offers to apply this information to the disk, but >>I'm not sure it's right: there was an NTFS partition covering the >>first 4 Gb. So starting from 0 doesn't look right to me. But then >>that is slice 2 . . . . >> >>8 partitions: >># size offset fstype [fsize bsize bps/cpg] >> a: 262144 0 4.2BSD 2048 16384 94 # (Cyl. >> 0 - 17*) >> b: 492720 262144 swap # (Cyl. >> 17*- 49*) >> c: 16390080 0 unused 0 0 # (Cyl. >> 0 - 1083) >> e: 524288 754864 4.2BSD 2048 16384 94 # (Cyl. >> 49*- 84*) >> f: 524288 1279152 4.2BSD 2048 16384 94 # (Cyl. >> 84*- 119*) >> g: 14586640 1803440 4.2BSD 2048 16384 89 # (Cyl. >>119*- 1083*) >> >>I guess what I need is how to map the mounted filesystems to the >>right disklabel values. >> >>I'm not on the list, so direct replies would be most helpful. >> >>Thanks. >> >>-- >>Paul Beard / 8040 27th Ave NE / Seattle WA 98115 / >>paulbeard [at] mac [ dot] com / 206 529 8400 >> >>http://paulbeard.no-ip.org/movabletype >> >>Any sufficiently advanced technology is indistinguishable from magic. >> -- Arthur C. Clarke >> >> >>To Unsubscribe: send mail to majordomo@FreeBSD.org >>with "unsubscribe freebsd-questions" in the body of the message >> > > -- Paul Beard / 8040 27th Ave NE / Seattle WA 98115 / paulbeard [at] mac [ dot] com / 206 529 8400 http://paulbeard.no-ip.org/movabletype To the best of my recollection, Senator, I can't recall. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message