LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-05-2010, 12:10 AM   #1
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271
Blog Entries: 7

Rep: Reputation: 18
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.
 
Old 12-05-2010, 12:53 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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.
Old 12-05-2010, 01:05 AM   #3
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
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.
 
Old 12-06-2010, 05:25 AM   #4
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
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.
Old 12-06-2010, 07:31 AM   #5
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
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.
 
Old 12-06-2010, 07:40 AM   #6
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
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.
Old 12-06-2010, 08:28 AM   #7
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
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.
 
Old 12-06-2010, 08:39 AM   #8
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
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.
  


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
Applying default permissions for newly created files within a specific folder mattydee Linux - Desktop 29 10-30-2016 10:55 PM
Newly created id on LQ.... ssinlr Linux - Newbie 1 12-01-2008 11:21 PM
Can't access newly created directory DaftDave Linux - Newbie 4 06-27-2008 05:00 PM
permissions for newly created files dialbat Linux - General 2 10-04-2004 03:58 PM
how can i default the max folder file size when it create inside a folder antony_csf Linux - Software 1 06-17-2004 03:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:06 AM.

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
Open Source Consulting | Domain Registration