View previous topic :: View next topic |
Author |
Message |
Sheri255 n00b
Joined: 15 Apr 2006 Posts: 29
|
Posted: Fri May 04, 2007 3:30 pm Post subject: Change block size on tmpfs |
|
|
I'm using sessions on a tmpfs drive, and I see that my files are 4 KiB in size, although none of them are bigger then 100 bytes, so my question is, is it possible to change the block size of the tmpfs mountpoint to about 128-256 bytes instead, so that i can save (lots of) space there?
edit: Problem (kind of) solved. I had a security script that saved everybodies IP in sessions, to make sure they weren't hijacked. I changed the scripts so that the IP was only to be saved if there were other data in the session. Empty files doesn't fill a block, still, i loose 3.9 KiB on every logged in person, so I'd be happy for a better solution. (changing block size) |
|
Back to top |
|
|
moondog n00b
Joined: 24 May 2007 Posts: 1
|
Posted: Thu May 24, 2007 4:45 pm Post subject: |
|
|
This may be way too much work to accomplish what you wish, but would this work for you?
Make a directory for your tmpfs
Make a small tmpfs for testing
Code: | mount -t tmpfs tmpfs -o size=100M |
Create a blank file which uses this space. You could probably use a better bs and count so that it doesn't waste as much space 1M.
Code: | dd if=/dev/zero of=/mnt/tmpfs/fs.img bs=1M count=99 |
Associate a loop device with our fs.img file
Code: | losetup /dev/loop7 /mnt/tmpfs/fs.img |
Apply your file system to your loop device. In this example I chose ext2 with a 1K block size but you could use any fs really.
Code: | mke2fs -b 1024 /dev/loop7 |
Create a directory to mount the filesystem on our loop device
Mount our loop device
Code: | mount /dev/loop7 /mnt/ext2 |
It shouldn't matter what the block size of /mnt/tmpfs is as it is used by one fs.img container file. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|