| Author | Topic: SalineOS backup (Read 1,782 times) |
Anthony Nordquist Administrator
     member is offline
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) Joined: Dec 2010 Gender: Male  Posts: 1,336
|  | Re: SalineOS backup « Reply #15 on Mar 14, 2012, 7:41am » | |
You really must stop all other running applications before preceding with the backup process. Even if the backup process completes with other applications open, the backup file that gets created will be broken when you restore it.
Another thing to note is you cannot save the .backup file to the same partition you select for the option of another Linux instance on the disk.
If you still get that error after running salineos-backup with all other applications closed, let me know and I will write up a patch for it. As it stands I would need to make at least a dozen patches to have it run "safely" with other applications running, and even then it really wouldn't be safe. I can't account for every possible application that a user maybe installed and running at the time the backup is run.
If you test the restoration process, you need to launch salineos-backup with the command /usr/bin/salineos-backup.
| |
|
ukbrian Senior Member
    member is offline
Joined: Aug 2011 Gender: Male  Posts: 285
|  | Re: SalineOS backup « Reply #16 on Mar 14, 2012, 4:56pm » | |
Wow!! Still getting my head around what it does, nice concept. I've taken hours writting this post so it might jump around a bit.
Question What is the easiest way to download files from https://github.com/SalineOS/SalineOS I clicked on "Downloads" at top right but it was empty so I copied/pasted the text on the page. 
I added Yad and created a launcher for SalineOS-backup, I like the name instead of remastersys or snapshot/installer etc., SalineOS-backup will look good on the menu of other Debian distros, you need an icon for it, a small safe or something like that.
It ran straight off and I did a backup of my new salineos install.
I disconnected the 2 symbolic links in my home dir for my data partition and NAS drive and then ran salineos-backup.
Screen 1 I think I would remove the "Choice" line.
"Create a backup image of this SalineOS instance" If installed on a different OS might be "Create a backup image of this system" or "Create a backup image of this HOSTNAME system" and "Create a backup image of another Linux system"
I pressed the "down" key twice before the first line was highlighted. I would default to the first line being highlighted when the screen loads.
Looking at the screen again I wonder if the "Please select the blah, blah" line is needed.
It looks like you have left plenty of room there for adding other options, is it possible to create an iso from the backup or directly so you have a "Create ISO" option.
Screen 2 My second HDD wasn't mounted or visible I had to quit and run gigolo for somewhere to put my backups.
Screen 3 Use "HOSTNAME_%Y-%m-%d-%H-%M" as the default where HOSTNAME is the hostname of the OS being backed up so the files are well sorted in the backup folder. I really didn't like the %h or Mar.
I user this string in the script "ImageName=SalineOS_$(date +%Y-%m-%d-%H-%M)" And I got a file name of "SalineOS_2012-03-14-15-35"
How about if user enters "SalineOS" in text field and the time gets appended to the end.
It surprised me when I pressed "Time" and it started backing up, I expected an "OK" I think
Screen 4 "Please close all other running applications before continuing" Maybe add "and don't start anything else until this one finishes" for thick folk like me. 
Is it possible to lock/disable the mouse/keyboard while the backup is running.
I had Richard's error on the next screen and I made a screen capture which upset things. 
As well as that error I'm getting 8, 6 then 12 lines of backing up different OS's "awk: close failed on file /dev/stdout (Broken pipe)"
Instead of "Quit" on the final screen, maybe "Finished" or "Completed".
Is it possible to have "Your backup took ?? minutes. or Backup image Imagename Saved at /media/solusos/home/user/salineos-backups Time taken ?? minutes
After backing up my SalineOS install I then made a successful backup of my SolusOS partition and then successfully installed it into a new partition.
I guess what we are seeing is your new SalineOS 2.0 installer, I've only run it once and I got confused on the swap screen so I'll have a good play with the installer tomorrow.
Time wise I think backup is twice the speed of qt-fsarchiver which zipped its files
SalineOS 7.8GB sda2 backed up to sda3 an NTFS data partition in 6 minutes size 5.2 GB SalineOS 7.8GB sda2 backed up to sdb3 an ext4 partition in 5 minutes SalineOS 7.8GB sda2 backed up to external USB 2 sata in 6 minutes That's mega fast! to a USB 2 drive
When I tried to a 32GB Corsair USB 2 stick I got this error 25% in first message "Write on destination failed because file to large" Silly me, wet error, the sticks formatted fat32.
maybe it should check the media the user selects or not display unsuitable media
Enough for one very enjoyable day, sorry about winging so much, I do like perfection.
Very, very impressed, a very useful tool for any Debian user that's going to be about for a long time.
Your installer might become the standard debian installer.
Interesting concept installable files, tomorrow I'll try an install from a backup to a different machine.
How about an "About" button that puts a screen up with your home url, help url and forum url
Anthony's the MAN, well done sir.
| |
|
Richard Elder Member
     member is offline
