You are not logged in.

#1 2011-05-29 11:30:36

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

How would you split a 10 GB root partition? Would you?

The system seems to be booting a little slow lately (been using Arch for more than a year now) and I was thinking of splitting the root partition to improve performance.


Right now the entire OS is on a single partition. I don't have a /home partition but I can see it's usefulness:

- files on /home are, in general, more frequently written (browser cache especially), which means less fragmentation for the root partition

- having a noexec flag for /home so no potentially dangerous software will run from there (and why would you need to run software from /home?)

- my /var folder takes up 102 MB, 9.706 files in 4.846 folders. Is there a filesystem that will deal well with many small files ? ReiserFS maybe ?


So how would you split (gigabyte-wise) a 10 GB partition into /, /home and /var ? And would you ? I've been told from the IRC channel that it makes zero sense. At least not for desktop use.

PS: I'm also switching from i686 to x86_64, so please take that into account as well. For instance I noticed that 64 bit software usually takes up more space than 32 bit.

Last edited by DSpider (2011-05-29 11:32:04)


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#2 2011-05-29 11:39:00

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: How would you split a 10 GB root partition? Would you?

/home contains /home/USER/bin for my system no adding the noexec flag would kill that functionality.  Where do you keep your scripts???

To your question: don't split your root partition/use ext4 which is just as good as reiserfs.  Don't worry about fragmentation.  Go ahead and check it via:

# shutdown -rF now

That will force a fsck run and you will see your % fragmentation when the check finishes.  I'm guessing your numbers will be <1 % based on your post.

My system: root filesystem is 10 G (2.8 G in use) and is ext4.  I have a separate /var which is 8 G (2.2 G in use) and is also ext4 but only because it's on an HDD not my SSD for obvious reasons.  /home for me is 65 G on ext4.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2011-05-29 12:32:02

Awebb
Member
Registered: 2010-05-06
Posts: 6,286

Re: How would you split a 10 GB root partition? Would you?

A good choice for var might be Reiser or Btrfs. Those are good in dealing with small files.

graysky wrote:

/home contains /home/USER/bin for my system no adding the noexec flag would kill that functionality.  Where do you keep your scripts???

This folder is not in $PATH by default. I keep my scripts in /usr/local/bin, since I'm the only one using this machine. But I sometimes want to test a script (while writing it, yay), it would be annoying to use a superuser to copy them over all the time. Be also advised that some .desktop files in ~ need the x-flag to run in certain environments. Also watch for /tmp, some AUR helpers need x flag in /tmp as well.

It makes in fact no sense to split the system folders to different partitions on the same disk. It makes sense to keep home and the others separate from each other. Imagine the following: A process needs to write to tmp, read from var, read from opt, write to tmp, write to var, read from opt... The write-read head of your hdd has to move forth and backwards between those folders. If the files are close together, the process is faster. Imagine the head has to pass a void of empty sectors to get to another partition (SGU metaphor anyone? :-P), it'll take even longer.

That's why I keep /, /tmp, and /home on three different disks. That's not very laptop friendly, but desktops have benefits too...

Offline

#4 2011-05-29 12:44:35

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: How would you split a 10 GB root partition? Would you?

You can actually still execute scripts in /home if it is mounted noexec, you just have to run e.g. "bash test.sh". You then execute bash which just reads the file test.sh. The only thing you can't do, is include a shebang and execute the file directly.
Of course, compiled programs wont run smile

Offline

#5 2011-05-29 13:38:02

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: How would you split a 10 GB root partition? Would you?

"shutdown -rF now" performed a quick check. It quickly disappeared the first try so I had to press Scroll Lock (or Ctrl+S) to pause it.

235917/655360 files (0.4% non-configuous), 1977149/2620595 blocks

Probably because I filled it up to 100% a few times and constantly keep it at 95%. Hehehe... I know, I know...

On a side note, how do I get it to 0% fragments ?


Regarding scripts, I keep mine in ~/.config/openbox/scripts/ but I know could just as easily move them some place else (like /bin or /usr/scripts, etc). That's the beauty of Linux. Choice.


Back on topic, /home/USER has around 50.000 files, of which ~/.thumbs has 30.000 files (which take up 600 MB?? O.o)... /home is so getting a partition. I was thinking maybe:

5 GB /
1 GB /var
4 GB /home

Though I'm still contemplating whether I should add a /var at all. I've read it's more useful for a server.

Last edited by DSpider (2011-05-29 13:47:05)


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#6 2011-05-29 13:53:18

hauzer
Member
From: Belgrade, Serbia
Registered: 2010-11-17
Posts: 279
Website

Re: How would you split a 10 GB root partition? Would you?

[hauzer@ ~]$ df -h
Filesystem                                              Size  Used Avail Use% Mounted on
...
/dev/sda5                                                4.6G  2.6G  1.8G  60% /
...
/dev/sda8                                               3.2G  2.5G  603M  81% /var
/dev/sda5                                               5.4G  1.6G  3.6G  31% /home
...

Packages installed:

[hauzer@ ~]$ pacman -Q | wc -l
502

Explicit packages installed:

[hauzer@ ~]$ pacman -Qe | wc -l
225

Maybe that will help you decide, it's my setup. Note that I don't have space-consuming data in my $HOME, mostly configs. Also, /tmp is a separate 150MB partition and I have a separate /boot.

Last edited by hauzer (2011-05-29 13:56:22)


