How to Backup a Linux Computer to a Windows Computer Without Losing Permissions
Keep your permissions while backing up from linux to windows
If you are like me, you have two computers at your desk, one linux box, and one windows box. You know that you should backup your files on both computers in case of a hard drive crash. So why not back them up to each other?
Backing up a windows computer to a linux computer is pretty easy. You can just copy the files through ftp. There are no permissions to worry about. Backing up your linux computer to your windows computer while keeping your permissions is more complicated.
To keep your file permissions from your linux computer on a windows computer you have to compress all of your linux files into a tar file. The problem with the tar file is that it takes space. If you don't have lots of extra space on your linux box, then you won't be able to tar everything there, and then ftp it to your windows box. Using the method below, you can tar your files and ftp them in one step, so you don't need any extra hard drive space on your linux computer.
Below is a detailed description of my procedure for backing up my linux computer to my windows computer without losing file permissions.
Step 1: Set up an FTP server on your windows computer
You are going to need a way to transfer files from your linux box to your windows box. For this I used ftp, and more specifically, I used filezilla. You could use any other ftp server if you want, but directions for filezilla are below.
Here is the link to download filezilla.
You want to download the server version, and install it on your computer. When you install, you will have the choice to start the server every time windows boots. For me, I only use the server sporadically, so I choose the manual start options instead of the automatic startup.
Once filezilla is installed you will need to start it by selecting "Start Filezilla Server" on your start menu. Next you will want to configure it by running the "Filezilla Server Interface" from your start menu.
To configure your ftp server go to the "Edit" menu and select "Users". Add on the general page click "add" to add a user like below. This will be the ftp login name you use.
Next you will choose which folders to share by clicking on the "Shared Folders" page as below. Then you enter what directory you want to be your ftp directory. To the right of the Shared folders, I choose to allow all permissions for the ftp site. If you are behind a firewall this should be ok temporarly (but don't leave it up). If you are not behind a firewall then this will not be secure.
Ok, your ftp server is set up. To test it you can ftp to it by typing "ftp://127.0.0.1" in your web favorite browser. You can replace the 127.0.0.1 with your computer's ip address. (You will need to know your windows computer's IP address later anyway.) If you don't know your computer's ip address then you can type in "ipconfig" in the "Command Prompt". The command prompt is under "Accessories" in Windows XP.
Be sure to stop filezilla's server when you are finished.
Step 2: Get and Run Knoppix
OK, you have your ftp server running, now it is time to get ready to backup ALL of your files.
If you were to simply log onto your linux box an start transferring files, then you wouldn't be able to get all of them. This is because in a working operating system, so files will be in use. To get around this problem I use Knoppix.
Knoppix is an entire operating system on a cd or dvd. When you boot from a knoppix cd it runs as the operating system (OS) on your computer until you restart your computer, and your computer's native OS is not touched.
To get Knoppix started you need to:
1. Download Knoppix
2. Burn it to a CD or DVD.
3. Put the burned CD or DVD into your linux computer.
4. Restart the linux computer.
5. At the command prompt press enter to boot knoppix, or type in knoppix.
You should see something like below.
Sometimes the default options don't work for everyone on knoppix. I had to use the command line:
knoppix xmodule=vesa noswap
Here is more info on knoppix options.
Backup Your Files
OK, now the fun part. It is time to backup all of those files. Here are the steps.
1. Mount your linux hard drives
You could do this from the command prompt, but the easiest way is to click on the hard drives shown on your desktop. They will say something like "hde1" or "hda2", etc. All of these drives are your linux hard drive partitions. An error message may pop up, but it always mounts them.
2. Find tar
Tar is the program in linux that will compress all of your files into one file for transfer. You will need to know it's location. To do this, open a terminal and type:
It should give you tar's location.
3. Connect through FTP to your windows computer.
To start ftp type:
sudo ftp 192.168.1.100 21
Replace "192.168.1.100" with the ip address of your windows box. If you don't know it's ip address you can use ipconfig as explained above.
4. Backup your files
To zip and transfer your files in one step you can use the following lines while connected through ftp:
put |"sudo /bin/tar -cvlO /media/hde7" stuff.tar
The binary line sets the ftp program to binary mode instead of text mode.
The second line tells tar to compress the files, and ftp to send them to the windows computer. (Keep the quotes). You will need to modify this line. The nice thing about doing this in one line is that the large compressed file does not get saved on your linux hard drive before transfer.
First, replace "/bin/tar" with the location of your tar found in step 2.
Next, replace "/media/hde7" with the location of your hard drives. They will all be in the media directory, and will start with hd. They are the ones listed on your desktop. You will have to back each partition up individually.
Finally, replace "stuff.tar" with whatever you want to call the new backup file that will be saved on your windows box.
Congratulations, you have backed up all of your files.
Frequently Asked Questions
Not a long list so far because not many have frequented.
How can I look at my backed up linux files on my windows computer?
I personally use 7 zip to view the files from windows. This can also be a good way to verify your files were transferred properly.
What if I can't open my files in windows?
It is probably because you didn't use the binary command. You will need to back up the files again.
A Little More Info About My Computers
I don't know what spec requirements there are for this process, so I though I would give info about my computers just in case people want to know.
The Windows Box:
OS: Windows XP Professional Service Pack 3
Processor: Overclocked Athlon MP 2800+
Backup Software: Mozy
The Linux Box:
OS: Mandriva Linux 2007 (yea I know I need to upgrade)
Processor: Celeron 1.4GHz
Motherboard: Asus P2B-F with Powerleap adapter for the processor. (old, but still going strong)
More by this Author
TDS3000B Series oscilloscope from Tektronix What is an oscilloscope? An oscilloscope is a piece of test an measurement equipment for measuring time varying voltages Can I measure currents with an oscilloscope? Yes,...
No comments yet.