Link to home
Create AccountLog in
Linux

Linux

--

Questions

--

Followers

Top Experts

Avatar of NetRock6
NetRock6🇨🇦

Compressing ISO file
Hi ...
I am trying to create an ISO file with grub-mkrescue command and trying to compress the iso file using:
grub-mkrescue --compress=xz
command, but it does not compress the iso file.
Can anyone help to make the ISO compress to max using grub-mkrescue command.

Thanks

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of matrix8086matrix8086🇷🇴

iso format is allready compressed, you cannot compresit anymore

Avatar of NetRock6NetRock6🇨🇦

ASKER

I am creating the ISO .......

Avatar of Zephyr ICTZephyr ICT🇧🇪

Did you try all compression options? xz or auto?

In some version there was an issue with xz, but that's been a while so I imagine it's fixed. Maybe a module that is missing for the compression?

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of NetRock6NetRock6🇨🇦

ASKER

Yes ,,, I tried all the 3 options and no change, all gives the same ISO file size at the end ....

Avatar of Zephyr ICTZephyr ICT🇧🇪

Ok, so what is it exactly you're trying to do? What is the exact command you're trying?

Maybe there's another way to do it...

Avatar of NetRock6NetRock6🇨🇦

ASKER

Here it is:

grub-mkrescue --compress=xz -o NewFile.iso /mnt/cdrom/  /mnt/cdrom/boot/boot.cat

Thanks .... ;)

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Zephyr ICTZephyr ICT🇧🇪

Did you try the command like this:

grub-mkrescue -C=xz -o NewFile.iso /mnt/cdrom/  /mnt/cdrom/boot/boot.cat 

Open in new window


I'll see what else is a possible solution.

Avatar of Gerwin JansenGerwin Jansen🇳🇱

If you create the iso with and without the compression option, is there any file size difference in the file you get?

Avatar of NetRock6NetRock6🇨🇦

ASKER

The original ISO is 600MB and I just recreate it, not adding any files, the new ISO comes to 1GB.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of Gerwin JansenGerwin Jansen🇳🇱

Did a test with grub2-mkrescue, compression is working.

Do you have grub2-mkrescue or grub-mkrescue? Do you have xorriso installed?

Man page of grub-mkrescue does not show the compression option.

[root@localhost tmp]# grub2-mkrescue -o test.iso /dev/sr0
Enabling BIOS support ...
Enabling i386-efi support ...
xorriso 1.4.0 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:test.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 8859m free
Added to ISO image: directory '/'='/tmp/tmp.gDDvjXojMC'
xorriso : UPDATE : 553 files added in 1 seconds
Added to ISO image: file '/sr0'='/dev/sr0'
xorriso : UPDATE : 554 files added in 1 seconds
xorriso : NOTE : Copying to System Area: 512 bytes from file '/usr/lib/grub/i386-pc/boot_hybrid.img'
xorriso : UPDATE :  12.21% done
ISO image produced: 7652 sectors
Written to medium : 7652 sectors at LBA 0
Writing to 'stdio:test.iso' completed successfully.

[root@localhost tmp]# grub2-mkrescue --compress=xz -o test2.iso /dev/sr0
Enabling BIOS support ...
Enabling i386-efi support ...
xorriso 1.4.0 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:test2.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 8839m free
Added to ISO image: directory '/'='/tmp/tmp.wjKSTNj5n2'
xorriso : UPDATE : 553 files added in 1 seconds
Added to ISO image: file '/sr0'='/dev/sr0'
xorriso : UPDATE : 554 files added in 1 seconds
xorriso : NOTE : Copying to System Area: 512 bytes from file '/usr/lib/grub/i386-pc/boot_hybrid.img'
xorriso : UPDATE :  17.58% done
ISO image produced: 4652 sectors
Written to medium : 4652 sectors at LBA 0
Writing to 'stdio:test2.iso' completed successfully.

[root@localhost tmp]# ls -l tes*iso
-rw-r--r--. 1 root root  9527296 May 29 17:22 test2.iso
-rw-r--r--. 1 root root 15671296 May 29 17:22 test.iso

Open in new window


Avatar of NetRock6NetRock6🇨🇦

ASKER

I use grub-mkrescue have xorriso installed.
Thank you for your help .....

Avatar of NetRock6NetRock6🇨🇦

ASKER

There is also option:

--core-compress=xz

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Gerwin JansenGerwin Jansen🇳🇱

I have only grub2, how is it that you have grub?

Avatar of NetRock6NetRock6🇨🇦

ASKER

.... i do not know why, So,  i need to install the grub2 package ...??

Avatar of Zephyr ICTZephyr ICT🇧🇪

Now why did I not see that? ... I think I need an eye exam ...

Did you mention what Distro you are using? Ubuntu or something else, and what version...

Well, you don't need to install Grub2, but it might work in compressing the ISO, so ...

To upgrade the legacy Grub on Ubuntu you can follow this guide

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of Gerwin JansenGerwin Jansen🇳🇱

I just installed grub2 and related packages and compression is working, easiest would be to use grub2 but we don't know your specific environment.

Avatar of NetRock6NetRock6🇨🇦

ASKER

- For Grub version i get this:
grub-install -V
grub-install (GRUB) 2.02~beta2-9ubuntu1.2


- for grub2-mkrescue I am getting the below error:
grub2-mkrescue: command not found

I Installed latest Ubuntu, version 14
http://www.ubuntu.com/download/desktop

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of NetRock6NetRock6🇨🇦

ASKER

I have;
#xorriso -version
xorriso 1.3.2 : RockRidge filesystem manipulator, libburnia project.

Avatar of Gerwin JansenGerwin Jansen🇳🇱

I've installed all 'grub2' and alike, there was something about tools, let me check for you.

Avatar of Gerwin JansenGerwin Jansen🇳🇱

Try adding: grub2-tools

[root@localhost bin]# xorriso -version
xorriso 1.4.0 : RockRidge filesystem manipulator, libburnia project.

xorriso 1.4.0
ISO 9660 Rock Ridge filesystem manipulator and CD/DVD/BD burn program
Copyright (C) 2014, Thomas Schmitt <scdbackup@gmx.net>, libburnia project.
xorriso version   :  1.4.0
Version timestamp :  2015.05.17.112001
Build timestamp   :  -none-given-
libisofs   in use :  1.4.0  (min. 1.4.0)
libburn    in use :  1.4.0  (min. 1.4.0)
libburn OS adapter:  internal GNU/Linux SG_IO adapter sg-linux
libisoburn in use :  1.4.0  (min. 1.4.0)
Provided under GNU GPL version 3 or later, due to libreadline license.
There is NO WARRANTY, to the extent permitted by law.

Open in new window


Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of NetRock6NetRock6🇨🇦

ASKER

Using grub2 with xorriso 1.4.0 made the same size as the grub. Still the grub2-mkrescue --compress=xz does not work for me ....
Thank you for your quick prompts.

Avatar of Gerwin JansenGerwin Jansen🇳🇱

What do you have in /mnt/cdrom then? On my end it's compressing so only differences I can think of is that I'm running grub2-mkrescue in Fedora and that I don't have your source ISO. Anything special about your source? Can you share?

Avatar of NetRock6NetRock6🇨🇦

ASKER

Since having issue with grub2-mkrescue i migrated to Fedora and then upgraded to "Xorriso 1.4". So, the environment is the same, it must be the source ISO.
Here is the link
According to the Forum, the below command should produce the ISO, but i get errors:
grub-mkrescue -o pve-cd.iso dir-with-cd-data/ -z -r -volid 'PVE' -c boot/boot.cat

Open in new window



Thank you for taking the time ..... ;)

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Gerwin JansenGerwin Jansen🇳🇱

That's a different command than the one you posted before, I tested with the basic one (grub2) with your ISO (mounted at /mnt/cdrom) and compression is working:

