RFC: making gpart default

Peter Wemm peter at wemm.org
Thu Sep 25 21:45:15 UTC 2008


On Thu, Sep 25, 2008 at 2:24 PM, Marcel Moolenaar <xcllnt at mac.com> wrote:
> On Sep 25, 2008, at 12:46 PM, Poul-Henning Kamp wrote:
[..]
>> pretty conclusively, but fsck will happily trash a database
>> stored in partition that previously contained a filesystem,
>> provided enough magic bits survive near the start.
>
> That's why I believe we need to attach real meaning
> to the partition type. We should disallow a newfs_ufs
> on a partition that is not of type freebsd-ufs. We
> should disallow swapon for a partition that is not
> of type freebsd-swap. etc..
>
> With gpart it's trivial to change the partition type,
> so it's no hassle. The protection and support this
> gives users certainly outweighs the hassle IMO.

Don't forget that we currently support creating file systems on raw
disk devices.  eg: /dev/ad1.  You are currently allowed to swapon
/dev/ad2.  There are a lot of those out there, you can't break it
because people know where you work and will come find you. :)

This however, is a different issue to switching GEOM_BSD + GEOM_MBR to
GEOM_PART_BSD + GEOM_PART_MBR.

(I think the partition type thing could be solved by specifying the
heuristic as "if the partition *has a type* and its not ufs, then
disallow ufs" etc. Don't forget to include --shoot-foot=allowed
override mode.)
-- 
Peter Wemm - peter at wemm.org; peter at FreeBSD.org; peter at yahoo-inc.com; KI6FJV
"All of this is for nothing if we don't go to the stars" - JMS/B5
"If Java had true garbage collection, most programs would delete
themselves upon execution." -- Robert Sewell


More information about the freebsd-arch mailing list