From owner-freebsd-current Tue Sep 21 5:56: 4 1999 Delivered-To: freebsd-current@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.40.131]) by hub.freebsd.org (Postfix) with ESMTP id ED68E14F86 for ; Tue, 21 Sep 1999 05:56:00 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.9.3/8.9.2) with ESMTP id OAA28597 for ; Tue, 21 Sep 1999 14:55:51 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: current@freebsd.org Subject: "md" driver, some info From: Poul-Henning Kamp Date: Tue, 21 Sep 1999 14:55:50 +0200 Message-ID: <28595.937918550@critter.freebsd.dk> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG The "md" driver I committed today is mostly a proof-of-concept thing which came out of a chat with Peter Wemm. It acts like a disk in all aspects, although it will be hard to boot from it :-) It will do very simple compression, in that a sector (512bytes) which is filled with the same character throughout, will not be allocated as a full sector, instead just the byte value is saved. In practice this means that making a 10M filesystem doesn't take 10M of ram, until you fill data into it. The driver will also free the sectors after you delete a file from the filesystem (ufs only). # disklabel -r -w md0 auto # newfs md0c # vmstat -m | grep " MD s" MD sectors 635 318K 318K 21136K 635 0 0 512 # mount /dev/md0c /mnt # cp /kernel /mnt # vmstat -m | grep " MD s" MD sectors 4178 2089K 2089K 21136K 4178 0 0 512 # rm /mnt/kernel # vmstat -m | grep " MD s" MD sectors 636 318K 2120K 21136K 4240 0 0 512 # umount /mnt # dd if=/dev/zero of=/dev/rmd0 # vmstat -m | grep " MD s" MD sectors 0 0K 2120K 21136K 4240 0 0 512 # Currently the size is arbitrarily set at 20000 sectors, just shy of 10MB. The driver can be nice-ified in various ways, suggestions and patches are welcome. -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop." FreeBSD -- It will take a long time before progress goes too far! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message