[root@localhost tmp]# grub2-mkrescue --compress=xz -o test.iso /mnt/cdrom/
Enabling BIOS support ...
Enabling i386-efi support ...
xorriso 1.4.0 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:test.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 8840m free
Added to ISO image: directory '/'='/tmp/tmp.oHzFwPw1GS'
xorriso : UPDATE : 553 files added in 1 seconds
xorriso : UPDATE : 12500 files added in 1 seconds
xorriso : UPDATE : 23800 files added in 2 seconds
Added to ISO image: directory '/'='/mnt/cdrom'
xorriso : UPDATE : 25669 files added in 3 seconds
xorriso : NOTE : Copying to System Area: 512 bytes from file '/usr/lib/grub/i386-pc/boot_hybrid.img'
libisofs: NOTE : Automatically adjusted MBR geometry to 1018/69/32
xorriso : UPDATE :  0.06% done
xorriso : UPDATE :  0.58% done
xorriso : UPDATE :  2.76% done
xorriso : UPDATE :  4.24% done, estimate finish Fri May 29 18:43:18 2015
xorriso : UPDATE :  4.97% done, estimate finish Fri May 29 18:43:29 2015
xorriso : UPDATE :  5.79% done, estimate finish Fri May 29 18:43:36 2015
xorriso : UPDATE :  6.68% done, estimate finish Fri May 29 18:43:40 2015
xorriso : UPDATE :  7.54% done, estimate finish Fri May 29 18:43:44 2015
xorriso : UPDATE :  8.53% done, estimate finish Fri May 29 18:43:46 2015
xorriso : UPDATE :  9.71% done, estimate finish Fri May 29 18:43:45 2015
xorriso : UPDATE :  10.89% done, estimate finish Fri May 29 18:43:45 2015
xorriso : UPDATE :  12.04% done, estimate finish Fri May 29 18:43:45 2015
xorriso : UPDATE :  12.56% done, estimate finish Fri May 29 18:43:48 2015
xorriso : UPDATE :  12.77% done, estimate finish Fri May 29 18:44:11 2015
xorriso : UPDATE :  12.98% done, estimate finish Fri May 29 18:44:20 2015
xorriso : UPDATE :  13.23% done, estimate finish Fri May 29 18:44:26 2015
xorriso : UPDATE :  13.52% done, estimate finish Fri May 29 18:44:33 2015
xorriso : UPDATE :  14.46% done, estimate finish Fri May 29 18:44:29 2015
...
xorriso : UPDATE :  95.64% done, estimate finish Fri May 29 18:44:16 2015
xorriso : UPDATE :  96.15% done, estimate finish Fri May 29 18:44:16 2015
xorriso : UPDATE :  96.77% done, estimate finish Fri May 29 18:44:16 2015
xorriso : UPDATE :  97.31% done, estimate finish Fri May 29 18:44:17 2015
xorriso : UPDATE :  98.17% done, estimate finish Fri May 29 18:44:17 2015
xorriso : UPDATE :  98.96% done
xorriso : UPDATE :  99.48% done
xorriso : UPDATE :  99.76% done
ISO image produced: 561743 sectors
Written to medium : 561743 sectors at LBA 0
Writing to 'stdio:test.iso' completed successfully.

[root@localhost tmp]#

Open in new window


The resulting test.iso file is about 1.1G - when you look at the compress option, it states it's compressing the grub files, so maybe it's not meant to compress the whole ISO after all.

Avatar of NetRock6NetRock6🇨🇦

ASKER

Thanks for trying out.... But that's the case the ISO file is at 640gb... So what can I do to get the same size not 1.1 GB after creating an ISO .... I need to add bigger files so I can create an ISO files.... The files i am going to add is 3 . 6GB.... Any idea how to do this.... Really appreciated

Avatar of NetRock6NetRock6🇨🇦

ASKER

How the ISO is compressed to almost 640GB from 1.1GB...
maybe there is another utility needs to be used after creating the ISO?

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of NetRock6NetRock6🇨🇦

ASKER

I Tried the "ISOMASTER" version here:
Version 1.3.13


It works alright to create an ISO size, as the source, but when i try the new ISO, it boots up , after making the selection at the first menu i get this error:
chroot: can not execute /sbin/unconfigured.sh execute format error

We tired with another expert to solve this but we could not, maybe you can have a look please.

Thank for your time.

Avatar of Gerwin JansenGerwin Jansen🇳🇱

Not much time today but did you try whether the 1.1Gb ISO is booting properly? I'd want to know what are the contents of that 1.1G ISO and how they compare to the original ISO you posted the link about.

Avatar of NetRock6NetRock6🇨🇦

ASKER

Thank you again..
Yes the new ISO works alright, no issues there....
The original and the 1.1 GB ISO all the same in terms of contents ....
Just the way they are created makes the difference in size. ISOMASTER is able to create the same size.
I am trying to find a solution for the ISOMASTER error, since cannot get the comparison down to the original ISO size;
chroot: can not execute /sbin/unconfigured.sh execute format error

Open in new window

