Merge two ISO images of CentOS 6.8, centos6.8

Source: Internet
Author: User

Merge two ISO images of CentOS 6.8, centos6.8

Merge two ISO images of CentOS 6.8

 

1. Create related directories:

[root@local ~] mkdir -p /mnt/dvd1 /mnt/dvd2 /mnt/dvd3 /mnt/iso

Note:

/Mnt/dvd1 and/mnt/dvd2 are used to mount the two original image ISO files of Centos6.8.

/Mnt/dvd3 merged image file storage directory

/Mnt/iso creation no.: storage directory of the ISO Image

Note: The disk space of the/directory is sufficient. Because I have not enough disks, add the disk/dev/sdd and mount it to/mnt/iso.

2. Mount two original Centos image files

[Root @ local ~] Mount/dev/sr0/mnt/dev1 #/dev/sro for the original image CentOS-6.8-x86_64-bin-DVD1 [root @ local ~] Mount/dev/sr1/mnt/dev2 #/dev/sr1 for original mirror CentOS-6.8-x86_64-bin-DVD2

3. Copy an object

First, copy all the files from the first DVD (CentOS-6.8-x86_64-bin-DVD1) to the/mnt/dvd3 directory and then, copy only all RPM files in the Packages directory of the second DVD to the/mnt/dvd3/Packages directory, because the second DVD (CentOS-6.8-x86_64-bin-DVD2) cannot be used as the boot disc, so you only need to run the RPM file.

[root@local ~] cp -av /mnt/dvd1/* /mnt/dvd3[root@local ~]  cp -v /mnt/dvd2/Packages/*.rpm /mnt/dvd3/Packages/

4. Merge TRANS. TBL

Append the TRANS. TBL information in DVD2 to the end of TRANS. TBL in DVD1, and sort and save the information.

[root@local ~] cat /mnt/dvd2/Packages/TRANS.TBL >> /mnt/dvd3/Packages/TRANS.TBL[root@local ~] mv /mnt/dvd3/Packages/{TRANS.TBL,TRANS.TBL.BAK}[root@local ~] sort /mnt/dvd3/Packages/TRANS.TBL.BAK > /mnt/dvd3/Packages/TRANS.TBL[root@local ~] rm -rf /mnt/dvd3/Packages/TRANS.TBL.BAK

Dvd3 is a merged file and can be used as a local source and ISO.

5. Back up the original YUM configuration file

[root@local ~] mkdir /etc/yum.repo.d/repo.bak[root@local ~] cp /etc/yum.repo.d/*.repo /etc/yum.repo.d/repo.bak

6. generate a new YUM configuration file

[root@local ~] vim /etc/yum.repos.d/base.repo[base]name=basebaseurl=file:///mnt/dvd3gpgcheck=0

7. Update YUM Source

[root@local ~] yum clean all[root@local ~] yum upgrade

8. Pack/mnt/dvd3/as ISO

[root@local ~] mkisofs -l -J -L -r -V "CentOS-6.8-x86_64" -o /mnt/iso/CentOS-6.8-x86_64-DVD.iso /mnt/dvd3

 

Note: Due to my limited level, the created ISO file can only be used as a yum source and cannot be used as a boot disc !!

 

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.