On my Mediaserver (OS is FreeBSD), Ive be battling with drive space, and im always shuffling content around.
Last night was the final straw.
I backed up my content to an external drive, and then I proceeded to create a stripe across my three drives. This will allow me to use and add each drives space and make it look like one giant volume.
Note. If you do this, drives do need to be of equal size.
I have three old IDE 110G drives, that I put to some use.
N.B. Raid 0 provides no data redundancy.
Remember this exercise is to create a larger logical disk.
First we tell what Kernel to load for boot time.
echo 'geom_stripe_load="YES"' >> /boot/loader.conf
Load the kernel module
kldload geom_stripe
Although, I moved the data, and want to start off on a clean slate.
gpart destroy -F /dev/ada0
gpart destroy -F /dev/ada1
gpart destroy -F /dev/ada4
Now to create my stripe
gstripe label -v st0 /dev/ada0 /dev/ada4 /dev/ada1
bsdlabel -wB /dev/stripe/st0
newfs -U /dev/stripe/st0a
And thats that. Last is for me to add my stripe, so that is can be mounted on next reboot.
echo "/dev/stripe/st0a /mnt ufs rw 2 2" >> /etc/fstab
Here is a few commands to see how and what your stripe is doing.
gpart show
gstripe list
gstripe status
HTH
Brent
Monday, July 30, 2012
Thursday, July 26, 2012
Resume losts screen session
Ever have it that you cant for some reason reattach to a screen session.
torry# screen -r
There is a screen on:
52146.pts-0.torry (Attached)
There is no screen to be resumed.
Run
screen -D
If you have more than one attached screen, you can specify a particular screen to detach.
screen -D 1636.pts-21.hostname
Then run 'screen -r' again.
HTH
Brent
torry# screen -r
There is a screen on:
52146.pts-0.torry (Attached)
There is no screen to be resumed.
Run
screen -D
If you have more than one attached screen, you can specify a particular screen to detach.
screen -D 1636.pts-21.hostname
Then run 'screen -r' again.
HTH
Brent
Sunday, July 22, 2012
IP alias to solve hung NFS mount
Working on FreeNAS, Ive had to research a hung NFS mount everytime I reboot FreeNAS or something silly.
A trick to execute on the NFS client , is to add an alias to the interface with the IP of the NFS server.
In Linux the command for that is something roughly like:
ifconfig eth0:fakenfs 192.0.2.55 netmask 255.255.255.255
For FreeBSD:
ifconfig em0 alias 192.0.2.55 netmask 255.255.255.255
And then to remove it:ifconfig em0 delete 192.0.2.55
HTH
Brent
Thursday, July 19, 2012
PHP error log => Remember log permissons
This is more for me self than anything else.
When enabling PHP error logging, for clients, do:
Edit php.ini file (or create a new one in conf.d (/etc/php5/conf.d/php.ini)).
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = Off
log_errors = On
error_log = /var/log/apache2/php-error.log
THEN !!!!!
Remember to chown 0666 the $error_log.
For on apache restart. The owner is root root, but user www-data, cant write to it.
HTH
Brent
When enabling PHP error logging, for clients, do:
Edit php.ini file (or create a new one in conf.d (/etc/php5/conf.d/php.ini)).
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = Off
log_errors = On
error_log = /var/log/apache2/php-error.log
THEN !!!!!
Remember to chown 0666 the $error_log.
For on apache restart. The owner is root root, but user www-data, cant write to it.
HTH
Brent
Tuesday, July 17, 2012
FreeNAS KVM guest nic woes
I’m in process of testing FreeNAS on my KVM host. The problem I experienced was that FreeNAS was not picking up the Ethernet interface.
I even ran 'pciconf -vl', and lo and behold there was the nic.
I really couldn’t understand, for the below command sure works for FreeBSD 9.
This is the general command I use for a FreeBSD guest:
virt-install --connect qemu:///system -n freebsdguestname -r 512 --vcpus=1 --disk path=/space/freebsdguest.img,size=12 -c /iso/freebsd.iso --vnc --noautoconsole --os-type unix --os-variant freebsd7 --accelerate --network=bridge:br0 --hvm;
So not to spend to much time trouble shooting, I added '--network=bridge:br0,model=rtl8139'
And it all worked.
HTH
Brent
I even ran 'pciconf -vl', and lo and behold there was the nic.
I really couldn’t understand, for the below command sure works for FreeBSD 9.
This is the general command I use for a FreeBSD guest:
virt-install --connect qemu:///system -n freebsdguestname -r 512 --vcpus=1 --disk path=/space/freebsdguest.img,size=12 -c /iso/freebsd.iso --vnc --noautoconsole --os-type unix --os-variant freebsd7 --accelerate --network=bridge:br0 --hvm;
So not to spend to much time trouble shooting, I added '--network=bridge:br0,model=rtl8139'
And it all worked.
HTH
Brent
Add additional drive or storage to a KVM guest
Ever needed to attach an additional virtual drive or storage drive to your KVM guest?
Heres how you can.
On the KVM host, create the 'drive' with either of the following two commands
qemu-img create -f qcow2 /path/moredrivespace.img 10G
or
dd if=/dev/zero of=/path/moredrivespace2.img bs=1 seek=10G count=0
This is where it gets interesting.
Now to add your new 'drive', to your KVM guest.
Run the command 'virsh'
Welcome to virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
virsh # attach-disk KvmGuestDomainName /path/moredrivespace.img vdo
By default or by specifying the target of vdo, the default driver will be
Virtio. If you are a FreeBSD user like I am. You will struggle, for FreeBSD will not see the device. I find you need to use a SCSI device. And inorder to use / do so, you need to run this command.
attach-disk KvmGuestDomainName /space/moredrivespace.img sda
I also found for FreeBSD, its best to use the dd command.
As per usual, Linux guests just work.
;)
And then reboot your VM.
HTH
Brent
Heres how you can.
Firstly, I recommend that you backup your data!
On the KVM host, create the 'drive' with either of the following two commands
qemu-img create -f qcow2 /path/moredrivespace.img 10G
or
dd if=/dev/zero of=/path/moredrivespace2.img bs=1 seek=10G count=0
This is where it gets interesting.
Now to add your new 'drive', to your KVM guest.
Run the command 'virsh'
Welcome to virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
virsh # attach-disk KvmGuestDomainName /path/moredrivespace.img vdo
By default or by specifying the target of vdo, the default driver will be
Virtio. If you are a FreeBSD user like I am. You will struggle, for FreeBSD will not see the device. I find you need to use a SCSI device. And inorder to use / do so, you need to run this command.
attach-disk KvmGuestDomainName /space/moredrivespace.img sda
I also found for FreeBSD, its best to use the dd command.
As per usual, Linux guests just work.
;)
And then reboot your VM.
HTH
Brent
Subscribe to:
Posts (Atom)