If the above error is solved, then all is good!! .....!!

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of NetRock6NetRock6🇨🇦

ASKER

Also, I just noticed there are more recent packages for ISOMASTER for fedora than Ubuntu.
So, maybe the issue has been fixed already .... ;)

Avatar of NetRock6NetRock6🇨🇦

ASKER

Tried ISOMASTER version 1.3.13 but not working ....

Avatar of Gerwin JansenGerwin Jansen🇳🇱

I've been looking at the 2 ISO's and found something I can't really explain. Mounted both as cdrom and cdrom2, cdrom is original:

[root@localhost cdrom]# du -h proxmox/
165M	proxmox/packages
271M	proxmox/
[root@localhost cdrom]# cd proxmox/
[root@localhost proxmox]# du -h *
3.0K	country.dat
165M	packages
512	pve-base.cnt
106M	pve-base.tar
[root@localhost proxmox]# ls -l pve-base.tar 
-r--r--r--. 1 root root 278333440 May 26 18:24 pve-base.tar
[root@localhost proxmox]# 

[root@localhost cdrom2]# du -h proxmox/
167M	proxmox/packages
432M	proxmox/
[root@localhost cdrom2]# cd proxmox/
[root@localhost proxmox]# du -h *
6.5K	country.dat
167M	packages
512	pve-base.cnt
266M	pve-base.tar
[root@localhost proxmox]# ls -l pve-base.tar
-r--r--r--. 1 root root 278333440 May 26 18:24 pve-base.tar
[root@localhost proxmox]# 

Open in new window


On both ISO's the tar file is reported as 278333440 bytes but on the original ISO du reports as 106M?

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of NetRock6NetRock6🇨🇦

ASKER

Thank you for your help ...

Check this link please.

Avatar of NetRock6NetRock6🇨🇦

ASKER

Also, -z option
See this Link
When i try it does not work!

Avatar of gr8gonzogr8gonzo🇺🇸

Stupid question, but have you just tried creating a gzip/ZIP file of the final ISO file?

Do that and look at the final file size of the gzip/zip file. That will tell you whether the ISO file has the capability of being compressed any further.

If the files on the source CD are already compressed for distribution, then chances are you cannot really compress them any further. There IS a limit to it all.

If someone gave you a big box that was stuffed full of crushed cars, and you tried to make a copy of it, your copy wouldn't be able to crush the contents any further than they already are.

Doing the gzip/zip exercise will tell you whether any compression algorithms will actually work for you.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of NetRock6NetRock6🇨🇦

ASKER

Not really... All I am doing uncompressing the ISO file and then compressing the same Files.
to create the same ISO. SO, in your terms, I am taking crush cars and trying to put them on the same box WITHOUT making any changes to the contents. Please note, I am not making any adding/modifications and changes. There is switch/option that increases compress level like  "
-zisofs level=9
"  see here:
http://libburnia-project.org/wiki/zisofs
There is a missing link.... ;)

Avatar of Gerwin JansenGerwin Jansen🇳🇱

So use that -zisofs option and you're done.

Avatar of Gerald ConnollyGerald Connolly🇦🇺

So forcing the compression of something that doesnt compress will result in a bigger output, (the original  + compression overhead), although I wouldnt expect it to be nearly twice as big!

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of NetRock6NetRock6🇨🇦

ASKER

Unfortunately, -zisofs level=9 results in errors. According to the man page the default it is already set as level=9 anyway.
After digging and searching, I found this Link.


So, by using mkzftree --force we can compress all the files but not the boot files.
So, i have compressed the files and then replace the uncompressed boot folder with the other compressed files, created an ISO by using:
grub-mkrescue --compress=xz -o NewFile.iso /mnt/cdrom/  /mnt/cdrom/boot/boot.cat
But I ended up with a black screen and a blinking curser. Before ISOlinux was used to create the bootable ISO, but this practice has been changed to grub on the last release of PROXMOX.

So, anyone can advise what other directory i need to make sure is not compressed so i can have a proper bootable ISO.

This is the link to the original ISO.

Thank you for your QUICK prompt and time.

Avatar of gr8gonzogr8gonzo🇺🇸

Maybe I'm missing something.

You've got the original ISO. It looks like you've either burned it to a CD or mounted it virtually - but either way, you've got the resulting structure in /mnt/cdrom.

