[SOLVED] How to extract .bin files in Ubuntu 8.10?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
I have an Cisco IOS image - a bin file, that a want to extract. I manage to do that in Windows with winrar, but i don't know how to do it in Ubuntu 8.10.
In winXP:
Filename before extraction: c3745-adventerprisek9-mz.124-15.T7.bin
Filename after extraction (still a bin file): C3745-AD.BIN
Does anyone know how to extract such a file on Ubuntu?
If the file is actually compressed, you could try using unrar (WIKI).
Most (linux) bin files I encountered are just executable files, most of the time the only thing you need to do before running it is setting the correct permissions (must be able to execute: chmod 750 file.bin).
Yeah...what you say is generally true, i have read allready about that. But still the question remains. How can winrar from windows extract that file type, but his equivalent on Ubuntu cannot?
cosmin@Dell:~$ unrar x Second/Cisco/IOS/3660/c3660-p-mz.122-40.bin
UNRAR 3.80 beta 2 freeware Copyright (c) 1993-2008 Alexander Roshal
Second/Cisco/IOS/3660/c3660-p-mz.122-40.bin is not RAR archive
No files to extract
And i did test more images, all of them can be exatrcted on windows, but not on Ubuntu, or at least i dont know how
Maybe the problem is reverse: Windows should not be able to extract them......
Anyway, what does: file c3660-p-mz.122-40.bin tell you?
Most (linux) bin files I encounter are bash files with a payload inside them, try head -5 c3660-p-mz.122-40.bin. If this is an archive you will see gibberish as output (and possibly a messed up terminal).
Those images are CISCO IOS Images. And a cisco router usually stores them in flash, and at bootup it decompress that image and it loads it in RAM...I use gns3 to emulate this behavior and dont want to waste time and resources on CPU when it decompress every image that it loads up. Thats why i want to decompress them before.
On windows this works great. On linux thow, there are problems. I dont want to quit linux just for that, but i realy need this to work.
Whith head -5 is just some rubbish like you guessed.
cosmin@Dell:~$ head -5 Second/Cisco/IOS/3660/c3660-p-mz.122-40.bin
ELF4��4T 4 (D��������gDD��D�!��D@)�@��`/�
���/�
���T<�g���<��=L<��?P<��$T<��%X<��&\<��'`<��0d<��1h<�
Both the file and head output tell you that this is an (elf) executable. You should be able to execute it. I'm not sure what the executable will do (does the file have a payload? will the payload be extracted? ......).
Did you try to execute it (after a possible chmod 750)?
OK...let me explain to you what is with this images.
Cisco routers needs an operating sistem to work. This operating system, is ussualy compresed into bin images like this: c3745-adventerprisek9-mz.124-15.T7.bin and it is stored in flash. When it boots up, the CPU of the router decompres this image (cat take even minutes depending on size and CPU) and then, the decompressed image which is C3745-AD.BIN is loaded int-o RAM. This is the operating sistem that contains all the implementation of the commands like ping, telnet.
So, for those of you who used GNS3 (a program that can emulate a few Cisco router), you know that for every router in the topology used, the PC must extract and load every routers associated image into RAM - and if that image is uncompressed, first it must decompress it. If you have a topology with, let say 10 routers, times tens of seconds for each image to decompress, you do the math and see how long must i wait for a topology to load.
Like i have already said, it apears that the implementation of WinRar aplication under windows already knows how read and extract those bin images, so i can load the directly int-o ram.
Since i'm not a linux guru (i wish i was) i got a hint and a good reference for this forum, and i hope to get an answer. I dont like to switch to windows just for doing a decompress, and then switch back to linux for everything else.
PS: sorry about my english, it is not my native language.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.