![[avatar] [avatar]](http://dl.dropbox.com/u/10332409/bender.gif)
Joined: Jan 2011 Gender: Male  Posts: 586 Location: Venezuela
|  | Re: SalineOS backup « Reply #17 on Mar 14, 2012, 5:46pm » | |
Suggestion for naming backups: please use or offer saving in iso standard date format: SalineOS-backup-20120315.1816.backup
|
SalineOS-1.7, Xfce4.6.2, w/ 3.2.0-0.bpo.4-686-pae; SalineOS-2.0, Xfce4.8, w/ 3.2.0-4-686-pae Fedora-18, Xfce4.10, w/ 3.8.x
|
|
Anthony Nordquist Administrator
     member is offline
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) Joined: Dec 2010 Gender: Male  Posts: 1,336
|  | Re: SalineOS backup « Reply #18 on Mar 14, 2012, 6:15pm » | |
I don't expect your restoration to another physical system to go very well. That use case isn't supported by me officially and there are quite a few issues you could run into that I am just simply not going to fix. I have no intention of ever supporting this, partly because it isn't practical with supporting most modern Linux distributions. The awk errors can be ignored, they aren't important and really can't be gotten rid of. Thankfully, most users will never run this in a terminal and see them Also, the .gvfs error can safely be ignored, it isn't important either.
The idea behind SalineOS backup was to create a very simple and straight forward backup utility, more of a complement to Remastersys backup than an outright replacement. I have no intention of supporting creation of ISO files at this time, I am more likely to jump in and send patches to Fragadelic (Brijeski) Remastersys to make it do everything I and the users of SalineOS want out of such a utility. The three main things SalneOS backup can do that Remastersys can't, is create arbitrarily large backup files, restore the images from an installed system and backup non Debian based distributions. You really can't do both, support non Debian based distributions and support creating live .ISOs ... Well maybe YOU can and if so, you are clearly a better man than I
You are seeing parts of the new installer here, seeing as I wrote the installer code entirely into functions, I simply copy and pasted the functions I needed and modified them as needed one by one. The SalineOS installer is only suitable for Debian Live based systems. Work is being done to port the Linux Mint installer to Debian, and it is likely that work will lead to a new Remastersys installer and possibly a Debian live installer.
| |
|
Richard Elder Member
     member is offline
