Monday, February 2, 2015

Steps


  • added virtual disks
  • created fielsystems Gh1-Gh4 and mounted
  • create iAmGh shares for all drives
  • create oc- folders on Data  (admin, mdean, sdean, bobncarol, marma, tmp)
  • moved all oc- folders to each Gh drive (to create possible landing zones)
  • removed ownCloud samba share
  • added samba shares for all oc-xxxx shares
  • added Gh1-Gh4 to Greyhole pools
  • modified mount_shares_locally to support www-data on oc-xxxx shares
  • create link from the data share points to the same Gh1 share points
  • added users for mdean, sdean, and bobncarol
  • logged into owncloud with each user (creates owncloud folder)
  • copied owncloud folder to Gh1 folders
    • cp -Rp admin /media/06334345-6048-40aa-a206-ce471316d173/oc-admin
  • Replaced orig folders with links to samba mounts
    • rm -R marma/
    • ln -s /mnt/samba/oc-mdean mdean
    • mdean -> /mnt/samba/oc-mdean
  • reboot
  • added omv user back in and gave rights to all oc-xxx folders


ownCloud working (sortof)

data shares are links to the gh_ versions
drwxr-xr-x  11 root     root      4096 Feb  2 15:03 .
drwxr-xr-x   7 root     root      4096 Feb  2 15:57 ..
-rw-------   1 root     root      6144 Feb  2 17:09 aquota.group
-rw-------   1 root     root      7168 Feb  2 17:09 aquota.user
drwxrwsr-x   2 root     users     4096 Feb  1 09:29 iAmData
drwx------   2 root     root     16384 Jan 31 10:49 lost+found
drwxrwsr-x   2 root     users     4096 Feb  1 15:08 Movies
drwxrwsr-x   2 root     users     4096 Feb  1 09:31 Music
drwxrwsr-x   5 mysql    users     4096 Feb  2 17:09 MySql
drwxrwx---+  3 www-data www-data  4096 Feb  2 17:25 oc
lrwxrwxrwx   1 root     users       52 Feb  2 15:03 oc-admin -> /media/1ed3d629-11cf-4b94-be26-6231cfe8893c/oc-admin
lrwxrwxrwx   1 root     users       52 Feb  2 15:03 oc-mdean -> /media/1ed3d629-11cf-4b94-be26-6231cfe8893c/oc-mdean
lrwxrwxrwx   1 root     users       50 Feb  2 15:03 oc-tmp -> /media/1ed3d629-11cf-4b94-be26-6231cfe8893c/oc-tmp
drwxrwsr-x   2 root     users     4096 Jan 31 14:06 Photos
drwxrwsr-x   2 root     users     4096 Feb  1 09:32 Projects
drwxrwsr-x   2 root     users     4096 Feb  1 09:31 Videos
root@nfs:/media/1a89ed0c-663f-4cc7-84fe-f841d48fb61e#

Gh1 shares have normal rights
drwxr-xr-x  8 root root   4096 Feb  2 15:10 .
drwxr-xr-x  7 root root   4096 Feb  2 15:57 ..
drwxr-xr-x  6 root root   4096 Feb  2 16:16 .greyhole
drwxrwsr-x  2 root users  4096 Feb  2 15:00 iAmGh1
drwx------  2 root root  16384 Feb  2 14:52 lost+found
drwxrws---+ 6 root users  4096 Feb  2 16:37 oc-admin
drwxrwx---+ 7 root users  4096 Feb  2 16:34 oc-mdean
drwxrws---+ 2 root users  4096 Feb  1 15:07 oc-tmp
root@nfs:/media/1ed3d629-11cf-4b94-be26-6231cfe8893c#

data user folder point to samba locally mounted shares
drwxrwx---+  3 www-data www-data   4096 Feb  2 17:25 .
drwxr-xr-x  11 root     root       4096 Feb  2 15:03 ..
lrwxrwxrwx   1 www-data www-data     20 Feb  2 15:14 admin -> /mnt/samba/oc-admin/
-rwxrwx---   1 www-data www-data    268 Feb  1 15:09 .htaccess
-rwxrwx---   1 www-data www-data      0 Feb  1 15:09 index.html
lrwxrwxrwx   1 www-data www-data     20 Feb  2 15:15 mdean -> /mnt/samba/oc-mdean/
-rwxrwx---   1 www-data www-data     58 Feb  1 15:07 mount.json
-rwxrwx---   1 www-data www-data      0 Feb  1 15:09 .ocdata
-rwxrwx---   1 www-data www-data 187392 Feb  2 17:25 owncloud.db
-rw-r-----   1 www-data www-data   8604 Feb  2 17:25 owncloud.log
drwxrws---+  2 www-data www-data   4096 Feb  1 15:09 owncloud-oc41414766
lrwxrwxrwx   1 www-data www-data     18 Feb  2 15:14 tmp -> /mnt/samba/oc-tmp/
root@nfs:/media/1a89ed0c-663f-4cc7-84fe-f841d48fb61e/oc#

mount_shares_locally changes:

wwwname="www-data"

wwwuid=`id -u $wwwname`
wwwgid=`id -g $wwwname`

/bin/umount -l /mnt/samba/oc-*
        opt2="credentials=/home/${username}/.smb_credentials,uid=${wwwuid},gid=${wwwgid},file_mode=0770,dir_mode=0770,nobrl,hard,_netdev,iocharset=utf8,noserverino,mfsymlinks"
        mount -t cifs -o $opt2 //127.0.0.1/oc-tmp /mnt/samba/oc-tmp
        mount -t cifs -o $opt2 //127.0.0.1/oc-admin /mnt/samba/oc-admin
        mount -t cifs -o $opt2 //127.0.0.1/oc-mdean /mnt/samba/oc-mdean




