folder size restriction

If you need some help, this should be the first place to look.

Postby dingetje » Thu Jul 10, 2003 6:18 pm

The next howto has been posted by ubiquity and confirmed to be working on at least FREESCO 0.3.2 by TeCuMSeH
Original thread is <a href='' target='_blank'>here</a>

Required is <span style='color:red'>e2fsprogs</span> package, available for both 0.2.7 and 0.3.x.

Don't know if this will help since this request is quite old but just an FYI:
(Moderator, maybe this should be moved to a FAQ section)

you can create a folder with a restricted size as follows

let's say you want the folder to only hold 100MiB.? Do the following:

create the container
dd bs=1024k count=100 < /dev/zero > your_container_file_path

map the container to a loop device
losetup /dev/loop0 your_container_file_path

format the loop device (get the e2fsprogs package)
mke2fs /dev/loop0

mount the loop device
mount /dev/loop0 your_desired_mount_point

Freesco 0.27 only comes with two loop devices (loop0 and loop1).? If you need more, create them with mknod.
mknod loop2 b 7 2

After the container(s) is created, you can edit your rc_user to mount and unmount the device.
make sure to losetup before the mount and losetup -d after the unmount.
any loop devices created will not survive a reboot so place your appropriate mknod in rc_user, too.

(Moderator, maybe this should be moved to a FAQ section)

Done :) Although this is maybe more one for the knowledge base...

[rambling mode on]
Knowledge base?
Do we have a KB?
We used to...
Where is it?
Dunno :(
[rambling mode off]

"Software is like sex: it's better when it's free." - LINUS TORVALDS
User avatar
Posts: 1010
Joined: Wed Nov 14, 2001 12:13 pm
Location: The Netherlands

Return to FAQ - Frequently Asked Questions

Who is online

Users browsing this forum: No registered users and 1 guest