Sepiola AbklärungenMigration

From Sepiola Wiki
(Difference between revisions)
Jump to: navigation, search
(ID 1.2)
(ID 1.2)
Line 178: Line 178:
  
 
*Right click on the received file and open properties -> Security:
 
*Right click on the received file and open properties -> Security:
 
+
[[Images:Received.png||400px]]
<gallery>
+
File:Received.png
+
</gallery>
+
  
 
*'''On Windows the Security entries are different from each other. But under cygwin the outcome form getfacl is the same.'''
 
*'''On Windows the Security entries are different from each other. But under cygwin the outcome form getfacl is the same.'''

Revision as of 15:13, 18 July 2016

Contents

Übersicht

Diese Seite Dokumentiert die Abklärungen zur Cygwin Migration. Dazu werden die relevanten Tests, welche unter Sepiola Backup dokumentiert sind wiederholt. Das Ziel ist es die Zuverlässigkeit von cygwig, rsync und openssh unter Windows zu testen.

Set Up

Die dokumentierten Tests wurden mit folgendem Set Up erstellt:

  • Operationssystem: Windows 10 Enterprise (64 Bit)
  • Cygwin Version: 2.5.2(0.297/5/3)
  • Rsync Version: 3.1.2
  • OpenSSH Version: OpenSSH_7.2p2, OpenSSL 1.0.2h 3 May 2016

Tests

ID Task Mandatory Tested on Status Comment Validator
1.2 Das Hochladen und Restoren von Dateien und Verzeichnissen mit unterschiedlichen Berechtigungen(Acls). Es muss möglich sein alle Berechtigungen zu lesen und zu schrieben. NOT RELEVANT FOR GO/NO GO (ACLs are set independently from ssh/rsync) --Michael (talk) 16:08, 18 July 2016 (CEST) x 2016-07-18 OK poe
1.23 The Acl's shouldn't change when copy files using rsync. NOT RELEVANT FOR GO/NO GO (ACLs are set independently from ssh/rsync) --Michael (talk) 13:31, 18 July 2016 (CEST) 2016-07-12 OK poe
1.3 Die Applikation soll das Handling mit speziellen Dateien erlauben z.B mit Symlinks und .Ink files (upload und restore). x 2016-07-13 OK poe
1.14 Backup muss auch mit einer hohen Anzahl von Dateien möglich sein. Getestet wurden 10000 .txt files. x 2016-07-12 OK poe
1.15 Die Metadaten müssen korrekt geschrieben/erstellt werden damit ein sauberes Restore möglich ist. x 2016-07-18 OK poe
1.24 Grosse Dateien (langandauernder Transfer) müssen fehlerfrei übertragen werden. (tbd)
x 2016-07-12 OK poe
A Unter Windows erstellt der VolumeShadowCopy Service Snapshots. Diese Snapshots müssen in Cygwin zur Verfügung stehen (mount) und via rsync übertragen werden.
x 2016-07-12 OK poe
B Deploy cygwin isolated form a prior installed version. (Phase 1) open poe

Test cases

ID 1.2

Under cygwin, it is possible to read and write ACL's using getfacl and setfacl.

  • Create a file e.g. myFile.txt (using the Windows explorer) and run getfacl myFile.txt under cygwin.
philippoehler@Kangama /cygdrive/c/Users/philippoehler/sepiola_Tests/ACL
$ getfacl myFile.txt
# file: myFile.txt
# owner: philippoehler
# group: BBV+Group(513)
user::rwx
group::---
group:SYSTEM:rwx                        #effective:rw-
group:Administrators:rwx                #effective:rw-
mask:---
other:---
  • Right click on this file and choose Properties -> Security

Security orig.png

  • Store the acl's in a new file:
$ getfacl myFile.txt > aclList.facl
  • Upload both files to the server:
 rsync -av --delete myFile.txt aclList.facl 4000351@kvm-0003.stepping-stone.ch:incoming
  • Restore both files in a separate folder (e.g. received):
 rsync -av --delete 4000351@kvm-0003.stepping-stone.ch:incoming/ received
  • Print the ACL's from the received file (myFile.txt) using getfacl:
philippoehler@Kangama /cygdrive/c/Users/philippoehler/sepiola_Tests/ACL/received
$ getfacl myFile.txt
# file: myFile.txt
# owner: philippoehler
# group: BBV+Group(513)
user::rwx
group::r-x                              #effective:---
group:SYSTEM:rwx                        #effective:rw-
group:Administrators:rwx                #effective:rw-
mask:---
other:---

  • getfacl applied on the received file generates the same outcome as getfacl applied on the original file.
  • Remove all entries and restore the original ACL's:
philippoehler@Kangama /cygdrive/c/Users/philippoehler/sepiola_Tests/ACL/received
$ setfacl --remove-all myFile.txt

philippoehler@Kangama /cygdrive/c/Users/philippoehler/sepiola_Tests/ACL/received
$ getfacl myFile.txt
# file: myFile.txt
# owner: philippoehler
# group: BBV+Group(513)
user::rwx
group::r-x
other:---

  • Restore the entries form the original file:
philippoehler@Kangama /cygdrive/c/Users/philippoehler/sepiola_Tests/ACL/received
$ setfacl -f aclList.facl myFile.txt

philippoehler@Kangama /cygdrive/c/Users/philippoehler/sepiola_Tests/ACL/received
$ getfacl myFile.txt
# file: myFile.txt
# owner: philippoehler
# group: BBV+Group(513)
user::rwx
group::---
group:SYSTEM:rwx                        #effective:rw-
group:Administrators:rwx                #effective:rw-
mask:---
other:---

  • Right click on the received file and open properties -> Security:

|400px

  • On Windows the Security entries are different from each other. But under cygwin the outcome form getfacl is the same.

ID 1.3

A symlink should be synchronized as symlink itself and not as resolved target.

  • The VSS snapshot contains a symlink to /cygdrive/c/Users. Synchronize this symlink using rsync:
 rsync -vaP --delete Documents\ and\ Settings  4000351@kvm-0003.stepping-stone.ch:incoming
  • Restore the symlink and test if it works correctly.

Same behavior with .Ink files instead of symlinks (when creating a shortcut, Windows creates a .Ink file).

ID 1.14

Ein Verzeichnis enthält eine grosse Menge an Files und muss synchronisiert werden können.

  • Mit einem bash Skript 10000 .txt Files erzeugen:
#/bin/bash
echo deleting all .txt files in directory
rm -rf *.txt
echo done
echo creating files started
for i in {0..10000}
do
    echo hello > "$i.txt"
	
	if (($i % 1000 == 0))
	then
		echo $i "files created"
	fi
done
echo done 
  • Das gesamte Verzeichnis hochladen: rsync -av --delete source/ 4000351@kvm-0003.stepping-stone.ch:incoming

ID 1.15

Read file information in cygwin, using stat:

$ stat myFile.txt
  File: 'myFile.txt'
  Size: 0               Blocks: 0          IO Block: 65536  regular empty file
Device: ae520afeh/2924612350d   Inode: 1407374883767413  Links: 1
Access: (0700/-rwx------)  Uid: (1050746/philippoehler)   Gid: (1049089/BBV+Group(513))
Access: 2016-07-18 09:50:50.450934900 +0200
Modify: 2016-07-18 09:43:29.427192800 +0200
Change: 2016-07-18 09:57:45.150250300 +0200
 Birth: 2016-07-18 09:50:50.448643200 +0200


ID 1.23

Windows to Windows

It is possible to keep the user rights after a local copy using rsync.

  • Create a new file userRights.txt in a local directory.
  • Edit the user rights -> add user and set some strange Permissions.
  • Copy the file into another folder: rsync -vaP UserRights_source/userRights.txt UserRights_destination/
  • rsync can't handle the permissions correctly! When open the Security tab (inside Properties) this message appears:
"The permissions on userRights.txt are incorrectly ordered, which may cause some entries to be ineffective". 
  • Under cygwin, the permissions didn't change:

outgoing:

-rwxrwx---+ 1 philippoehler Domain Users 0 Jul 13 13:18 UserRights.txt