Now you're trying to create a new ISO based off of that result. If you have the original ISO, can I ask why you're trying to create a new ISO? Did you change the original ISO in some way that prevents you from using the original ISO, so now you want your new one? Or what's the end purpose here that keeps you from just using the original?

I feel like there's a key piece of information missing here.

Avatar of NetRock6NetRock6🇨🇦

ASKER

It is all clear but let me summarize it for you:
Original ISO size= 664MB
Created a new ISO (with no editing/adding/removing.....etc) =1.1 GB
How can get the same size as the original ISO?
Thanks ....

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Scott FellScott Fell🇺🇸

>Original ISO size= 664MB

Did you create the original ISO or are you reverse engineering?

Avatar of NetRock6NetRock6🇨🇦

ASKER

Hi Scott,
Kindly, take few seconds to go through the above comments. I assure you, you will find all the Answers to your questions, in addition, you will discover where the issue is, especially this comment.
Thank you for your time.

Avatar of NetRock6NetRock6🇨🇦

ASKER

Well, I have only recreated the original ISO without making any changes to it, so, only create the original ISO.
I guess your next question will be  HOW I created it ...... If that is, please see above comments, every single steps have been explained in full....
Thanks

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of gr8gonzogr8gonzo🇺🇸

I have read all the comments and steps, but it is not clear. There may be a language barrier here. Bolding, italicizing, and underlining the text does not really help anything. This is what I understand and/or assume:

1. You have a link to the original ISO, which you did not create. The original ISO is 664 megabytes.

2. It looks like you mounted the original ISO in /mnt/cdrom and you are trying to recreate the ISO from the mounted image.

3. Using grub2-mkrescue to recreate the ISO gives you an ISO file that is 1.1 gigabytes instead of the original size.

4. Using ISOMASTER to recreate the ISO gives you the same file size but gives you an error message when you try to boot it.

You haven't answered several questions:
1. Did the 1.1 gigabyte ISO boot properly?
2. Did you compress the boot files when you tried to create the ISO (this could break the boot-up) ?
3. Did you ever compare the contents of the two .tar files that were different between original and recreated ISO files?

Avatar of NetRock6NetRock6🇨🇦

ASKER

I am sorry if you found the comments are not clear and by bolding ..... etc i tried to show the important matters. i never meant to sound not respectful, if it did sound like that, i am really sorry.

Kindly, see Below for corresponding  answers:

1) YES ... it did boot alright.
2)  Using mkzftree --force, compressed all the files but not the boot directory, I overwrite the compressed boot directory   with the uncompressed one from the original ISO.
3) they are in ISO format not tar. One expert and I have done the diff and found nothing. Later on, I found out that  the original ISO file is created as follows:

A)  the contents is compressed using  mkzftree command But
B) The boot files are not compressed
C) grub2-mkrescue is used to create the ISO format

I am stuck, for very long time now, on the B). trying to find out what else need(s) to be uncompressed like boot directory, so that the ISO can boot ....

Thank you for your time.

Avatar of Gerwin JansenGerwin Jansen🇳🇱

Hi again, I haven't been attending this question a while but from reading all new comments I can't find your reply on gr8gonzo's question as to why you want to recreate the ISO, can you explain what your end goal is here? Thanks.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of NetRock6NetRock6🇨🇦

ASKER

I want to add files to the original ISO.  If the original ISO is more than 700 MB in size, i can not create an ISO anymore, since I will be over 4.7 GB limitation.
>>> Any Idea which directory(s) and  file(s) need to be uncompressed after running  mkzftree command......
Thanks.

Avatar of gr8gonzogr8gonzo🇺🇸

If the original ISO is more than 700 MB in size, i can not create an ISO anymore, since I will be over 4.7 GB limitation.

I don't understand your logic there. If it's 664 megs today and when you recreate it, it comes to 1.1 gigabytes, then you will probably have a similar (or better) ratio. Currently, that's about a 65% ratio. Worst case scenario, the ratio stays about the same and the original ISO would have to be 2.8 gigs before it would be recreated to 4.7 gigs. But that's not even a probable way of how that would play out.

If the original ISO is less than 700 megs today, it's probably going to stay that way in order to be able to burned onto a standard CD. If you want to add files and then burn the result onto a DVD, then you have lots of room to add files.

