Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 May 2010 04:10:55 +0200
From:      Jon Theil Nielsen <jontheil@gmail.com>
To:        Christopher Key <cjk32@cam.ac.uk>
Cc:        User Questions <freebsd-questions@freebsd.org>
Subject:   Re: More than 8 partitions
Message-ID:  <q2s8f82c35c1005011910w1ad4792ehd90f38d3a8883519@mail.gmail.com>
In-Reply-To: <4BDC794B.2060009@cam.ac.uk>
References:  <y2z8f82c35c1004301044pd7168618qa23eb66438350a5d@mail.gmail.com>  <4BDC794B.2060009@cam.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
2010/5/1 Christopher Key <cjk32@cam.ac.uk>

> Jon Theil Nielsen wrote:
> > Hi
> >
> > I'm running 8.0-Release on an external usb hard drive. and have dual-boot
> > with FreeBSD on da0s2 and Windows XP on da0s1. I made a setup via
> Sysinstall
> > with 7 partitions:
> >
> > /dev/da0s2a on / (ufs, local)
> > /dev/da0s2b (swap)
> > /dev/da0s2d on /var (ufs, local, soft-updates)
> > /dev/da0s2e on /tmp (ufs, local, soft-updates)
> > /dev/da0s2f on /usr (ufs, local, soft-updates)
> > /dev/da0s2h on /var/log (ufs, local, soft-updates)
> > /dev/da0s2g on /home (ufs, local, soft-updates)
> >
> > I have about 660 GB left unused on da0s2 that I would like to use for
> > backups. But I can't figure out how to create one more partition.
> > If i create a file for bsdlabel like
> >
> > #       size    offset  fstype
> > i:      *       0       4.2BSD
> >
> > I get the following error message: "line 2: partition name out of range
> a-h:
> > i"
> > I have also tried with gpart:
> >
> > gpart add -s 500G -t freebsd -f x da0s2
> >
> > I get something like "gpart: index '9': No space left on device"
> >
> > I thought that 8.0 should support more than 8 partitions. Maybe it does,
> but
> > then I don't know how to do.
> > Any ideas?
> >
> >
> I believe that FreeBSD does support more than 8 partitions on a disk
> (apparently up to 20 using gpart), but that you need sufficient entries
> for these partitions to be created in the disklabel, viz.
>
> gpart create -n 20 ...
>
> Some testing seems to indicate that you can manually override this by
> changing by byte 0x28a of the disk from 0x08 to 0x14, and that bsdlabel
> / gpart will then allow you to create further partitions on the disk.
>
>
>
> Kind regards,
>
> Christopher Key


Thanks Christopher

I am not sure if I understand all of if. And I wouldn't like to wipe the
drive to test if is possible to "mass produce" partitions like that. Could
be useful in another situation, though.

My knowlodge of GEOM and its utilities is very limited. Since I have
succeded in creating the two slices with fdisk and subsequently populate
them with bsdlabel, my only problem is how to create the last partition from
the unpartioned space on da0s2. As mentioned in the beginning of this post,
I have tried with both bsdlabel (from a file) and by issuing the gpart add
command. With no luck. Would it be any help to give more specific about the
drive/slice? The output of df -h | grep dev/da0 is:

/dev/da0s2a   3.9G   630M    2.9G    17%    /
/dev/da0s2g    97G   160K     89G     0%    /home
/dev/da0s2e   3.9G   129M    3.4G     4%    /tmp
/dev/da0s2f    48G   6.6G     38G    15%    /usr
/dev/da0s2d   9.7G   151M    8.8G     2%    /var
/dev/da0s2h   3.9G   1.5M    3.6G     0%    /var/log

and of gpart show da0:

=>         0  1759551255  da0s2  BSD  (839G)
           0     1048576         - free -  (512M)
     1048576     8318064      2  freebsd-swap  (4.0G)
     9366640     7303168         - free -  (3.5G)
    16669808     8388608      1  freebsd-ufs  (4.0G)
    25058416    20971520      4  freebsd-ufs  (10G)
    46029936     8388608      5  freebsd-ufs  (4.0G)
    54418544   104857600      6  freebsd-ufs  (50G)
   159276144   209715200      7  freebsd-ufs  (100G)
   936891344     8388608      8  freebsd-ufs  (4.0G)
   377379952  1382171303         - free -  (659G)

and, finaly, of bsdlabel da0s2:

# /dev/da0s2:
8 partitions:
#        size     offset    fstype   [fsize bsize bps/cpg]
a:    8388608   16669808    4.2BSD        0     0     0
b:    8318064    1048576      swap
c: 1759551255          0    unused        0     0         # "raw" part,
don't edit
d:   20971520   25058416    4.2BSD        0     0     0
e:    8388608   46029936    4.2BSD        0     0     0
f:  104857600   54418544    4.2BSD        0     0     0
g:  209715200  159276144    4.2BSD        0     0     0
h:    8388608  368991344    4.2BSD        0     0     0

In my desparate effort to understand these informations/data, i have put
them into a spreadsheet and rearranged them - including some of my own
calculations and assumptions.

bsdlabel output - sorted by sector offset:

#            size       offset  (GB*)
c   1.759.551.255            0    839
b       8.318.064    1.048.576      4
a       8.388.608   16.669.808      4
d      20.971.520   25.058.416     10
e       8.388.608   46.029.936      4
f     104.857.600   54.418.544     50
g     209.715.200  159.276.144    100
h       8.388.608  368.991.344      4

gpart show output - sorted by sector offset:

(#)         (size)    (offset)   (GB)      (offset*)   (GiB*)    (i)
        1.048.576            0    0,5              0        1   free
 b      8.318.064    1.048.576      4      1.048.576        4      2
        7.303.168    9.366.640    3,5      9.366.640        3   free
 a      8.388.608   16.669.808      4     16.669.808        4      1
 d     20.971.520   25.058.416     10     25.058.416       10      4
 e      8.388.608   46.029.936      4     46.029.936        4      5
 f    104.857.600   54.418.544     50     46.029.936       50      6
 g    209.715.200  159.276.144    100    159.276.144      100      7
    1.382.171.303  377.379.952    659    368.991.344      659   free
 h      8.388.608  936.891.344      4  1.759.551.255        4      8

In the first place, I wondered why gpart would not let me add anoter
partiotion. There *should *be lots of free space left. But on closer
inspection, it seems that the 659 somehow is '"squezzed'" in. Don't really
know what all this is about. Allthough this might be a vaste of time, since
I kan copy, reslice/repartition and copy back, any more comments are
welcome.

Regards,
-- 
Jon



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