incoming:

-rwxrwx---+ 1 philippoehler Domain Users 0 Jul 13 13:18 UserRights.txt

Windows to incoming

ID 1.24

Grosse Dateien (bis zu 3GB) können ohne Unterbruch und Fehlermeldung hochgeladen werden.

  • Ein 3GB File in cygwin erstellen: fsutil file createnew test3GB.txt 3221225472
  • Übertragung eines files mit 3GB: rsync -vaP Source/test3GB.txt 4000351@kvm-0003.stepping-stone.ch:incoming


ID A

Die Snapshots, welche vom VolumeShadowCopy Service erzeugt werden, müssen unter cygwin gemountet sein.

  • Manuelles erstellen eines "restore points" (Snapshot) unter Windows.
  • Dieser Snapshot ist dann über diesen Pfad erreichbar: /proc/sys/Device/HarddiskVolumeShadowCopy1/

philippoehler@Kangama /proc/sys/Device
$ cd HarddiskVolumeShadowCopy1/
philippoehler@Kangama /proc/sys/Device/HarddiskVolumeShadowCopy1
$ ls
'$Recycle.Bin'    BOOTNXT                   HashiCorp     MSOCache      'Program Files'        Qt        swapfile.sys                 Temp    vagrantTrys
autounattend.xml  cygwin64                  hiberfil.sys  pagefile.sys  'Program Files (x86)'  Recovery  sysprp_autounattend.bat      ubuntu  VirtualBoxVMs
bootmgr           'Documents and Settings'  Intel         PerfLogs      ProgramData            SVN       'System Volume Information'  Users   Windows

rsync of snapshot files

  • Go to the directory: /proc/sys/Device/HarddiskVolumeShadowCopy3/Temp and rsync the file inside.
rsync -vaP --delete VSS.txt  4000351@kvm-0003.stepping-stone.ch:incoming

Potential problems

  • Cygwin supports symlinks. When using the ls command, cygwin interprets a file ('Documents and Settings') as a symlink to /cygdrive/c/Users. The user should choose if he would resolve the symlink or not --> (todo)is rsync able to handle or resolve symlinks ??? -->> YES it is: (ID 1.3)


  • rsycen von HarddiskVolumeShadowCopy1 -> Probleme mit den Berechtigungen (ID 1.2)

ID B

If there is already a cygwin instance installed, sepiola should be able to install its instance isolated from the other one.

Weitere Überlegungen und Notizen

  • Windows ist im NTFS Fileformat. Die Berechtigungen können wahrscheinlicht nicht auf ein anderes Filesystem kopiert werden (auf dem Ziel nichtt bekannt -> kommen nicht mit rsync)
    • Ja, deshalb werden auch die MetaDaten in einer separaten Datei mitgeben (oder mehreren, weiss es nicht mehr so genau). Diese Informationen werden auch für den Restore benötigt. --Michael (talk) 21:36, 12 July 2016 (CEST)
      • Unter Linux hast gibt es:
        • metadata_unix
      • Diese befinden sich jeweils unter incoming/<SERVER>/.sepiola_backup
      • Dort gibt es auch noch:
        • backupContent
        • backupEnded.xml
        • backupStarted.xml
        • backupTime
        • metadata_unix
        • scheduler.xml
  • AlternativeFileStreams -> Diese Informationen kommen wahrscheinlich nicht mit rsync mit! (bei standard copy in windows aber auch nicht)
  • Kopieren von geöffneten files -> snapshot
  • Deploy cygwin isolated. This could may be a problem if another instance of cygwin is already installed.

Inhalt von metadata_unix

# file: //home/
# owner: root
# group: root
# mode: 0755
user::rwx
group::r-x
other::r-x

# file: //home/eichi/
# owner: eichi
# group: eichi
# mode: 0755
user::rwx
group::r-x
other::r-x

# file: //home/eichi/.expect.rc
# owner: eichi
# group: eichi
# mode: 0600
user::rw-
group::---
other::---

...
...
Personal tools
Namespaces

Variants
Actions
Navigation
Wiki
sepiola.org
Toolbox