Sunday, January 30, 2011

virtualbox stuff

Version 4.x changes the game somewhat from version 3.x.

To enable USBs, you'd need to download a separate file called extensions pack. USB is NOT included in the vbox additions, as in earlier versions.
Download the extensions pack using your host browser, not the guest VM.

Then shut down your VM (if it's running), and install it under File-Preferences-Extensions.

Then, THEN, make sure your Linux user id belongs to the group vboxusers. System-Administration-Users and Groups, under Ubuntu's main menu.

Only then did my USB drive work inside the guest machine.

---

Import/Export appliance - it works. I exported from v3.1 (still under the Sun logo), to v4.0.2 (Oracle logo). Different machines. Installed ssh-server on the destination laptop, installed filezilla on the source laptop, did the export locally, then did a sftp to copy the 3 virtualbox files, then on the destination laptop, did the import.

The 3 files generated during export were:
1. *.mf
2. *.ovf
3. *.vmdk (the virtual hard disk)

Saturday, January 29, 2011

how to view local php files

Here's just so I won't forget.

Currently my home laptop have these packages installed:
1. mysql-server, and dependencies
2. phpmyadmin, and dependencies
3. php5, and dependencies

Now wanting to play around with PHP scripting, without installing LAMP, I found out here that the default location where I should start putting my PHP files would be in /var/www.

Putting any PHP file in this directory, then viewing in my browser via http://localhost/ works.

However, I want to have my own webdev directory, under my own home folder. Trying out the tips of this link.

Great tutorial - it works!

Wednesday, January 26, 2011

mysql stuff - setting up a (super) user

1. Install mysql-server package
2. Create a super user
mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
    ->     WITH GRANT OPTION;
mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'
    ->     WITH GRANT OPTION;
3. Install phpmyadmin package

4. Go ahead and import Excel tables!

Friday, January 21, 2011

Raid 1 not starting and mounting on boot - Ubuntu 10.10 Maverick

Still a work in progress.

Here are my link resources to figure this out -
Ubuntu forums #1

Ubuntu forums #2

and a new lead here.


and here's a draft:
hard disk1: /dev/sda
hard disk2: /dev/sdb, raid device: /dev/sdb1
hard disk3: /dev/sdc, raid device: /dev/sdc1
raid1 device name: /dev/md0

ARRAY /dev/md0 devices=/dev/sdb1,/dev/sdc1


mount raid1
sudo rm /etc/mdadm/mdadm.conf
sudo dpkg-reconfigure mdadm

click Yes (redundancy checks), Yes (monitor daemon), enter email address, No (boot system if RAID gets degraded)

gksu gedit /etc/mdadm/mdadm.conf
replace the ARRAY /dev/md0, and remove the UUID references, replace with devices=/dev/sdb1,/dev/sdc1

then rerun:
sudo dpkg-reconfigure mdadm

get UUID of the raid device:
sudo blkid

and modify fstab
gksu gedit /etc/fstab, inserting this line:

UUID=ae5f4540-59af-4e7a-84b0-ea97cc12e425  /Raid500    ext3          nodev,nosuid       0       2

The puzzle revealed
Inspecting my Ubuntu-10.04-with-RAID1 at home - which works starting up the raid and automounting it - I observed the following:
sudo blkid
reveals the following information:
dan@athena:~$ sudo blkid
/dev/sda1: UUID="7272061b-81d4-7395-e009-c51128a3b5c6" TYPE="linux_raid_member" 
/dev/sda2: UUID="c9ce349c-636a-667d-51a5-cb52c66e37ae" TYPE="linux_raid_member" 
/dev/sdb1: UUID="7272061b-81d4-7395-e009-c51128a3b5c6" TYPE="linux_raid_member" 
/dev/sdb2: UUID="c9ce349c-636a-667d-51a5-cb52c66e37ae" TYPE="linux_raid_member" 
/dev/md0: UUID="97019d30-06b0-42ef-8bfd-1699316f3012" TYPE="swap" 
/dev/md1: LABEL="raid1now" UUID="f1d9e97a-b766-4af1-bafd-ce0192aa04e1" TYPE="ext4"

I am guessing here that the /dev/sda1 and /dev/sdb1 are the swap partitions of the 2 actual physical drives. And the /dev/sda2 and /dev/sdb2 are, in turn, the ext4 partitions also of the 2 actual physical drives. And notice how both sda1 and sdb1 are the same, as well as sda2 and sdb2.

The raid device then takes new UUID values for swap (/dev/md0) and ext4 (/dev/md1).

BUT, the mdadm.conf tells a different story.
# definitions of existing MD arrays
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=7272061b:81d47395:e009c511:28a3b5$
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=c9ce349c:636a667d:51a5cb52:c66e37$

The mdadm.conf's md0 = blkid's sda1 (and sdb1), while its md1 = blkid's sda2 (and sdb2) - with slight variations:
Comparing blkid's sda1 (and sdb1) with mdadm's md0:
7272061b-81d4-7395-e009-c51128a3b5c6
7272061b:81d47395:e009c511:28a3b5$

and blkid's sda2/sdb2 with mdadm's md1:
c9ce349c-636a-667d-51a5-cb52c66e37ae
c9ce349c:636a667d:51a5cb52:c66e37$

So mdadm.conf references the blkid's sda/sdb UUIDs, and NOT the blkid's md0/md1 UUIDs.

Finally, fstab reveals the following:
# / was on /dev/md1 during installation
UUID=f1d9e97a-b766-4af1-bafd-ce0192aa04e1 /               ext4    errors=remoun$
# swap was on /dev/md0 during installation
UUID=97019d30-06b0-42ef-8bfd-1699316f3012 none            swap    sw           $

Fstab references blkid's md1 with it's own md1 for the ext4 partition:
blkid: f1d9e97a-b766-4af1-bafd-ce0192aa04e1
fstab: f1d9e97a-b766-4af1-bafd-ce0192aa04e1

and same with the swap partition.