Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Nov 2000 13:09:11 -0800
From:      "Crist J . Clark" <cjclark@reflexnet.net>
To:        freebsd-questions@freebsd.org
Subject:   Refreshing Kernel Slice Table w/o Rebooting
Message-ID:  <20001127130911.A79675@149.211.6.64.reflexcom.com>

next in thread | raw e-mail | index | archive | help
I think I asked this once before but never got a response. Is there a
way to refresh the in-kernel slice table without rebooting?

I just resliced a disk on a running machine. Basically, I had set
aside some space for other OSes when I first set up the box a few
months ago. However, the role of the machine has changed and now I
might as well (need to, actually) give all of the space to FreeBSD. I
didn't touch slice 1, ad0s1, where FreeBSD lives, but expanded slice 2
to eat the whole disk and nuked slices 3 and 4.

Here is the old table,

  ******* Working on device /dev/ad0 *******
  parameters extracted from in-core disklabel are:
  cylinders=622 heads=255 sectors/track=63 (16065 blks/cyl)

  parameters to be used for BIOS calculations are:
  cylinders=622 heads=255 sectors/track=63 (16065 blks/cyl)

  Media sector size is 512
  Warning: BIOS sector numbering starts with sector 1
  Information from DOS bootblock is:
  The data for partition 1 is:
  sysid 165,(FreeBSD/NetBSD/386BSD)
      start 63, size 4996152 (2439 Meg), flag 80 (active)
          beg: cyl 0/ sector 1/ head 1;
          end: cyl 310/ sector 63/ head 254
  The data for partition 2 is:
  sysid 130,(Linux swap or Solaris x86)
      start 4996215, size 192780 (94 Meg), flag 0
          beg: cyl 311/ sector 1/ head 0;
          end: cyl 322/ sector 63/ head 254
  The data for partition 3 is:
  sysid 131,(Linux filesystem)
      start 5188995, size 401625 (196 Meg), flag 0
          beg: cyl 323/ sector 1/ head 0;
          end: cyl 347/ sector 63/ head 254
  The data for partition 4 is:
  sysid 131,(Linux filesystem)
      start 5590620, size 4401810 (2149 Meg), flag 0
          beg: cyl 348/ sector 1/ head 0;
          end: cyl 621/ sector 63/ head 254

And the new,

  ******* Working on device /dev/ad0 *******
  parameters extracted from in-core disklabel are:
  cylinders=622 heads=255 sectors/track=63 (16065 blks/cyl)

  parameters to be used for BIOS calculations are:
  cylinders=622 heads=255 sectors/track=63 (16065 blks/cyl)

  Media sector size is 512
  Warning: BIOS sector numbering starts with sector 1
  Information from DOS bootblock is:
  The data for partition 1 is:
  sysid 165,(FreeBSD/NetBSD/386BSD)
      start 63, size 4996152 (2439 Meg), flag 80 (active)
          beg: cyl 0/ sector 1/ head 1;
          end: cyl 310/ sector 63/ head 254
  The data for partition 2 is:
  sysid 165,(FreeBSD/NetBSD/386BSD)
      start 4996215, size 4996215 (2439 Meg), flag 0
            beg: cyl 311/ sector 1/ head 0;
            end: cyl 621/ sector 63/ head 254
  The data for partition 3 is:
  <UNUSED>
  The data for partition 4 is:
  <UNUSED>

After I did the reslice, I wanted to put a FreeBSD disklabel on the
new slice so I ran,

  # disklabel -r -w ad0s2 auto

Which succeded with no errors, but when I check the label,

  # disklabel ad0s2
  # /dev/ad0s2:
  type: ESDI
  disk: ad0s2
  label: 
  flags:
  bytes/sector: 512
  sectors/track: 63
  tracks/cylinder: 255
  sectors/cylinder: 16065
  cylinders: 12
  sectors/unit: 192780
  rpm: 3600
  interleave: 1
  trackskew: 0
  cylinderskew: 0
  headswitch: 0           # milliseconds
  track-to-track seek: 0  # milliseconds
  drivedata: 0 

  8 partitions:
  #        size   offset    fstype   [fsize bsize bps/cpg]
    c:   192780        0    unused        0     0         # (Cyl.    0 - 11)

We see this is a lot smaller than the new big slice. If we examine
more closely, we see that this is what we would have expected for the
_old_ slice 2.

If I try manually edit the label to the new size I get,

  # disklabel -e ad0s2
  disklabel: No space left on device
  re-edit the label? [y]: 

I cannot write the correct label to the disk. It seems the kernel
remembers the old slice table, and I can't figure out how to load the
new one in there. I had this problem once in the past, but it was just
an annoyance since rebooting that machine was no problem. Rebooting
this machine is a pain since it has some things I'd rather not
interupt running.

Any solutions or workarounds?
-- 
Crist J. Clark                           cjclark@alum.mit.edu


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001127130911.A79675>