LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-30-2010, 08:00 PM   #1
Gibzon
LQ Newbie
 
Registered: Nov 2010
Posts: 5

Rep: Reputation: 0
Question increase a file size?


hi, i have this directory with multiple images 'pics' and the size is 20mb, and i want to make a .zip or .rar package of this directory but with an increased size so the .zip/.rar file will be 100mb, and then when you extract it the file size is the original 20mb.

can i do this? thanks for the help.
 
Old 11-30-2010, 09:52 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,340
Blog Entries: 12

Rep: Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730
I just tested this with a directory I have with about 28 megs in it. Using the Nautilus right-click-->create archive-->zip menu choice, I zipped it into a zip that was slightly less than 28 megs.

I've used compressed files for years, but this is truly unusual. No solutions, but three ideas for testing:

1. This is a wild guess, but have you looked at the folder contents with "view hidden files" turned on and verified that there are no hidden files in there? (But even hidden contents should show up the folder size).

2. If you point to the archive in a file manager, right click, and select "view archive" or the equivalent from the menu, do you see anything in there that doesn't belong?

3. Have you tried creating a tar.gz compressed file from the command line. Here's the command syntax with a link to a nice explanation:

tar -zcvf archive_name.tar.gz directory_to_compress

Good luck.
 
Old 11-30-2010, 10:14 PM   #3
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
It sounds like you want the zip file to be 100 MB. Is that correct? Zip and rar are supposed to make the archive file smaller than the sum of the original files.
 
Old 11-30-2010, 11:39 PM   #4
Gibzon
LQ Newbie
 
Registered: Nov 2010
Posts: 5

Original Poster
Rep: Reputation: 0
it is correct, i want to make the result file bigger, no compress it.

i need to put all the directory in one single file .zip or .rar but it has to weight more (100mb), maybe it can be done with another aplication...

by the way, i have a centos 5 from command line.

i know is odd but i need to do this :/

Last edited by Gibzon; 11-30-2010 at 11:42 PM.
 
Old 12-01-2010, 01:10 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Can you explain why, then we'd be able to give you an appropriate answer?

Last edited by chrism01; 12-01-2010 at 11:23 PM.
 
Old 12-01-2010, 06:19 PM   #6
Gibzon
LQ Newbie
 
Registered: Nov 2010
Posts: 5

Original Poster
Rep: Reputation: 0
i think this wasn't the right forum, it's not a newbie question, any moderator can move this thread to general linux?

i explained what i need to do and there must be a way to do this because someone i know is doin it but he doesn't want to tell me how :/
 
Old 12-01-2010, 06:50 PM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
OK, I have tested that and it is rather simple.
Let's say you have compressed your images with rar and the resulting file, i.E. images.rar, is 20MB in size. That means, to get a file, that has a size of 100MB we have to add 80MB to that file.
The command to do that is :
Code:
dd if=/dev/zero bs=1M count=80 | cat >> images.rar
This will push 80 1MB-blocks with zeroes through the pipe to the cat command, which will send them to stdout. With the >>-redirector we will append them to our rar-file.
And see, we will have a rar that is 100MB in size.
If you unrar it, the extraction command will simply ignore the added zeroes.

I just wonder what purpose this should have?
 
Old 12-01-2010, 07:09 PM   #8
gd2shoe
Member
 
Registered: Jun 2004
Location: Northern CA
Distribution: Debian
Posts: 835

Rep: Reputation: 49
I tried tacking extra empty space on the end of a zip file, but the unzip utility didn't like it. I did something like this:
Code:
(cat somefile.zip; cat if=/dev/zero) | dd bs=1M count=100 > otherfile.zip
Sure this creates a separate file, but it also allows you to specify precisely how big you want it. Again, zip didn't seem to like this, but if TobiSGD is correct, then rar might work ok.

I also wouldn't be too hasty to dismiss using a hidden file to inflate a zip archive:
Code:
dd if=/dev/urandom bs=1M count=100 > .hidden_random_file
Note that random data doesn't compress very well (usually not at all). The leading dot on the filename is what makes it hidden on a Linux system.
 
Old 12-01-2010, 07:11 PM   #9
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
TobiGSD's idea also works fine with gzip - no complaints on extraction, and a very large silly archive when done creating it.
 
Old 12-02-2010, 12:04 AM   #10
Gibzon
LQ Newbie
 
Registered: Nov 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TobiSGD View Post
OK, I have tested that and it is rather simple.
Let's say you have compressed your images with rar and the resulting file, i.E. images.rar, is 20MB in size. That means, to get a file, that has a size of 100MB we have to add 80MB to that file.
The command to do that is :
Code:
dd if=/dev/zero bs=1M count=80 | cat >> images.rar
This will push 80 1MB-blocks with zeroes through the pipe to the cat command, which will send them to stdout. With the >>-redirector we will append them to our rar-file.
And see, we will have a rar that is 100MB in size.
If you unrar it, the extraction command will simply ignore the added zeroes.

I just wonder what purpose this should have?
i tested this with rar and it works!!! thank you very much TobiSGD!

i needed this for uploading to a filehost in wich i need my files to be 100mb minimum.
 
Old 12-02-2010, 07:20 AM   #11
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by Gibzon View Post
i tested this with rar and it works!!! thank you very much TobiSGD!

i needed this for uploading to a filehost in wich i need my files to be 100mb minimum.
Thanks for the update, and especially for telling us WHY you needed this - the WHY might be just the detail that makes this thread helpful for others who are in the same boat, but to whom it has not occurred to artificially enlarge the archive.

Cheers! And, if/when the issue is solved to your satisfaction, please remember to mark the thread [SOLVED] using "Thread Tools" menu near the top of the thread, if you have not yet done so. That'll help others find the thread if they search specifically for solved threads.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Increase size of file formatted as ext3 ( Details inside! ) chesss Linux - General 4 05-06-2009 06:21 AM
How to increase file uploading size in sendmail/postfix bkcreddy17 Linux - Server 2 10-22-2008 01:28 PM
file size increase schamana AIX 5 09-18-2007 03:44 PM
how to find size increase most file or folder? jimmyjiang Linux - Server 1 07-16-2007 11:47 PM
increase root file system size superraylo Linux - Hardware 5 05-29-2006 02:40 AM


All times are GMT -5. The time now is 02:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration