Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jun 2013 04:11:40 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Istvan Gabor <suseuser04@lajt.hu>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: FreeBSD slice/partiton setup question
Message-ID:  <20130619041140.9fcf560c.freebsd@edvax.de>
In-Reply-To: <75c6982b.160d2cfb.51c0ab74.ef503@lajt.hu>
References:  <5b0c4c76.5d73a4fb.51c09c79.2f6f2@lajt.hu> <CAHu1Y72aZseMcB5ift_k5d3dzApDbsRcvvmzGz18zrQgUytgmQ@mail.gmail.com> <75c6982b.160d2cfb.51c0ab74.ef503@lajt.hu>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Tue, 18 Jun 2013 20:48:20 +0200, Istvan Gabor wrote:
> 2013. j=FAnius 18. 19:49 napon Michael Sierchio <kudzu@tenebras.com> =EDr=
ta:
>=20
> > On Tue, Jun 18, 2013 at 10:44 AM, Istvan Gabor <suseuser04@lajt.hu> wro=
te:
> > > ...
> > > How can I do this in FreeBSD?
> > > Can I have slices with only one partition occupying the whole slice?
> > >
> > > Can I do something like the following:
> > >
> > > /dev/ad0s1a /
> > > /dev/ad0s2e /home
> > > /dev/ad0s3e /usr/local
> > > /dev/ad0s5b swap
> > > /dev/ad0s6e /home/user1
> > > /dev/ad0s7e /home/user2
> > > etc.
> > >
> > > where the partitions (a, e, b) occupy the whole slice where they resi=
de on?
>=20
> Thanks, but I don't understand your answer.

First I'd like to point you at the excellent documentation
provided by FreeBSD:

http://www.freebsd.org/doc/handbook/disks-adding.html

http://www.freebsd.org/doc/en/books/handbook/geom-glabel.html

http://www.freebsd.org/doc/handbook/bsdinstall-partitioning.html

Also read Warren Block's article about the tools used in the
"old" and "new" way of preparing a disk for use:

http://www.wonkity.com/~wblock/docs/html/disksetup.html

Regarding terminology, just if it hasn't been clear already:

In UNIX terminology, a slice is what DOS and therefor "Windows"
refers to as a "DOS primary partition". It is designated a number.
It can be subdivided in partitions which are designated a letter.
A partition carries a file system, a slice carries partitions,
and finally a device carries slices. (The slicing can also be
omitted, this is called "dedicated").

Examples:

ad0 =3D the 1st disk
ad0s1 =3D the 1st slice
ad0s1a =3D the 1st partition of the 1st slice
	...
ad0s1h =3D the 8th partition of the 1st slice

And the dedicated approach:

ad0a =3D the 1st partition "directly" created on the 1st disk

The letters have a specific meaning: 'a' is a bootable partition.
'c' is "the whole thing" (being "the whole slice" or "the whole
disk"), 'b' is reserved for a swap partition, and "user-defined
partitions" go from 'd' to 'h'.

As I mentioned, there is a "new" and an "old" way of partitioning.
What I've discussed so far is called "MBR partitioning", it's
the "old" way.

The "new" way, "GPT partitioning", does not use the idea of
slices and partitions anymore. Instead partitions are enumerated
and created "directly".

Example:

ad0 =3D the 1st disk
ad0p1 =3D the 1st partition
	...
ad0p15 =3D the 15th partition


Of course, different tools are involved here, as you can see
in the documentation links provided above.



> I am puzzled a little bit. My understanding based on the FreeBSD handbook=
 is that
> slices in FreeBSD are the partitions in linux.

So far correct, with an exception: A slice does _not_ carry a file
system, whereas in DOS terminology, reflected in Linux, the file
system is created in a DOS-like manner.

Example:

/dev/sda1 =3D 1st disk 1st DOS partition (slice) _with_ file system
/dev/ad0s1 =3D the same, but no file system here
/dev/ad0s1a =3D 1st partition on that slice _with_ file system



> And that on one slice (linux partition)
> FreeBSD  has (or can have?) several partitions.

Correct.



> These are labeled as letters: a for root
> partition, b for swap, c for the whole slice, and e for a regular non-roo=
t partition.

Correct as well.



> Are you saying that one can use/mount a whole slice without adding partit=
ions to it?
> For example /dev/ada0s1 could be the root partition?

No. You _need_ to create a partition, read: "at least one partition". That
partition can cover the whole slice (or device, as mentioned above), and
it will be designated 'c', but that letter is omitted (I think since
FreeBSD 5).

Example:

Let's assume you have created the /dev/ada0s1 slice already. Now you do:

	# newfs /dev/ada0s1

and you get a file system on the /dev/ada0s1c partition (which is created
"implicitely" by newfs. You can now mount it:

	# mount -t ufs /dev/ada0s1 /mnt

But remember: That is the 'c' partition!

Similar approach for data disks (where you want to dedicate the whole
disk to data use, not booting or anything else):

	# newfs /dev/da0
	# mount -t ufs /dev/da0 /mnt

Again, /dev/da0c is the device you're operating on (which carries the
file system).



> Do you mean putting all partitions on one big slice?

With traditional partitioning, you can only use up to 'h' partitions
(with exceptions). If you need more than those 8, use GPT instead.

If you _must_ use MBR partitioning, you can have up to 4 slices
on a disk, giving you (with exceptions) 4 x 8 =3D 32 partitions
for FreeBSD on one disk.



> I would like to be able to mount different partitions independently from =
other OS,
> eg. from linux.

That can be problematic because Linux doesn't seem to fully support
UFS file systems and BSD partitioning... If interoperability is your
goal, then you should probably use "exchange partitions" with a
file system that is better supported on FreeBSD (than using FreeBSD
and hoping for greater-than-zero support on Linux). Check if Linux
supports GPT properly. It's much easier to deal with GPT than with
the limitations of MBR partitioning (which only allows up to 4
"primary DOS partitions".



> As far as I know linux cannot mount FreeBSD partitions, only the
> whole slice.

You cannot mount a slice because it doesn't carry a file system.
You can only mount "things" that carry a file system, which in
UNIX terminology is a partition, either embedded in a slice, or
"directly" on the disk.



> If one slice has several partitions, one single partition can
> not be mounted from linux.

The opposite should be true. You should be able to address each
partition (each one carrying a file system) independently.




What you're planning is a bit complicated due to different
understanding and support on Linux (while FreeBSD can access
both file systems in "DOS primary partitions" and "logical
devices inside DOS extended partitions". With the "fuse" and
"e2fsprogs" ports you'll have sufficient access to Linux
file systems beyond ext2fs. :-)



--=20
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20130619041140.9fcf560c.freebsd>