{"id":88,"date":"2009-12-12T20:52:10","date_gmt":"2009-12-13T01:52:10","guid":{"rendered":"http:\/\/wukenny.host-ed.net\/?p=88"},"modified":"2009-12-12T20:52:10","modified_gmt":"2009-12-13T01:52:10","slug":"backup-linux-hard-driver-image","status":"publish","type":"post","link":"http:\/\/kennywu.info\/?p=88","title":{"rendered":"Backup Linux Hard driver image"},"content":{"rendered":"<p>Linux does not restrict you from copying anything so use TAR to archive all files in one directory. (next time I will try Ghost)<\/p>\n<p><strong>1: Backing-up<\/strong><br \/>\n<code>sudo su<\/code> [become a super user]<br \/>\n<code>cd \/<\/code> [ mvoe to the root directory)<br \/>\n<code>tar cvpzf backup.tgz --exclude=\/proc --exclude=\/lost+found --exclude=\/backup.tgz --exclude=\/mnt --exclude=\/sys \/<\/code><br \/>\n[c: to create a new archive; v: print verbose info on screen; p:preserve permissions'(to keep the same permissions on everything the same); z for file compress, it might not be a good idea to compress files, use it for non critical applicatons. f: file name]<br \/>\n[make sure you don&#8217;t include the file itself, or else you&#8217;ll get weird results. You might also not want to include the \/mnt folder if you have other partitions mounted there or you&#8217;ll end up backing those up too. Also make sure you don&#8217;t have anything mounted in \/media (i.e. don&#8217;t have any cd&#8217;s or removable media mounted). Either that or exclude \/media.]<br \/>\n[At the end of the process you might get a message along the lines of &#8216;tar: Error exit delayed from previous errors&#8217; or something, but in most cases you can just ignore that.]<\/p>\n<p><strong>2: Restoring<\/strong><br \/>\nMake sure you are root and that you and the backup file are in the root of the filesystem.<br \/>\nWARNING: this will overwrite every single file on your partition with the one in the archive!<br \/>\n<code>tar xvpfz backup.tgz -C \/<\/code><\/p>\n<p><strong>3: Re-create the directories that were excluded:<\/strong><\/p>\n<ul>\n<li> mkdir proc<\/li>\n<li> mkdir lost+found<\/li>\n<li> mkdir mnt<\/li>\n<li> mkdir sys<\/li>\n<li> etc&#8230;<\/li>\n<\/ul>\n<p>And when you reboot, everything should be the way it was when you made the backup!<\/p>\n<p><strong>4: GRUB restore<\/strong><br \/>\nIf you installed windows or your GRUB was damaged. then<\/p>\n<ol>\n<li>Pop in the Live CD, boot from it until you reach the Desktop.<\/li>\n<li>Open a terminal window or switch to a tty.<\/li>\n<li>Type &#8220;grub&#8221;<\/li>\n<li>Type &#8220;root (hd0,6)&#8221;, or whatever your harddisk + boot partition numbers are (my \/boot is at \/dev\/sda7, which translates to hd0,6 for grub).<\/li>\n<li>Type &#8220;setup (hd0)&#8221;, ot whatever your harddisk nr is.<\/li>\n<li>Quit grub by typing &#8220;quit&#8221;.<\/li>\n<li>Reboot.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Linux does not restrict you from copying anything so use TAR to archive all files in one directory. (next time I will try Ghost) 1: Backing-up sudo su [become a super user] cd \/ [ mvoe to the root directory) &hellip; <a href=\"http:\/\/kennywu.info\/?p=88\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-88","post","type-post","status-publish","format-standard","hentry","category-lamp"],"_links":{"self":[{"href":"http:\/\/kennywu.info\/index.php?rest_route=\/wp\/v2\/posts\/88","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/kennywu.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/kennywu.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/kennywu.info\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/kennywu.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=88"}],"version-history":[{"count":0,"href":"http:\/\/kennywu.info\/index.php?rest_route=\/wp\/v2\/posts\/88\/revisions"}],"wp:attachment":[{"href":"http:\/\/kennywu.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=88"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/kennywu.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=88"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/kennywu.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=88"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}