Large drive- too much space lost by large block size?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Large drive- too much space lost by large block size?
I have an 7200RPM 80GB drive that I will be using to store mainly MP3 files (to give you an approx average file size). I am currently using a single ext3 partition. The normal format (mke2fs) of the fs uses 4k block size. A 667 MB (700,119,428 bytes) directory tree (with 143 files and 23 sub-dirs) takes up 810 MB (849,346,560 bytes) on the disk! A friend has an NTFS formatted drive (50GB ) with the same directory which takes little more than the original file size (maybe smaller default block size, unsure).
This leads me to a few questions that I hope you can help me with:
1. Can I simply use a smaller block size for the file system? I never imagined such a high bookeeping cost on single ~700 MB directory. Would it be better to take the hit of a smaller block size-> larger filesystem table but overall would it save me space?
It seems on a full drive (this will be filled) I would lose nearly 10GB of data space if I kept with this 4k block size. I doubt the fs table could be made that large by smaller blocks? Also what about the speed loss of smaller blocks?
2. Is it better to use 2 or more partitions? I don't want them for any data reasons (backup, corruption, I'm fine with the 80GB as one partition, but if it will help space loss then i can deal with > 1)
3. Is ext3 journal causing all this mess? I don't think it impacts but just in case, figured I would ask.
Any other questions and answers that you would like to supply, are there other reasons I could be losing so much space?
Please feel free to reply to all or only some of the questions, and please lend your insights.
As you said your friend has NTFS and it saves alot of space and meant to do so since it's meant for serving lots of different files and apps. That's the same thing with fat16>fat32 When fat16 was converted to fat32 you end up with more space than before with better performance due to the 32bit block allocation it uses. So in answer yes, Linux can do the same and instead of useing 4096k per node, you can use 2048 or 1024. 2048 is a great middle ground and you won't sacrifice enough in performance compared to the space you'll save. Especially since you'll have tons of small (by comparison) files, it's actually recommended by many. Having one partition is fine too. Shouldn't make much difference if it's just storage.
Are you using 2 drives, with one being nothing but data storage, and the other being your Linux setup?
If you are, then you dont need a /root partition on the data drive. If you are instead using only one disk, then it is HIGHLY recommended that you create at least a /root partiion for the superuser.
The main reason being is that Linux will mount the superuser partition, or /root first on boot-up. If it can boot that, the system can still be usuable.
If however you use only one partition and dont separate the /root, then if you get a file system problem, Linux may be unable to mount /root and then not be able to continue the boot-up.
Another reason not to use only one partition is the risk of reformatting or deleting your personal files when you do an upgrade or re-install. Most distros allow you not to reformat or delete the /home partition, so no personal settings or preferences are ever changed.
Very nice feature to have you are someone who tries something, messes the system up, then has to re-install everything
I have a data drive and a non-data drive, and am doing the formatting etc. for the data drive only (as per these posts).
Terminology question: When mke2fs reserves space (about 5% normally, changed with the -m option) on a partition, I think you are referring to that as superuser partition? I've never called that the root partition, I've always made my /root manually (and of course as a separate partition), and in fact never knew that "Extra" space was used until i manually ran mke2fs.
So, knowing that, I am wondering if I would gain anything from the reserved space on the data drive, could the system boot off of it given an failure of my initial drive? Would the creation of the system files on that reserved space be automatic, or would I have to manually partition and create files there?
OK, that is what I was confused about. A data drive to me is a drive that is holding nothing but user files and does not have Linux installed on it. It is accessed via /mnt command.
I am not sure about how to answer your terminology question, as I do not format or partition my drives that way. I use the graphical environment for that, jsut for better visuallization as to what I am doing. Maybe someone else can help you there.
As far as making your data drive bootable... the only way I know to do that is to install Linux on that drive as well. You would use space that way though.
As an example of what I did, I have two drives installed. One drive has Linux installed into various partitions, and my /home is on there as well. My second drive is simply formatted as ReiserFS, with the mount point as /mnt/music. There is nothing else on there. Of course, if the Linux system drive goes down, I cannot boot off of the /mnt/music because Linux is not actually installed on it.
So to answer your question about whether you would gain space.. yes.