A new way to transfer files between different operating systems using TAR or DD

Source: Internet
Author: User
Tags file size file system backup

There are a number of ways to transfer files between different operating systems. If the network is available, you can use FTP, SFTP, NFS, SAMBA (CIFS), HTTP, and so on, and if the network is not working, you can use a file system that is supported by two operating systems, such as floppy disks, CDs, or the most commonly used FAT file systems. , you can also use backup devices that are supported by two operating systems, such as tape backups (strictly speaking, hardware-dependent file systems based on common support).

But now I have a xenix system that's getting a lot of trouble: the network does not work (may be I will not, hehe), Mkdev DOS also not support, trying to mount a Msdos file system is not successful, and there is no tape drive equipment, data volume is also very large, floppy backup is not too reliable.

The system is already very old, the customer has scrapped the system, but the data inside want to be copied out, migrated to the new system (the new system should be now mainstream windows\linux or UNIX, incoming files are not a big problem).

I took over, encountered a lot of problems, the system can not boot, hard disk damage, etc., later, although all resolved (the resolution process later have the opportunity to record), but the copy file really embarrassed me.

A good way to do this is to write a file system interpreter (similar to a driver), which can be cumbersome, and require in-depth research into the underlying structure of the file system. I have done this, but after all, the applicability is poor, a bit overqualified. Let's not talk about this, see another way: using all operating systems for HDD IO compatibility, use DD or tar directly on the naked device for file transfer:

DD is a program that makes byte-full input and output to the device.

Tar is a backup/package/compression program.

For ease of operation, I finished the task under the virtual machine.

1, the original data hard disk linked to a new virtual machine environment, in the virtual machine environment to build a flat hard disk (when the creation of the full space of the hard disk, the size of the hard disk should be slightly larger than the sum of the exported data), start the XENIX system (this system and hardware is not very

2, after the implementation of Mkdev HD to the new hard disk automatic Mknod, division does not matter. When finished, get the new hard drive device path through ls/dev/rhd* and Fdisk-f/dev/rhdxxx.

3, the data migration.

The first method:

With DD if= the file to be backed up of=/dev/rhdxxx can copy the file to the/dev/rhdxxx hard drive, hang the hard drive on the system to import the data from the hard disk (which is actually a file under the external operating system, as the virtual machine looks like). Start with Winhex intercept to back up the file size into the destination file.

The second way (you can export a large number of files):

Tar-cvf/dev/rhdxxx/(all the files are packaged out to the/DEV/RHDXXX device), and then the operation of the same, the other system on the interception of data (if it is in the virtual machine, you can directly use tar or RAR files to extract vmdf files, do not need to intercept data)

The third way (combined with the TAR and DD):

TAR-CVF-/| DD Of=/dev/rhdxxx (use pipe operation, same as the second way)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.