Saturday, August 13, 2011

As-Is, Not Everything I Do Works Out As I Had Hoped

So, putting my file server on a VM did not have the outcome I was hoping.

But, I did do a few cool things that may save someone else a few minutes and some hair pulling. So, some of the steps I took access to the raw disks from a VM are provided below as-is. So, my notes are presented unformatted as such below.


My old fileserver with all my most treasured files was highly under utilized. So the plan was to move it to a virtual machine host.
This begged giving a OpenIndiana VM access to raw disks for zpooling (and maybe raid-z when I get better hardware for the house).

I backed up my files and started with empty platters on my spindles.


Step 1 Attach two physical disks to the host machine which become the storage mediums of the upcoming zpool.
no partitions - don't make any or get rid any preexisting

My Debian Host OS recognized the new drives as /dev/sdb & /dev/sdc and we will not mount and/or prevent mounting them.



Everything else will be easiest to accomplish as the root user.

su



brad will be the user VirtualBox will be running under
change the ownership and mode of the device nodes to allow ufettered access by the user running VirtualBox

chown brad /dev/sdb
chown brad /dev/sdc

chmod 775 /dev/sdb
chmod 775 /dev/sdc



Add the user of the VirtualBox process to the disk group

sudo usermod -a -G disk brad



create the .vmdk files

VBoxManage internalcommands createrawvmdk -filename /home/brad/.VirtualBox/a1.vmdk -rawdisk /dev/sdb -relative
VBoxManage internalcommands createrawvmdk -filename /home/brad/.VirtualBox/a2.vmdk -rawdisk /dev/sdc -relative



change the ownership and mode of the pointer files to allow ufettered access by the user running VirtualBox

chown brad /home/brad/.VirtualBox/a1.vmdk
chown brad /home/brad/.VirtualBox/a2.vmdk

chmod 775 /home/brad/.VirtualBox/a1.vmdk
chmod 775 /home/brad/.VirtualBox/a2.vmdk



log out
log in



add the .vmdk files to your virtual machine via the GUI.



Time to boot the VM.

Yeah, that's it. Fire her up. My username within the OpenIndiana VM will also be brad.



Do whatever administrative things you might do with a new machine.

Set the network connection to a fixed IP. Give good users privileges, take privileges away from bad users-- or the other way around if you desire a little more excitement in your life.



Setting up your first zpool is easiest as root. I am choosing to mount my zpool in a non-standard spot with the -m option.

su
mkdir /export/home/zfs/
zpool create -m /export/home/zfs/ memory mirror /dev/dsk/c1t2d0p0 /dev/dsk/c1t3d0p0



Create filesystems on your zpool that is much like a software RAID 1 volume. Except ZFS cares about the integrity of your data and the effects bitrot.

zfs create memory/photos
zfs create memory/iso
zfs create memory/music
zfs create memory/videos
zfs create memory/misc
zfs create memory/work
zfs create memory/holding

groupadd securftp

usermod -G securftp brad

chgrp securftp /var/zfs/holding

chmod 774 /var/zfs/holding

No comments:

Post a Comment

Followers