Current location - Health Preservation Learning Network - Slimming men and women - How to back up LINODE system for free, save $5 a month and set your own permanent restore point.
How to back up LINODE system for free, save $5 a month and set your own permanent restore point.
LINODE's VPS is favored by many webmasters because of its high cost performance, safe, stable and efficient customer service response. LINODE has paid backup function, which is very easy to use, but paid backup is not necessarily the best, because it is the backup of the whole VPS, and the whole LINODE needs to be restored to the original point. If I just want to restore the system to the restore point and other data are not restored, I'm afraid LINODE's fool backup can't meet this special demand. On the other hand, from the perspective of economics, I recommend you to use my method. There are many disks packed with dd on the Internet, and some of them are backed up by third-party tools, but each has its own shortcomings, either when backing up or when restoring, they are not perfect. Using the following methods, you can make a perfect backup.

Let's have a quick look. LINODE's upgrade plan last year doubled the hard disk capacity, and now it has increased from 24G to 48G. I plan to divide my VPS hard disk space like this, with 4G as the system, 4G as the system backup, 5 12M as SWAP, and the remaining 39.5G for data storage. Whether it is a new VPS or a used VPS. LINODE can be set freely.

It is suggested to use the powerful VPS panel VIRTUALMIN/WEBMIN to complete our work. If it is not installed, or if other VPS panels are installed, the method will be different or very troublesome. This tutorial is aimed at VPS with only 1 system partition and 1 exchange. If there are too many partitions, you can refer to the next tutorial.

As for the previous scheme of 4+4+0.5+39.5=48, we discuss it in two categories. One is that the current disk main partition has used less than or equal to 4G, and the other is that the current disk main partition has used more than 4G.

# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

# How to mount the Linode dashboard?

# Find the configuration file Linodes-> Dashboard-> Configure the configuration file, edit the currently used configuration file, mainly modify the block equipment allocation, and the rest will not be adjusted. Mount the disk you need to use to the corresponding dev. Take this tutorial as an example. The first configuration file is MyCentos 5.6 32-bit configuration file: /dev/xvdacentos 5.6 32-bit diskimage, /dev/xvdbcentos 5.6 32-bit diskdata, /dev/xvdc CentOS 5.6 32-bit Swap. The second configuration file, MyCentOS 5.6 32-bit configuration file backup, can create a new configuration file, CentOS 5.6 32-bit disk image /dev/xvdacopy (backup disk has not been established). /dev/xvdb CentOS 5.6 32-bit disk data, /dev/xvdc CentOS 5.6 32-bit exchange. Save.

# How does the data move?

# Enter the system, mount /dev/xvda /data, and mv all data outside the system to /data.

# How to resize the disk

# lino des-& gt; Dashboard-> Disk image-> CentOS 5.6 32 bit disk data->; Enter a new size-> Save changes

# How to modify and add configuration files?

# Add:lino des-& gt; Dashboard-> Create a new profile modification: linudes-> Dashboard-> edit

# = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

Above 4G: We need to do more than 4G, that is, disk data transmission. To give you an idea, assuming that 7.8(xvda)G is used now, we can first adjust the disk space to 8(xvda)G, divide it into 1 disk partition xvdc with 48-0.5 (xvdb)-8 (xvda) = 39.5g, then move the data in xvda except the system to xdvc, and then simplify it. If you use a large disk, it may move more times.

Less than 4G: Fortunately, the cumbersome steps of moving data are omitted, and the size of the disk xvda is directly adjusted to 4G, and then an xvdc with a disk partition size of 39.5G is established.

Out of personal obsessive-compulsive disorder, fine-tune the disk mount. Same as above: MyCentos 5.6 32-bit Summary: /dev/xvdacentos 5.6 32-bit disk image, /dev/xvdbcentos 5.6 32-bit disk data, /dev/xvdc CentOS 5.6 32-bit exchange. Save.

1、 ? Move user home directories and data.

Here, with the help of VIRTUALMIN/WEBMIN panel, please Baidu for other VPS panels or those without panels.

Mount /dev/xvda /data# Mount xvda to /data.

Mkdir /data/home# creates a new user home directory.

WEBMIN-& gt; System->; Users and groups-> Click on one that is already in/home-> Users who have established their home directories under (only 1 can be selected at a time, please operate by multiple users); User home directory->; directory =/data/home/XXX-& gt; Save.

2, modify the boot automatic mount

Vim /etc/fstab # Modify the corresponding contents according to the Linode dashboard.

3, the finishing touch, copy the disk

lino des-& gt; Disk image-> CentOS 5.6 32 bit disk data->; Copy the image. At this time, a queue will be set up, and you will find an additional copy of CentOS 5.6 32-bit disk image (4096 MB, ext3).

4. Move back to the user's home directory

Ls /home # confirms whether the original home is empty.

Rm -rf /home # Delete the original home page

Ln–s/data/home/home # Create a soft link.

It is best to set the household directory to automatic again.

WEBMIN-& gt; System->; Users and groups-> Click on one that is already in/home-> Users who have established their home directories under (only 1 can be selected at a time, please operate by multiple users); User home directory->; Automatic->; Save.

5. Personality setting

?

Note: At this point, the perfect backup of Linode is introduced here. You can establish a permanent restore point, there is no limit to the restore period, you can make error-free backups, and there is no way to restore. The backup speed can be as high as 80 MB/s, is it very reliable? Interested friends can write a script or make a program through API. Please leave a message if you have any questions or suggestions, and look forward to communicating with you.