Regarding the tarballs, I was not talking about the ISOs, but rather the files INSIDE the ISO files - you had listed out an example of pve-base.tar, which had a different size between the original and re-created ISO versions. I was asking if you had done a file listing of the inside of that tarball to see what the difference was. (Maybe it was gzipped but without the .gz extension)

Anyway, it sounds like you might be burning to a DVD data disc instead of a CD, so if that's the case, then why is the 1.1 gig ISO a problem? You said it boots properly.

Avatar of NetRock6NetRock6🇨🇦

ASKER

Alright, It seems that We are going No Where with the details ....

Please answer the following question:

I have an ISO file that can be found here, If I want to recreate a new ISO file without adding/modifying any files and directories into the original ISO, using the below command:

grub2-mkrescue -o newISOfile.iso /mnt/cdrom/  /mnt/cdrom/boot/boot.cat

I will get a bootable NEW ISO file of the Size 1.1 GB, but the original ISO is only 664MB.
and I DID NOT change anything in the original ISO files;

1) WHY?
2) How can i create a new ISO file with the same size .

Thanks

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of NetRock6NetRock6🇨🇦

ASKER

Any help regarding the two Qs, above .....

Thanks.

Avatar of Gerwin JansenGerwin Jansen🇳🇱

Hello eenookami, no problem.

I didn't post any further comments sofar because I did not have an idea until now as to why the new ISO is getting larger than the original. I'm thinking that the decompression is supported by the Linux kernel and that upon mounting, the ISO gets decompressed automatically. Compressing is obviously not handled automatically and is the real cause of the issue here. Maybe grub-mkrescue is not the right utility to do what is requested here and we need to look for another utility like xorriso for example.

Avatar of NetRock6NetRock6🇨🇦

ASKER

Thank you for your kind understanding and support.
Juts want to suggest that grub2-mkrescue uses xorriso by default.
Thank you again for your kind help.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Gerwin JansenGerwin Jansen🇳🇱

Ok, something for you to try. I managed recreating the ISO by compressing the tree first and then recreating the ISO.

- Install zisofs-tools and genisoimage if you haven't already
- mount your ISO using: mount -o loop /mnt/cdrom /path/to/original.iso
- compress that tree to a new location using: mkzisofs /mnt/cdrom /tmp/cdrom_compressed
- create the (compressed) ISO image using: genisoimage -o /tmp/newimage.iso -r -z /tmp/cdrom_compressed

Look at the filesize of newimage.iso, I got 630Mb where the original was 650Mb

Mount the new image to /mnt/cdrom2 and compare the contents to /mnt/cdrom, burn and try booting the new image and let me know your findings.

Avatar of NetRock6NetRock6🇨🇦

ASKER

Thanks for your help.

Could you please review the below step, is not working for me, Thanks
- Compress that tree to a new location using: mkzisofs /mnt/cdrom /tmp/cdrom_compressed

Avatar of Gerwin JansenGerwin Jansen🇳🇱

Looks like I meant mkzftree instead of mkzisofs :)

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of NetRock6NetRock6🇨🇦

ASKER

The ISO i get is not bootable anymore, following your steps.
This exactly as my comment here.

When mkzftree is used, it should not compress the boot section., like the [boot] directory.
So, we can compress all the files but the boot files and grub.

So, as i asked before which directories/Files should not be compressed, to get a bootable ISO?

Thanks.......

Avatar of Gerwin JansenGerwin Jansen🇳🇱

That is why the compressed image is smaller than the original image. Will have to look how we can recognise which files/folders are not compressed on the original image and then just move those over to the compressed folder structure.

I would guess just the /boot folder and the efi.img file in the root folder.

Avatar of Gerald ConnollyGerald Connolly🇦🇺

So it appears the real problem is that the author didnt explain very clearly what his real problem is, although its starting to become clear (i think)

It seems to me that the author wants to take an existing ISO and add/replace some files, but as a first step he has tried to recreate the original ISO so as to test the process, but this is giving him a bigger ISO image than he started with.

Not sure why this is a problem as it still fits on a DVD, but hey!

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of NetRock6NetRock6🇨🇦

ASKER

The problem is that the files that are going to be added to the original ISO are 3.8GB compressed in size. So, i need to have the same size, as the original ISO. I understand that time is very important and never want to waste it. Therefore, could we focus on the making the ISO bootable. I believe we can solve this mystery, if we focus on the real question.
What do you think.....;)
Q:
B) The boot files are not compressed (from my earlier comment).
We need to find out what these files are:  - [boot] directory
Then I found that  /usr/lib/grub/i386-pc/ is part of the boot process.

