Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gem - "gentoo manager"
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
McGruff
Tux's lil' helper
Tux's lil' helper


Joined: 28 Dec 2004
Posts: 148

PostPosted: Wed Aug 17, 2011 8:44 pm    Post subject: gem - "gentoo manager" Reply with quote

Gem is a little utility primarily designed to manage "bootable backups". The aim is to be able to recover quickly from an emerge which renders your system unusable in some way. If the cost of failure is low, you're free to experiment with new software and updates.

Gem works by copying /boot and / onto "mirror" partitions. When you run into a software problem, a quick fiddle with grub and a reboot will get you up and running again from the backup in a couple of minutes. You can continue with your work and fix the broken system at leisure with chroot.

Basic usage is:

$ gem sync (copies the current OS, apps and /boot to the backup partitions)
$ gem revert (switch to the backups)
$ gem switch (switch back to the other system - in practice this is just an alias of revert)

See $ gem help for more.

The bootable backups are intended to contain software & configuration only. Data should have its own backup strategy and ideally large data folders will be mounted on discrete partitions. However, gem doesn't enforce this separation and will happily copy anything you tell it to.

Gem does assume that /boot and / are mounted on separate partitions.

-----------------
INSTALLATION

You'll need to create a portage overlay. Open /etc/make.conf and add this line:

PORTDIR_OVERLAY="/opt/underlay"

If you use layman, add the above line before you source layman.

Now run the following commands as root from a terminal. Note that this refers to version 0.1. You'll need to change that to get a later version, when they become available. You can copy-paste this into a bash script if you like:

Code:

    mkdir /opt/underlay

    cd /opt/underlay
    wget http://ccgi.mcgruff.plus.com/~mcgruff/public/gem/gem-0.1-ebuilds.tar.bz2

    tar xjf gem-0.1-ebuilds.tar.bz2

    ebuild /opt/underlay/app-admin/gem/gem-0.1.ebuild manifest
    ebuild /opt/underlay/app-misc/bashfun/bashfun-0.1.ebuild manifest
    # EITHER:
   
    echo app-admin/gem ~x86 >> /etc/portage/package.keywords
    echo app-misc/bashfun ~x86 >> /etc/portage/package.keywords

    # OR:
   
    #echo app-admin/gem ~amd64 >> /etc/portage/package.keywords
    #echo app-misc/bashfun ~amd64 >> /etc/portage/package.keywords

    emerge -av gem


Now open /etc/gem/config.sh and follow the instructions.

Finally run gem help to see a list of commands:

$ gem help

When gem runs it will try to check for an improper config file. It can't detect everything you could possibly do wrong though.

Any problems or comments let me know.

I've long thought that this, or something like it, should be built in to portage so that we have an easy way to revert back to a working OS. Is this the way to do it?
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2151

PostPosted: Thu Aug 18, 2011 12:00 am    Post subject: Reply with quote

Would you please provide me with a situation, where this would be useful? I can't quite see, how this would be - much - better, than just using quickpkg?!
_________________
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
Back to top
View user's profile Send private message
McGruff
Tux's lil' helper
Tux's lil' helper


Joined: 28 Dec 2004
Posts: 148

PostPosted: Thu Aug 18, 2011 12:33 am    Post subject: Reply with quote

Before doing an emerge, or building a new kernel, you would use gem to backup OS & apps. Now, if something gets broken, you can quickly revert to the last working system. If you've got work to do, you can put the emerge problems to one side and deal with them when you have some free time. You're guaranteed never to have any downtime no matter how badly your system is broken.

That's not bad :)
Back to top
View user's profile Send private message
Rion
Guru
Guru


Joined: 12 Oct 2006
Posts: 376
Location: Ekaterinburg, Russia

PostPosted: Thu Aug 18, 2011 2:55 am    Post subject: Reply with quote

ruby package manager? O_o

http://en.wikipedia.org/wiki/RubyGems
_________________
~amd64
rion-overlay
Back to top
View user's profile Send private message
McGruff
Tux's lil' helper
Tux's lil' helper


Joined: 28 Dec 2004
Posts: 148

PostPosted: Thu Aug 18, 2011 4:12 pm    Post subject: Reply with quote

Thanks didn't know that.

As far as I know, "gem" is a free package name but I guess I'll need to change the terminal command name. Maybe "gm" will be OK. Will need to look into that.
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Thu Aug 18, 2011 4:55 pm    Post subject: Reply with quote

What does it use? demerge?
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Back to top
View user's profile Send private message
McGruff
Tux's lil' helper
Tux's lil' helper


Joined: 28 Dec 2004
Posts: 148

PostPosted: Thu Aug 18, 2011 5:42 pm    Post subject: Reply with quote

Bash scripts and rsync.

I hadn't heard of demerge until now... :oops: Will need to look into that.

A couple of things spring to mind though. Demerge couldn't help if the system was completely unbootable. Also, it's good to have a separate copy to fiddle with in a chroot if the problem is hard to track down and might take a while.

For example, I recently couldn't startx after an emerge -uND world. I switched to the backup disks, and got on with all my day-to-day stuff as normal. When I had some spare time, I mucked about with the broken OS in a chroot and eventually got it sorted out after a few days.
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2253
Location: $TERM

PostPosted: Fri Oct 07, 2011 4:23 am    Post subject: Reply with quote

This should be made official.
_________________
My blog
Back to top
View user's profile Send private message
McGruff
Tux's lil' helper
Tux's lil' helper


Joined: 28 Dec 2004
Posts: 148

PostPosted: Fri Oct 07, 2011 2:15 pm    Post subject: Reply with quote

I'd really like to see this, or something like it, added to portage. It's incredibly convenient to be able to switch between two working OS's when something goes wrong.

$ emerge -auND world

8O .....something important is broken

$ emerge --switch

8) ...up and running again after booting into the other working OS

I'll post the latest ebuild soon. I've added in a couple of extra features including a command to build a new kernel.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum