Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to allocate/mount certain size in directory

Status
Not open for further replies.

h3nd

Programmer
Jul 1, 2006
147
AU
Hi guys,

I have top directory which called /home which has 20G space, and I want to allocate one directory inside home directory with certain size.

So, it would be
/home/test --> 4G

How do I do that guys ?

Thanks in advance
 
Hi

[tt]quota[/tt], [tt]edquota[/tt] and others mentioned in this two's man page ?

Is not exactly what you asked for because the limitation is user and/or group related, but may be usefull.

Feherke.
 
or create a new filesystem called /home/test with a size of 4Gb

Mike

Unix *is* user friendly. It's just selective about who its friends are.
 
Hi mrn,

Probably your way is good,
but how to create a new filesystem ?

Thanks man.
 
from advanced bash scripting guide:
Code:
# Example 13-7. Creating a filesystem in a file
SIZE=1000000  # 1 meg

head -c $SIZE < /dev/zero > file  # Set up file of designated size.
losetup /dev/loop0 file           # Set it up as loopback device.
mke2fs /dev/loop0                 # Create filesystem.
mount -o loop /dev/loop0 /mnt     # Mount it.

# Thanks, S.C.
without warranty - I didn't test it.

seeking a job as java-programmer in Berlin:
 
Thanks alot stefan,

Can anyone approve this script ? cause I'm gonna do this in production server. So I don't have chance to test this.

Thx guys.
 
Hi

I have a question related to stefanwagner's solution. Why that [tt]losetup[/tt] ? I read its man but still not clear. Always when I done such thing I just created the file, made filesystem, them [tt]mount[/tt]ed.

Feherke.
 
What's your O/S?


Mike

Unix *is* user friendly. It's just selective about who its friends are.
 
Are you using Logical Volume Manager?

Mike

Unix *is* user friendly. It's just selective about who its friends are.
 
I'm not sure about that mate...

How can I tell about that?
 
Seems you really have to ask the effective sysadmin.
 
from command line / terminal enter

lvdisplay -v

Mike

Unix *is* user friendly. It's just selective about who its friends are.
 
The [tt]losetup[/tt] is probably to avoid the warning that the file is not a block device. Of course, it'd be easier to use the -F option to [tt]mke2fs[/tt], which causes it to skip the warning.
 
Hi,

I know that /dev/loop[0-7] is a virtual device that we can use. The question whether it is OK to put files into this device, or this device is reliable ?

Or is it better for me to split the real device such as
Code:
Filesystem         ...        Mounted on                  
/dev/sda6                        /home 
/dev/sda6                        /backup
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top