![[avatar] [avatar]](http://dl.dropbox.com/u/10332409/bender.gif)
Joined: Jan 2011 Gender: Male  Posts: 586 Location: Venezuela
|  | Re: SalineOS backup « Reply #19 on Mar 14, 2012, 8:27pm » | |
Here's a shot of the result: I closed everything, then open a root terminal and ran salineos-backup.
and, I still can't find the resulting *.backup cause it ran out of space.
Says it's out of room and the write failed. Makes sense. I probably need to umount my /data partition. (as ukbrian mentioned) 
 Please login to download attachments. |
SalineOS-1.7, Xfce4.6.2, w/ 3.2.0-0.bpo.4-686-pae; SalineOS-2.0, Xfce4.8, w/ 3.2.0-4-686-pae Fedora-18, Xfce4.10, w/ 3.8.x
|
|
ukbrian Senior Member
    member is offline
Joined: Aug 2011 Gender: Male  Posts: 285
|  | Re: SalineOS backup « Reply #20 on Mar 14, 2012, 9:30pm » | |
Quote:| I probably need to umount my /data partition. |
| I used a symbolic link for my data partition in my home dir in fstabCode:| LABEL=500-data /home/user/500-data ntfs-3g defaults,uid=1000 0 0 |
|
I use "LABEL" as I can use the same line on both my machines but I just comment it out for a backup, I also go into "Session & Startup to uncheck/stop Dropbox and a script that creates a symbolic link for my NAS drive from running.
I just restored a backup onto a different drive on the same machine and got this errorCode:sdb5: No such file or directory /dev/sdb5: LABEL="SWAP" UUID="487bd6d2-f635-43c3-83bb-a7a04c9f920f" TYPE="swap" /dev/sdb6: LABEL="solus-rc2" UUID="de7ec80a-b379-4cdb-ad4d-d3092bfe13c1" TYPE="ext4" /dev/sdb7: LABEL="solus-rc2-xfce" UUID="e6be32f3-83e6-492e-8885-bcfa20aca508" TYPE="ext4" /dev/sda1: LABEL="500-win7" UUID="A2FAD424FAD3F291" TYPE="ntfs" /dev/sda2: UUID="1781a524-dd33-40a6-bcb9-f1b611647271" TYPE="ext4" LABEL="saline-1.6" /dev/sda3: LABEL="500-data" UUID="35F9800C70369E1C" TYPE="ntfs" /dev/sda4: UUID="17497b87-44af-4118-b4c6-7a871640abbc" TYPE="swap" /dev/sdb8: UUID="5d14d59c-c557-49c3-9ad6-4b5e841318a5" TYPE="ext4" LABEL="solus-copy" /dev/sdc1: UUID="460C-D878" TYPE="vfat" /dev/sdd1: LABEL="1-tb-ext" UUID="7A8CE6DA8CE68FC5" TYPE="ntfs" /usr/bin/salineos-backup: line 236: `$i': not a valid identifier Installation finished. No error reported. Generating grub.cfg ... Found linux image: /boot/vmlinuz-2.6.32-5-686 Found initrd image: /boot/initrd.img-2.6.32-5-686 ls: cannot access /media/1-tb-ext: No such file or directory ls: cannot access /media/1-tb-ext: No such file or directory ls: cannot access /media/1-tb-ext: No such file or directory ls: cannot access /media/1-tb-ext: No such file or directory Found Windows 7 (loader) on /dev/sda1 Found SolusOS RC2 (SolusOS) on /dev/sdb6 Found SolusOS RC2 (SolusOS) on /dev/sdb7 done umount: /Target/home: not mounted |
|
sdb5 is the swap partition on the drive I installed to.
The "/media/1-tb-ext" is the external drive the backup was on.
The fresh install boots up and seems to run OK, SalineOS-Backup is a great tool. 
I was curious so I ran your script on another Debian Stable based distro and that backedup/restored with no problems either.
| |
|
Anthony Nordquist Administrator
     member is offline
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) Joined: Dec 2010 Gender: Male  Posts: 1,336
|  | Re: SalineOS backup « Reply #21 on Mar 14, 2012, 10:21pm » | |
Didn't know I would get so much feedback on the formatting of the time stamp I use for naming. Using the ISO standard for time seems like a good practice though and I will add it. Currently I am testing some patches, so expect a new version up in git here in a little while.
Once I am fairly certain everything works well on Debian systems and I didn't overlook anything I am going to start testing backups on ArchBang. The preferred testing *cough* of my should be cross distribution scripts.
| |
|
Anthony Nordquist Administrator
     member is offline
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) Joined: Dec 2010 Gender: Male  Posts: 1,336
|  | Re: SalineOS backup « Reply #22 on Mar 14, 2012, 11:56pm » | |
A new version is up in git. For those who want to know how to get the latest version easily, simply install git and then open a terminal in a directory of your choice and run this command: git clone https://github.com/SalineOS/SalineOS.git
The entire git repository will be downloaded into its own folder SalineOS, inside the directory you run the command from. The git repository isn't too terribly large so grabbing all of it shouldn't be a big issue. To update your cloned git repository, open a terminal in the SalineOS directory and run: git pull
This will sync your local repository with the master repository (Mine). For more advanced usage of git, you should read the manual. Simply run man git in a terminal.
The time stamp is now very close to the ISO standard. A patch has been added so that when you select another Linux instance, you can save the .backup file to that partition if you so chose. The time taken to run the backup is now displayed on the final dialog.
I would like to note, that anything you have mounted within the root directory of whatever you are backing up will be copied to the backup file. For example if you mount your external drive to /home/username/external-drive this folder and its contents will be copied and compressed inside the .backup file. The exceptions to this are, anything within the /mnt or /media folders, these are excluded from the backup. This will all be documented in the user manual for 2.0. As of right now you can't save the .backup image to another instance's separate home partition, since this is being re-mounted. There are ways around this, I am just mulling over which one of them to use.
| |
|
ukbrian Senior Member
    member is offline
Joined: Aug 2011 Gender: Male  Posts: 285
|  | Re: SalineOS backup « Reply #23 on Mar 15, 2012, 7:52am » | |
The time stamp is now very close to the ISO standard Sorry if I'm keeping on a bit but the file name you save under can make a big difference. if you change the %h for month which gives you "mar" to %m which gives you "03" it would be better.
I agree with Richard's suggestion Quote:Suggestion for naming backups: please use or offer saving in iso standard date format: SalineOS-backup-20120315.1816.backup |
| The method used by qt-fsarchiver was the best and easiest to use I have come across, in Richards case you would type "SalineOS-backup" in the text field and then the timestamp would be appended to the end.
Using this method you could store all your Linux backups in one folder otherwise you would have to use a separate folder for each OS Dream_20120309-1025 Dream_20120314-1225 Dream_20120315-1525 Mint_20120310-1230 Mint_20120312-1530 SalineOS_20120310-1230 SalineOS_20120311-1530 SalineOS_20120315-1730 Solus_20120308-1125 Solus_20120310-1225 Xubuntu_20120310-1230 Xubuntu_20120313-1025 Xubuntu_20120313-1025
I tried to tweak your code to do this but failed miserablyCode:elif [ "$ImageName" > "" ]; then ImageName=ImageName_$(date +%Y%m%d-%H%M)
|
|
back to the dunces class for me and leave the coding to the masters.
edit My install was much larger than I expected and I discovered why, it was the remastersys folder, maybe that could be a candidate for an exclude
After deleting my backup now takes 4/5 minutes
| |
|
Richard Elder Member
     member is offline
![[avatar] [avatar]](http://dl.dropbox.com/u/10332409/bender.gif)
Joined: Jan 2011 Gender: Male  Posts: 586 Location: Venezuela
|  | Re: SalineOS backup « Reply #24 on Mar 15, 2012, 8:05am » | |
OK. Thanks. Using the latest pull. In 8 minutes it was completed yielding a 1.8 GiB .backup. umount'ing my /data did the trick (thanks to Brian & Anthony). The new build also is nicer, for us third-worlders, where everybody uses day-month-year & year-month-day. The iso format "20120315-0734 always sorts correctly. 
Mount the .backup as follows: # mount -o loop -t squashfs /mnt/data/backups/20120315-0734.backup /mnt/tmp and there it is! A browseable, virtual file system. More flexible in this manner than fsarchiver.
Now to rearrange my mounts (repoint them from /data to /mnt/data ).
|
SalineOS-1.7, Xfce4.6.2, w/ 3.2.0-0.bpo.4-686-pae; SalineOS-2.0, Xfce4.8, w/ 3.2.0-4-686-pae Fedora-18, Xfce4.10, w/ 3.8.x
|
|
Anthony Nordquist Administrator
     member is offline
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) Joined: Dec 2010 Gender: Male  Posts: 1,336
|  | Re: SalineOS backup « Reply #25 on Mar 15, 2012, 8:43am » | |
I find that having the month in letters help with readability, less numbers running together. I am failing to see the value in using a number in its' place?
Your placement of code is wrong ukbrian, you need moar quotes and you are missing a $ symbol:
Code:ImageName="$ImageName_$(date +%Y%m%d-%H%M)"
|
|
Place it after the ret if/then statements and not in the middle.
I could make as many buttons for naming conventions as I wanted. I could make a star date button if I really wanted to, but the question is how many are too many? Options can be a bad thing if you have too many of them at once. Using the hostname and the date on a button isn't such a bad idea, but not everyone uses a hostname that is descriptive of the operating system itself. The time button was really just put there in case people wanted to be lazy and not name the backups themselves, I really wasn't planning to cover a whole bunch of pre-scripted names. If the user wants to put an OS name and a date on the file they can simply type it in the box, I am perfectly ok with this solution.
Another update is up in git. I redid the time taken code to use /usr/bin/time instead of taking two date commands and subtracting them, since I realized that the original code would be horribly off if the backup ran across midnight. I also added code so that you could in fact save the .backup file to another instance's separate home partition, instead of outright failing. In this one use case, the folder saved to will be displayed weird, unless the user happened to have the home partition mounted to /other/instances/mount-point/home. I have to mount the separate home partition inside the root partition of the other instance in order to include it in the backup. If the root partition of the other instance is mounted when SalineOS backup starts, I simply use where it is mounted, otherwise I create a custom mount point under /mnt and mount it myself. I also added an information dialog, informing the user that if the other instance's home partition is shared with SalineOS, that he/she will have to run the backup from a live environment. Ideally everyone would put /home on root and everything would be so much easier for writing software like this, but alas I am supporting the hard way too.
| |
|
ukbrian Senior Member
    member is offline
Joined: Aug 2011 Gender: Male  Posts: 285
|  | Re: SalineOS backup « Reply #26 on Mar 15, 2012, 10:28am » | |
Quote:| I am failing to see the value in using a number in its' place? |
| If you make these saves using the letters they sort in the folder in this order, you need to read the months to find the latest SalineOS_2012apr10-1230 SalineOS_2012feb10-1230 SalineOS_2012jan10-1230 SalineOS_2012mar10-1230
With numbers you get oldest at the top, newest at the bottom SalineOS_20120110-1230 SalineOS_20120210-1230 SalineOS_20120310-1230 SalineOS_20120410-1230
Another suggestion that would be very useful is to add another field for notes new field = ImageNoteCode:| ImageName="$ImageName_$(date +%Y%m%d-%H%M)-$ImageNote" |
|
or use Code: Using the existing ImageName field for notes but added at the end of the file name to not change the date sort order.
I love the new screens and I think there was a problem with the first "time taken" routine, I got one that said 45 minutes instead of 5 minutes. 
I still get this error when I restoreCode:/dev/sdd1: LABEL="1-tb-ext" UUID="7A8CE6DA8CE68FC5" TYPE="ntfs" /usr/bin/salineos-backup: line 236: `$i': not a valid identifier Installation finished. No error reported. Generating grub.cfg ... |
|
Safe to ignore I assume.
I've been a bad boy to I installed a backup from one machine into another with no problems. Both machines, desktops, have AMD CPU's one 3 core one 4 core and on board AMD graphics but different motherboards, I only use the standard video drivers .
All apps seem good to me, I got a laptop here I might try it on but first I want to add the code you pasted, thanks for that!, it helps me a great deal, I think the only thing I didn't try was using quotes. Just a silly old fool who likes to play.
| |
|
Anthony Nordquist Administrator
     member is offline
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) Joined: Dec 2010 Gender: Male  Posts: 1,336
|  | Re: SalineOS backup « Reply #27 on Mar 15, 2012, 9:18pm » | |
Actually this /usr/bin/salineos-backup: line 236: `$i': not a valid identifier error is important, and is now fixed in git Thanks for pointing it out. The original time taken code was actually fairly bad, in that it had about a half dozen breaking points, the new code on the other hand should work flawlessly in all situations. I also commited a patch to change the date to use a number for the month.
| |
|
Richard Elder Member
     member is offline
![[avatar] [avatar]](http://dl.dropbox.com/u/10332409/bender.gif)
Joined: Jan 2011 Gender: Male  Posts: 586 Location: Venezuela
|  | Re: SalineOS backup « Reply #28 on Mar 16, 2012, 7:17am » | |
Top down and step-wise: make it work, then make it work correctly. 
Thanks. It really is a neat tool.
|
SalineOS-1.7, Xfce4.6.2, w/ 3.2.0-0.bpo.4-686-pae; SalineOS-2.0, Xfce4.8, w/ 3.2.0-4-686-pae Fedora-18, Xfce4.10, w/ 3.8.x
|
|
ukbrian Senior Member
    member is offline
Joined: Aug 2011 Gender: Male  Posts: 285
|  | Re: SalineOS backup « Reply #29 on Mar 16, 2012, 9:35am » | |
Mar 16, 2012, 7:17am, Richard wrote:Top down and step-wise: make it work, then make it work correctly.  Thanks. It really is a neat tool. |
| What I find amusing/ironic is that out of all the OS's I've run SalineOS is the one that least needs a backup app yet Anthony has created the best Linux backup app I know of, it's very fast with good compression.
Mint LMDE users with their seemingly constant problems would give an arm and leg for this, it would save them a lot of reinstalls. A few use Clonezilla which is very good but there's no GUI for it unfortunately.
| |
| |
|