Vanity of vanities, saith the Preacher, vanity of vanities; all is vanity.
What profit hath a man of all his labour which he taketh under the sun?
All the rivers run into the sea; yet the sea is not full; unto the place from whence the rivers come, thither they return again.
For in much wisdom is much grief: and he that increaseth knowledge increaseth sorrow.

Offline

#7 2011-05-29 14:25:00

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: How would you split a 10 GB root partition? Would you?

hauzer, I bet if you run pacman -Scc that huge /var of yours will go down to about 90 MB:
https://wiki.archlinux.org/index.php/Pa … l_commands


The way I see it, /var is where logs are kept but also where the pacman cache is located - which would be extremely useful for downgrading (in case ARM doesn't work). But so far I've only downgraded a package once when testdisk had a problem with ncurses-5.9 and I simply had to use ncurses-5.7 to get it to work. That was the only time I had to downgrade in over a year of using Arch as my main OS.

Though 1 GB may be too small for some larger packages...


Edit: Here's an idea: install Arch in VirtualBox and try it out for a week or so. Everything contained in a 10.00 GB .vdi file. If the partitioning scheme works out ok, I'm keeping it. If not, maybe add a GB or two.

5 GB /
2 GB /var
3 GB /home

Last edited by DSpider (2011-05-29 14:30:51)


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#8 2011-05-29 14:35:19

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: How would you split a 10 GB root partition? Would you?

Ramses de Norre wrote:

You can actually still execute scripts in /home if it is mounted noexec, you just have to run e.g. "bash test.sh". You then execute bash which just reads the file test.sh. The only thing you can't do, is include a shebang and execute the file directly.
Of course, compiled programs wont run smile

Aha, but you can invoke the linker to run compiled programs, e.g. /lib/ld-2.13.so /usr/bin/pacman

Offline

#9 2011-05-29 14:53:18

broken pipe
Member
Registered: 2010-12-10
Posts: 238

Re: How would you split a 10 GB root partition? Would you?

you can also use lvm and resize each volume afterwards. you have only one partition but several volumes that can be mounted individually.

https://wiki.archlinux.org/index.php/Lvm

Offline

#10 2011-05-29 15:20:09

Awebb
Member
Registered: 2010-05-06
Posts: 6,286

Re: How would you split a 10 GB root partition? Would you?

Here is what's happening on my Arch box:

.   2,1TiB [##########] /mnt
.  61,0GiB [          ] /home
    5,2GiB [          ] /usr
.   2,9GiB [          ] /var                                                                    
  126,0MiB [          ] /opt
   83,1MiB [          ] /lib
.  14,1MiB [          ] /boot
   10,0MiB [          ] /sbin
.   7,3MiB [          ] /etc
    5,3MiB [          ] /bin
.   3,0MiB [          ] /tmp
  192,0kiB [          ] /run
   20,0kiB [          ] /srv
!  16,0kiB [          ] /lost+found
    4,0kiB [          ] /dev
    4,0kiB [          ] /lib64
!   4,0kiB [          ] /root
.   0,0  B [          ] /proc
    0,0  B [          ] /sys
<   0,0  B [          ] /media

Generated with ncdu.

I have big stuff installed like a full texlive and libreoffice and I never clean my package cache. This is /var:

.   2,6GiB [##########] /cache                                                                  
. 153,2MiB [          ] /lib
   57,1MiB [          ] /abs
.  31,3MiB [          ] /log
    7,4MiB [          ] /tmp
. 592,0kiB [          ] /spool
. 132,0kiB [          ] /run
    8,0kiB [          ] /lock
e   4,0kiB [          ] /opt
e   4,0kiB [          ] /local
e   4,0kiB [          ] /games
!   4,0kiB [          ] /enigma
    4,0kiB [          ] /empty
@   0,0  B [          ]  mail

And this is /var/cache

    2,6GiB [##########] /pacman                                                                 
   10,9MiB [          ] /pkgtools
    3,0MiB [          ] /man
  320,0kiB [          ] /cups
  280,0kiB [          ] /fontconfig
  252,0kiB [          ] /samba
!   4,0kiB [          ] /ldconfig
e   4,0kiB [          ] /hald

/usr

    2,8GiB [##########] /share                                                                  
    1,7GiB [######    ] /lib
  415,2MiB [#         ] /bin
  153,9MiB [          ] /include
  149,8MiB [          ] /lib32
   15,3MiB [          ] /src
   13,7MiB [          ] /sbin
  104,0kiB [          ] /local

I think I have a very typical desktop here: Mostly web/office stuff and some multimedia.

Offline

#11 2011-05-29 23:50:47

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: How would you split a 10 GB root partition? Would you?

While I was following the Beginner's Guide, I've stumbled across a bit of information: loopback devices.

I did some researching and it's basically a file you can format as ext4 (or ReiserFS, whatever), and mount as a partition. Interesting... And then it hit me - what if I just mount /var and /home as a loopback device ?

That way I'd have a 2 GB file mounted as /var and a 3 GB file mounted as /home and I won't have to mess around with resizing partitions. They're files ! I can just create larger ones, mount them and transfer their contents with cp -a /source_path/* /destination_path/

And apparently loopback devices can be partitioned. And they don't even have to reside on the root partition, they can be on one of my data partitions ! It's the mount point that counts.

Any thoughts on this ?


PS: As an extra layer of security to go with the noexec flag on the /home partition:
http://hummy.wikidot.com/create-a-loopb … nd-var-tmp


But maybe this whole thing is a bit of an overkill... I'll sleep on it.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

Board footer

Powered by FluxBB