# vinum on top of geli



## blox (Feb 2, 2011)

Hi,

I am rather new to FreeBSD; just installed it the last weekend. Now I'm facing the problem of running out of space (especially on /usr). So I bought a new disk, putted it in my computer and started to read about all the possibilities one has to set up a disk the advanced way. 

I ended with the following idea:
1) to partition the whole disk with GUID partition table
2) have a rather small root partiton as first partition to be able to boot
3) make out of the rest one big partition, encrypt it with geli
   and put it in one vinum

1) was no problem of all; on 2) I was struggling a bit originally I thought on putting the root also inside the encrypted part, but I wasn't sure if it is possible to put /boot on a seperate partition (So that's actually my first question â€“ is it possible?).

And with 3) I'm not advancing at all; setting up geli was no problem at all. But it seems like gvinum doesn't like my idea. :/

Anyway, here some output:


```
taris# uname -r
8.2-PRERELEASE

taris# gpart show ad6
=>       34  488397101  ad6  GPT  (233G)
         34        128    1  freebsd-boot  (64K)
        162    4194304    2  freebsd-ufs  (2.0G)
    4194466  484202669    3  freebsd-vinum  (231G)

taris# geli attach /dev/ad6p3
Enter passphrase:

taris# geli list
Geom name: ad6p3.eli
State: ACTIVE
EncryptionAlgorithm: AES-XTS
KeyLength: 128
Crypto: software
UsedKey: 0
Flags: NONE
Providers:
1. Name: ad6p3.eli
   Mediasize: 247911763968 (231G)
   Sectorsize: 4096
   Mode: r0w0e0
Consumers:
1. Name: ad6p3
   Mediasize: 247911766528 (231G)
   Sectorsize: 512
   Mode: r1w1e1

taris# cat ad6p3.eli 
drive samsung_250gb device /dev/ad6p3.eli
volume home
plex org concat
sd length 50G drive samsung_250gb

taris# gvinum list 
0 drives:

0 volumes:

0 plexes:

0 subdisks:

taris# gvinum create ad6p3.eli

taris# gvinum list
1 drive:
D samsung_250gb         State: up	/dev/ad6p3.eli	A: 185226/236426 MB (78%)

1 volume:
V home                  State: up	Plexes:       1	Size:         50 GB

1 plex:
P home.p0             C State: up	Subdisks:     1	Size:         50 GB

1 subdisk:
S home.p0.s0            State: up	D: samsung_250gb Size:         50 GB

taris# ls -la /dev/gvinum/*
crw-r-----  1 root  operator    0, 148 Feb  2 20:32 /dev/gvinum/home
```

As I understood it, there should now also appear the *.pl? files in /dev/gvinum. Anyway I tried:

```
taris# newfs /dev/gvinum/home 
newfs: wtfs: 512 bytes at sector 104857599: Invalid argument

taris# mount /dev/gvinum/home /mnt/
mount: /dev/gvinum/home : Invalid argument
```

Am I missing something or is it simply this combination that doesn't work?

I just saw that dmesg gives:

```
GEOM_VINUM: writing vhdr failed on drive samsung_250gb, errno 22
g_vfs_done():gvinum/home[READ(offset=65536, length=8192)]error = 22
```

Regards,
blox


----------



## SirDice (Feb 3, 2011)

To answer #2: Yes, you can boot off a geli encrypted disk. See geli(8) (example section).

Your current setup actually has no need for vinum. But if it's just for test it should be fine. Not so sure about the order, it may work better if you setup vinum first and then encrypt the vinum volume.


----------



## blox (Feb 3, 2011)

But to boot from a geli partition one needs to boot the kernel from an usb stick or a cd-rom, right?

Why don't I need vinum?

My idea was to have the possibility to plug in another hard drive when running out of space to put geli on it and to add it to the drive pool of vinum.

Regards,
blox


----------



## SirDice (Feb 3, 2011)

blox said:
			
		

> But to boot from a geli partition one needs to boot the kernel from an usb stick or a cd-rom, right?


No.



> My idea was to have the possibility to plug in another hard drive when running out of space to put geli on it and to add it to the drive pool of vinum.


Look into growfs(8).


----------



## blox (Feb 3, 2011)

SirDice said:
			
		

> Look into growfs(8).



I'm not in front of my BSD box right now, so I cannot test it. But, as I understood the man page I would still have to make a â€˜hardâ€™ labeling of the geli partition, wouldn't I? 

That's exactly what I don't want to do.


----------



## SirDice (Feb 3, 2011)

To be honest I've never used growfs before. Never had the need to. My current setup has separate partitions for /usr/home/ and things like ports and src. As a result the size of my /usr/ partition is fairly consistent, most of the data is in my home directory.

I'd put the extra disk in as /usr/home/ and copy the 'old' home directories to the new disk. Takes a bit of time but it's actually really easy to do.


----------



## blox (Feb 3, 2011)

OK, so I just set up gvinum and on top of that a geli volume with journaling. Worked out of the boxâ€¦

Anyway as I am new to FreeBSD I am a bit curious on what I could/should do next. Is this enough to file a bug report? (Maybe as a wanted feature?)

Should I first ask about this on the mailing list?


----------

