Miralinux Blog

  • Home
  • Linux
    • Scripts
    • CentOS
  • Apple
  • Microsoft
    • Features
    • Office
    • Windows
  • Learning
  • Games
  • Multimedia
    • XBMC
  • Other
    • About WordPress
  • Links
    • General
    • Software
      • Autocad
    • Hardware
      • BIOS
    • Linux
    • WiKieS

Monthly Archives: August 2010

Backup and restore your linux system!

Posted on 2010/08/25 by arno Posted in Linux, Uncategorized

Howto: Backup and restore your system!
Hi, and welcome to the Heliode guide to successful backing-up and restoring of a Linux system!

Most of you have probably used Windows before you started using Ubuntu. During that time you might have needed to backup and restore your system. For Windows you would need proprietary software for which you would have to reboot your machine and boot into a special environment in which you could perform the backing-up/restoring (programs like Norton Ghost).
During that time you might have wondered why it wasn’t possible to just add the whole c:\ to a big zip-file. This is impossible because in Windows, there are lots of files you can’t copy or overwrite while they are being used, and therefore you needed specialized software to handle this.

Well, I’m here to tell you that those things, just like rebooting, are Windows CrazyThings ™. There’s no need to use programs like Ghost to create backups of your Ubuntu system (or any Linux system, for that matter). In fact; using Ghost might be a very bad idea if you are using anything but ext2. Ext3, the default Ubuntu partition, is seen by Ghost as a damaged ext2 partition and does a very good job at screwing up your data.

1: Backing-up

“What should I use to backup my system then?” might you ask. Easy; the same thing you use to backup/compress everything else; TAR. Unlike Windows, Linux doesn’t restrict root access to anything, so you can just throw every single file on a partition in a TAR file!

To do this, become root with
Code:

sudo su

and go to the root of your filesystem (we use this in our example, but you can go anywhere you want your backup to end up, including remote or removable drives.)
Code:

cd /

Now, below is the full command I would use to make a backup of my system:

Code:

tar cvpzf backup.tgz –exclude=/proc –exclude=/lost+found –exclude=/backup.tgz –exclude=/mnt –exclude=/sys /

Now, lets explain this a little bit.
The ‘tar’ part is, obviously, the program we’re going to use.

‘cvpfz’ are the options we give to tar, like ‘create archive’ (obviously),
‘preserve permissions'(to keep the same permissions on everything the same), and ‘gzip’ to keep the size down.

Next, the name the archive is going to get. backup.tgz in our example.

Next comes the root of the directory we want to backup. Since we want to backup everything; /

Now come the directories we want to exclude. We don’t want to backup everything since some dirs aren’t very useful to include. Also make sure you don’t include the file itself, or else you’ll get weird results.
You might also not want to include the /mnt folder if you have other partitions mounted there or you’ll end up backing those up too. Also make sure you don’t have anything mounted in /media (i.e. don’t have any cd’s or removable media mounted). Either that or exclude /media.

EDIT : kvidell suggests below we also exclude the /dev directory. I have other evidence that says it is very unwise to do so though.

Well, if the command agrees with you, hit enter (or return, whatever) and sit back&relax. This might take a while.

Afterwards you’ll have a file called backup.tgz in the root of your filessytem, which is probably pretty large. Now you can burn it to DVD or move it to another machine, whatever you like!

EDIT2:
At the end of the process you might get a message along the lines of ‘tar: Error exit delayed from previous errors’ or something, but in most cases you can just ignore that.

Alternatively, you can use Bzip2 to compress your backup. This means higher compression but lower speed. If compression is important to you, just substitute
the ‘z’ in the command with ‘j’, and give the backup the right extension.
That would make the command look like this:

Code:

tar cvpjf backup.tar.bz2 –exclude=/proc –exclude=/lost+found –exclude=/backup.tar.bz2 –exclude=/mnt –exclude=/sys /

2: Restoring

Warning: Please, for goodness sake, be careful here. If you don’t understand what you are doing here you might end up overwriting stuff that is important to you, so please take care!

Well, we’ll just continue with our example from the previous chapter; the file backup.tgz in the root of the partition.

Once again, make sure you are root and that you and the backup file are in the root of the filesystem.

One of the beautiful things of Linux is that This’ll work even on a running system; no need to screw around with boot-cd’s or anything. Of course, if you’ve rendered your system unbootable you might have no choice but to use a live-cd, but the results are the same. You can even remove every single file of a Linux system while it is running with one command. I’m not giving you that command though!

Well, back on-topic.
This is the command that I would use:

Code:

tar xvpfz backup.tgz -C /

Or if you used bz2;

Code:

tar xvpfj backup.tar.bz2 -C /

WARNING: this will overwrite every single file on your partition with the one in the archive!

Just hit enter/return/your brother/whatever and watch the fireworks. Again, this might take a while. When it is done, you have a fully restored Ubuntu system! Just make sure that, before you do anything else, you re-create the directories you excluded:
Code:

