On Wed, Jun 16, 2010 at 08:43:29PM +0100, Harry Palmer wrote:
> Beginning my effort to encrypt a 300GB drive in a 64bit Ultrasparc,
> I followed these initial steps:
> 
> 1. used disklabel to create a single slice "a" on the drive
> 
> 2. made a file system with newfs (is it necessary to have so many
>    backup superblocks?)

Why don't you just use softraid(8)? No need for a filesystem, and this
particular use-case (encrypted disk) is in the EXAMPLES section of the
man page.

> 3. mounted sd2a on "/home/cy" and touched it with an empty file
>      "/home/cy/cryptfile"
> 
> 4. zeroed out the file (and efectively the drive) with
>      "dd if=/dev/zero of=/home/cy/cryptfile bs=512"

Again, why don't you work with the disk directly? Doing "dd if=/dev/zero
of=/dev/rsd0a conv=notrunc" would work fine. ("notrunc" is useful to
wipe the last bytes if you use a different blocksize - 512 is the
default, but on the low side.)

> Now I have:
> 
>  # disklabel sd2a 

> and:
> 
>  # df -h
>  Filesystem     Size    Used   Avail Capacity  Mounted on
>  /dev/sd0a     1007M   44.8M    912M     5%    /
>  /dev/sd0k      247G    2.0K    235G     0%    /home
>  /dev/sd0d      3.9G    6.0K    3.7G     0%    /tmp
>  /dev/sd0f      2.0G    559M    1.3G    29%    /usr
>  /dev/sd0g     1007M    162M    795M    17%    /usr/X11R6
>  /dev/sd0h      5.9G    212K    5.6G     0%    /usr/local
>  /dev/sd0j      2.0G    2.0K    1.9G     0%    /usr/obj
>  /dev/sd0i      2.0G    2.0K    1.9G     0%    /usr/src
>  /dev/sd0e      7.9G    7.7M    7.5G     0%    /var
>  /dev/sd2a      275G    275G  -13.7G   105%    /home/cy
> 
> 
> 
> I have no understanding of this. I've never seen a df output
> that tells me I'm using 13GB more space than the drive is
> capable of holding.

This is perfectly fine. newfs reserves, by default, 5% of all available
space for use by the root user only. This is useful in two ways: it
means root can squeeze a bit more data on the filesystem, and it
prevents the performance degradation that comes with completely filling
up a (ffs) filesystem.

What you are seeing is that the *entire* disk has been used, including
reserved space.

                Joachim

Reply via email to