ownCloud Gh Test


  • Created backup of nfs
  • Added 2 25 gig vdisks
  • added fielsystems Gh1 and Gh2
  • created shares iAMGh1 and iAMGh2
  • Create oc folder on Gh1 (/media/uuid/oc) 
    • mkdir oc
    • chown -R root:users oc
    • chmod 775 oc -R
  • Copies all Data/oc contents to new Gh1//oc
    • cp -R /media/1a89ed0c-663f-4cc7-84fe-f841d48fb61e/oc/* .
    • Make sure to copy hidden files 
    • chown -R www-data:www-data oc
  • Moved Data/oc contents to new Gh1 location
    • cd /media/1a89ed0c-663f-4cc7-84fe-f841d48fb61e
    • mv oc oc.backup
    • rm -R oc
    • ln -s /media/0694a8dc-208e-4da4-b853-3b6f0e5dffae/oc/ /media/1a89ed0c-663f-4cc7-84fe-f841d48fb61e/oc
    • chown -R www-data:www-data oc
  • Move ownCloud data folder
    • cd /var/www/owncloud/
    • cd data
    • rm tmp
    • ln -s /mnt/samba/ownCloud/tmp tmp
  • Update ownCloud config.php
    • cd /var/www/owncloud/config
    • vi config.php
    • change 'datadirectory' => '/media/1a89ed0c-663f-4cc7-84fe-f841d48fb61e/oc/'
    • to 'datadirectory' => '/mnt/samba/ownCloud/

root@nfs:/media/1a89ed0c-663f-4cc7-84fe-f841d48fb61e/oc.backup# ls -la
total 152
drwxrwx---+  5 www-data www-data   4096 Feb  1 17:51 .
drwxr-xr-x  11 root     root       4096 Feb  2 08:59 ..
drwxrws---+  4 www-data www-data   4096 Feb  1 15:09 admin
-rwxrwx---   1 www-data www-data    268 Feb  1 15:09 .htaccess
-rwxrwx---   1 www-data www-data      0 Feb  1 15:09 index.html
-rwxrwx---   1 www-data www-data     58 Feb  1 15:07 mount.json
-rwxrwx---   1 www-data www-data      0 Feb  1 15:09 .ocdata
-rwxrwx---   1 www-data www-data 120832 Feb  1 17:51 owncloud.db
-rwxrwx---   1 www-data www-data      0 Feb  1 15:13 owncloud.log
drwxrws---+  2 www-data www-data   4096 Feb  1 15:09 owncloud-oc41414766
drwxrws---+  2 www-data www-data   4096 Feb  1 15:07 tmp





Sunday, February 1, 2015

root@nfs:/mnt/samba# sudo mount -t cifs -o username='omv',password='die!hard4752',uid='www-data',gid='www-data' //127.0.0.1/ownCloud /mnt/samba/ownCloud
root@nfs:/mnt/samba# ls -la
total 24
drwxr-xr-x 7 root     root     4096 Feb  1 18:03 .
drwxr-xr-x 3 root     root     4096 Feb  1 18:03 ..
drwxr-xr-x 2 root     root     4096 Feb  1 18:03 Movies
drwxr-xr-x 2 root     root     4096 Feb  1 18:03 Music
drwxr-xr-x 1 www-data www-data    0 Feb  1 17:51 ownCloud
drwxr-xr-x 2 root     root     4096 Feb  1 18:03 Photos
drwxr-xr-x 2 root     root     4096 Feb  1 18:03 Videos
root@nfs:/mnt/samba#

You are mounting the CIFS share as root (because you used sudo), so you cannot write as normal user. If your Linux Distribution and its kernel are recent enough that you could mount the network share as a normal user (but under a folder that the user own), you will have the proper credentials to write file (e.g. mount the shared folder somewhere under your home directory, like for instance $HOME/netshare/. Obviously, you would need to create the folder before mounting it).
An alternative is to specify the user and group ID that the mounted network share should used, this would allow that particular user and potentially group to write to the share. Add the following options to your mount: uid=<user>,gid=<group> and replace <user> and <group> respectively by your own user and default group.
sudo mount -t cifs -o username=${USER},password=${PASSWORD},uid=<user>,gid=<group> //server-address/folder /mount/path/on/ubuntu

Can I move a single disk from one esxi to another esxi server?


Assuming that ESXi isn't installed on the disk in question, then yes, you should be able to simply install the disk in the new server. If you don't see it immediately, you may need to go to the Configuration tab for the host and choose "rescan" or "Add Storage". Of course, whatever you do, don't format the existing storage again, or you'll lose the data on it. You will probably have to browse the datastore and add the VMs you want to inventory, but it should be a pretty painless process.

http://serverfault.com/questions/293240/can-i-move-a-single-disk-from-one-esxi-to-another-esxi-server

Saturday, January 31, 2015

System is setup using OMV  and Gh with 3 Gh drives.
Gh1 300Gig, Gh1 200Gig and Gh1 200Gig,
A Small 10 Gig filesystem with a single share called Data is used for the smb shares.

Soft links (ln -s) point to the Gh landing zones on Gh1 (Movies, Music, Photos,...)

ln -s /media/uuid(Gh)/Movies  /media/uuid(Data share)/Movies
ln -s /media/uuid(Gh)/Music  /media/uuid(Data share)/Music


ln -s /media/uuid(Gh)/Photos /media/uuid(Data share)/Photos

Test1) Remove Gh2 and see what happens...

[Seagate Barracuda ST2000DM001] NFS/NFS_3-000002.vmdk
can't be moved because it is inclued in snapshots (crap)
moved it to another Vitural Device Node (SCSI (0:9))
Everything worked fine... OMV moved it to /dev/sde1

Veeam Backup whole system
Restore to new location
remove snapshots of restored VM