mkdir proc
mkdir lost+found
mkdir mnt
mkdir sys
etc…

And when you reboot, everything should be the way it was when you made the backup!

2.1: GRUB restore
Now, if you want to move your system to a new harddisk or if you did something nasty to your GRUB (like, say, install Windows), You’ll also need to reinstall GRUB.
There are several very good howto’s on how to do that here on this forum, so i’m not going to reinvent the wheel. Instead, take a look here:

http://www.ubuntuforums.org/showthre…t=grub+restore

There are a couple of methods proposed. I personally recommend the second one, posted by remmelt, since that has always worked for me.

Well that’s it! I hope it was helpful!
As always, any feedback is appreciated!
__________________
“Windows is something to overcome”

Howto’s by me:
Tweak firefox! (URL now works..)
Backup/Restore your system!
Avoid having to reboot

Compentux.org , the Linux Tip & Howto gathering initiative!
Last edited by aysiu; November 29th, 2006 at 12:15 AM.. Reason: Moved slash to end of command by popular vote
source: http://ubuntuforums.org/showthread.php?t=35087

Linux

iPhone tweak call history size

Posted on 2010/08/21 by arno Posted in Uncategorized

iPhone 3GS iOS 3.1.3

/var/mobile/Libary/CallHistory/call_history.db

There is a record in this sqllite database called “call_history_limit” which is set to 100, change it in what you need.
I changed it into 3000, it can slow down your history listing.

Apple iPhone

Windows XP IPC$ ADMIN$ C$ administrative shares

Posted on 2010/08/19 by arno Posted in Uncategorized

How to hide

The administrative shares can be deleted by a user with Administrators membership but the administrative shares will be recreated automatically at the next reboot.
The following registry configuration change e.g. using Regedit can completely hide all administrative shares. If the setting is not present then you must create it.

Servers – Windows NT 4.0 Server, 2000 Server, Server 2003
Hive: HKEY_LOCAL_MACHINE
Key: SYSTEM\CurrentControlSet\Services\LanManServer\Parameters
Name: AutoShareServer
Data Type: REG_DWORD
Value: 0

Clients – Windows NT 4.0 Workstation, 2000 Professional, XP
Hive: HKEY_LOCAL_MACHINE
Key: SYSTEM\CurrentControlSet\Services\LanManServer\Parameters
Name: AutoShareWks
Data Type: REG_DWORD
Value: 0

source: http://en.wikipedia.org/wiki/Administrative_share

Microsoft

Enable 32 Bit transfer in BIOS IDE setting?

Posted on 2010/08/15 by arno Posted in Uncategorized

quote:
32-bit mode with respect to IDE refers to transfers that occur over the PCI bus to the host system memory. PATA is limited to reading 16-bit chunks of data at a time from a drive. If you enable 32-bit mode, the controller will be set to temporarily store the data from one read until the data is available from the next read before mastering a transfer over PCI. So it can collapse two transactions on the IDE side of the controller to one transaction on the PCI side of the controller.

SATA doesn’t require a mode like this. It could be said that it’s always running in 32-bit mode, I guess — basically SATA transfers data in serialized packets across the interface to the drive and the controller will just buffer the data until it has enough to send across the PCI bus. There is no need to enable this specifically with a SATA controller.

source: http://hardforum.com/showthread.php?t=1287459

Quote:
Hey guys, according to everything that i can research about the whole 32-bit setting in some bios’s, its kinda a joke because the whole sata channel is a 16×2 stepping transfer, when you turn on the 32 bit transfer it in a way simulates 32 bit, and as someone said, once you get to you OS of choice it takes over.

As a little info to people who dont know, you can go under device manager in the control panel, and pull up the device SATA or depending on how old your machine is, IDE controller and check to make sure that your system is designating your drive to the correct UDMA, since this is what system xp uses to regulate disk access(hence, why it doesnt matter if you tag 32 bit or not). UDMA scales between 1-6(Im fairly sure theres no 0 :> ) and if you are running a sata drive with 3.0 it should be UDMA 6.

The only reason i gave the beginner course in device management is because i have seen a lot of new computers hear lately where xp picked PIO mode, dont know the official reason why, but it seems to happen on newer drives more than mid range drives, in my experience.

Also, even though i have heard from multiple sources it doesnt matter, I always bind my IDE and SATA controllers, mostly because xp associates them as one, and once less process to get to what it needs microscopically must make a difference.

source: http://www.tomshardware.co.uk/forum/149914-12-enable-transfer-bios-setting

  • Login
  • Mother of all Portals
  • .Handy .Handig
  • Links – wikis – wikies

Archives

  • June 2022
  • October 2021
  • June 2021
  • September 2016
  • April 2016
  • March 2016
  • November 2014
  • September 2014
  • August 2014
  • July 2014
  • April 2014
  • March 2014
  • November 2013
  • October 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • February 2013
  • December 2012
  • September 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
CyberChimps ©2025