Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
12-05-2010, 12:10 AM
|
#1
|
Member
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271
Rep:
|
default size of a newly created folder
Hi all,
I just want to know how the default size of a newly created file or folder is 4.0 kb.
Does this value is mentioned in any configuration file,if that is the case can we edit that file and can we change this default value.
please post your suggestions.
Thanks in advance,
Dinesh.
|
|
|
12-05-2010, 12:53 AM
|
#2
|
Bash Guru
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852
|
Why? What would be the purpose of doing such a thing?
I would assume that the size is due to there being a minimal amount of data necessary to define a directory node. At the very least each directory must contain . and .. links, for example.
My guess, if it's even possible, is that you'd have to look deep into the specifications and source code of the *nix file structure definitions in order to change anything about it.
|
|
1 members found this post helpful.
|
12-05-2010, 01:05 AM
|
#3
|
Member
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271
Original Poster
Rep:
|
Hi,
Thanks for your reply,my purpose is, i have to create a folder by mentioning its size for ex: 2gb or something instead of using disk quota for that.
|
|
|
12-06-2010, 05:25 AM
|
#4
|
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339
|
Hi,
David is right: the size you see is the space needed for the inode information (this can be adjusted when you format a partition with the option -i and -I to mke2fs, but this it not what you want at all). The used up space by a directory can be checked with du -sh the_directory.
Even quotas won't help, as they limit the space per user and mountpoint, not per directory.
What about creating a special partition for such purpose with LVM, which has just the intended size?
|
|
1 members found this post helpful.
|
12-06-2010, 07:31 AM
|
#5
|
Member
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271
Original Poster
Rep:
|
hi,
Actually my doubt is if we can create a file by specifying its size using this command.
dd if=/dev/zero of=filename bs=1024 count=10240
do we have any similar commands in linux for creating folder by specifying its size.
|
|
|
12-06-2010, 07:40 AM
|
#6
|
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339
|
No. Nevertheless, you can use such a created file, format it as ext2 (option -F necessary for mke2fs) or alike and mount it as loop (mount -o loop ...) device on any directory which would also give you the intended effect.
|
|
1 members found this post helpful.
|
12-06-2010, 08:28 AM
|
#7
|
Member
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271
Original Poster
Rep:
|
hi,
yes it works, we have an application hosted on our server through tomcat. our client use to upload pdf documents in server,which would be saved in the folder allotted to them.we need to allot 3gb for each client i.e for each folder.
Does this will work, do we have any risks in this.
Last edited by dinakumar12; 12-06-2010 at 08:32 AM.
|
|
|
12-06-2010, 08:39 AM
|
#8
|
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339
|
I see no risk in this. Just be sure that each directory can only be written to by the user you want to grant access to.
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 07:06 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|