I am sure  if we can diff the files before and after the uncompress of the original ISO, the files with the same size are the ones not needed to be tree out....

Avatar of Gerwin JansenGerwin Jansen🇳🇱

>> I am sure  if we can diff the files before and after the uncompress of the original ISO, the files with the same size are the ones not needed to be tree out....

The decompress is done in the kernel, so if you're sure that we can diff, how then?

Avatar of NetRock6NetRock6🇨🇦

ASKER

Can We compare the size of each file in the original ISO  VS the NEW ISO (which is created from original ISO).

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of Gerwin JansenGerwin Jansen🇳🇱

That would be the catch - how to compare? If you look at the file size with 'ls -l' you don't see any difference, because the kernel is uncompressing when needed. We would have to find a way to find whether a file has been compressed or not and then decide on moving the file.

Avatar of Gerald ConnollyGerald Connolly🇦🇺

Net rock, I thought you said the 1.1GB image was bootable so what is the problem?

Therefore, could we focus on the making the ISO bootable.

Avatar of NetRock6NetRock6🇨🇦

ASKER

With the size of 1.1GB (let's call it: "base ISO"), I cannot add the 3.7GB of files to it.
The "base ISO" should be  the proper size that I can add the 3.7GB of files to it.
Thanks.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of NetRock6NetRock6🇨🇦

ASKER

Also, following the below:

Install zisofs-tools and genisoimage if you haven't already
- mount your ISO using: mount -o loop /mnt/cdrom /path/to/original.iso
- Compress that tree to a new location using: mkzisofs /mnt/cdrom /tmp/cdrom_compressed
- create the (compressed) ISO image using: genisoimage -o /tmp/newimage.iso -r -z /tmp/cdrom_compressed

Look at the filesize of newimage.iso, I got 630Mb where the original was 650Mb

the newimage.iso has perfect size but it is not bootable....

So...
Therefore, could we focus on the making the ISO bootable.

Avatar of Gerald ConnollyGerald Connolly🇦🇺

You keep going on about not wasting time, But thats the first time you have told us why size matters!!!! its taken us 2 weeks for you to tell us that!!  

Why didnt you tell us that in the first place?

ASKER CERTIFIED SOLUTION
Avatar of Gerwin JansenGerwin Jansen🇳🇱

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of NetRock6NetRock6🇨🇦

ASKER

Hi...
Great work. Finally a bootable ISO....!
However,  I booted from the ISO, clicked on the install.... option in the menu, once, it loads the files into the memory, i get the attached snapshot.
I created an ISO by replacing the [boot] directory and all the files in the root like: COPYING,efi.img.....etc. total of 9 files. Then, used the VM, booted from the ISO file.
BootPROX.png

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of gheistgheist🇧🇪

I do not understand attachment to ISO files.
You made such a perfect screenshot that I doubt you wrote ISO file to a physical DVD. Why not netboot? no squeeking mechanical parts involved....

First you need a bootable disk, there is no place for compression so far - a boot file that reads kernel and mkinitrd from ISO filesystem using BIOS facilities. So far so good - it works for you.
Why you compress boot loader code - I dont know. You save like 10MB compressing initrd and much less before that.

That mkinitrd must contain *ALL* possible CD drive attachment drivers, yours has only support for very old onboard intel PIIX IDE controllers. Not to mention it needs to treat all possible target disks same way.

I assume you manage drivers part and DISABLE compression at all early boot stages.

Now you either need a directory on CD with compressed packages (like centos, debian etc) or do extra leap to mount compressed filesystem image (like Mint or Mandriva or Suse does)

Avatar of Duncan RoeDuncan Roe🇦🇺

I suspect the original conundrum (how the ISO grew from 600MB to 1.1GB) is down to files with "holes" in them.
On copying, unless you take special precautions, the holes get filled in with zeroes.
I have never understood how these holes work - maybe you could google for files with holes or maybe sparse files

Avatar of NetRock6NetRock6🇨🇦

ASKER

Since this Q is getting long...long...
I will close and open up a new one ....
Thank you all for your great comments.

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.

Linux

Linux

--

Questions

--

Followers

Top Experts

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.