LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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.

Notices


Reply
  Search this Thread
Old 05-21-2009, 05:25 AM   #16
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405

If you want to do this, by all means: bind.

But I wouldn't. var+home in the same partition will probably take fragmentation to unknown limits. Bear in mind that stuff in var gets written massively. Two examples are going to be the stuff for your package manager (lots of small files which are writen each time you update the package database) and /var/tmp, which is a temporal directory where arbitrary stuff gets written every five minutes for one or another reason.

How this will affect performance depends mostly on the kind of filesystem that you use. Instead of fusing them both into a single fs, I would rather add another one for /var/tmp, which you can mount bind with /tmp as well, since on a desktop system the nature of /var/tmp and /tmp is not much different. So, my scheme for these would be.

Code:
/var ext3 #or the fs of your choice
/home ext3 #or the fs of your choice
/tmp ext2 #I don't need a journal here so ext2 will be lighter in cpu term
/var/tmp mounted bind at /tmp
My view, anyway.
 
Old 05-21-2009, 08:48 PM   #17
wabbalee
Member
 
Registered: Oct 2006
Location: brisbane - australia
Distribution: ubuntu
Posts: 335

Original Poster
Rep: Reputation: 38
Thanks guys for all your answers, sorry for not coming back any sooner (work).

My head is spinning. Still, after reading everything suggested here I think that I should use a partition for /home and one for /var. Simply to keep it simple and prevent complications. This should be reasonable easy to accomplish during a fresh install, provided I have my partition sizes worked out and set up.

Quote:
I don't think I would set a system up using it by default (better to set partitions up from the start with a well thought out plan)
as forrestt states.

Quote:
In my example, "/borkable" is the mounted filesystem, but the places we would want to link to are "/borkable/var" and "/borkable/home" (to meet the OP's needs) which are merely directories.
as Quakeboy02 states. This would mean linking. What I was hoping for in an answer was more in the likes of say:

Code:
/dev/sda1  used for / #(KUBUNTU)
/dev/sda2  used for / #(XUBUNTU)
/dev/sda6  used for /var
                    /home
'/var' and /home' being in an extended partition because I want to use my primary partitions for the OS's and swap. I will then have both OS's use the same physical partitions for '/home' and '/var' but not (of course) for '/'. after all if you leave it to the installer of most (if not all) distro's it will place ALL directories in the same partition, so why not have two of those directories on one other partition than where '/' is on? well, that was my thought initially anyway.

Quote:
Since Linux 2.4.0 it is possible to remount part of the file hierarchy
somewhere else. The call is
mount --bind olddir newdir
After this call the same contents is accessible in two places. One can
also remount a single file (on a single file).
This sounds like something that can (or needs to) be done after a default install, not during initial install right?

Quote:
On my system /var only takes up 75 MB of it's 500 MB partition.
As lumak states here, his /var directory only takes up 75 MB which is next to nothing compared to mine. My /var will grow in time to over 1 GB. The reason for this is a setting that I deliberately place in Synaptic (package manager which stores in /var) and the reason for that is that I copy those downloaded packages over to the other systems in my house (wife's, daughter's and son's) before I update (or fresh install) their systems so that I minimise my downloads.

and

Quote:
If you are hosting an http or var server, you just have to make user that those directories... if on /var... are pointing to directories on /home
If there is a (simple) way to set up a proxy, something I have never done and know nothing about, that would save me a lot of travelling around with my usb stick. But that sounds more like a new topic.

the reason I want to use a single /home partition is that I hoping to prevent copying my .mozilla and .mozilla-thunderbird
back and forth when I am using either kubuntu or xubuntu. I don't know if the two would want to write to many more of the same files that are in /home and what results that could give with regards to the different desktop environments and individual settings. Trial and error will give me clarification here I think.

Quote:
If you want to do this, by all means: bind.

But I wouldn't. var+home in the same partition will probably take fragmentation to unknown limits.
as i92guboj states. what happens to fragmentation if I left it all to default install? Thanks for mentioning fragmentation by the way, because I have been wondering about ext(2,3,4) and if these filesystems fragment. If they do, is there a utility to defrag? sorry this is off topic as well.
 
Old 05-21-2009, 09:16 PM   #18
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
I'm curious about the fear of fragmentation in this case, since it's not a big concern in the case of a single "/" partition.

No, there are no real contemporary utilities to defrag an ext3 partition. I haven't looked into ext4 much, but I seem to remember something related to defragging. (I've also noticed that there have been MANY kernel updates to the ext4 package) OTOH, consider the case where you have a 1TB drive and you (think you) want to defrag it. If you could find a utility, you could say good-bye to your system for a fairly extended period of time. It's much easier to just buy a second 1TB drive, and do a copy from one to the other, using a LiveCD, than it is to contemplate defragmentation.

My take on this issue of defragging is that the size of drives is quickly outpacing any reasonable ability to defrag a drive, so the load of keeping a disk unfragmented is going to fall on the shoulders of the filesytem driver.

There are many threads on fragmentation here on LQ. You will find my posts on a number of them in the "I don't believe in it (on modern filesystems), and I don't do it" column.
 
Old 05-21-2009, 09:22 PM   #19
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Oh, and another option for you would be to have one "main" partition where your "primary" distro is situated, and use the --bind option to link into /var and /home from the "secondary" distros. Since the whole primary partition would be mounted (just the subdirs "bind-ed"), there shouldn't be an unreasonable risk to the filesystem. You're going to have to do something about /boot with a dual-boot system, anyway. But, in this case, it might be better for you to use unionfs rather than bind.

Backups are your friends.
 
Old 05-22-2009, 04:04 AM   #20
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by wabbalee View Post
as i92guboj states. what happens to fragmentation if I left it all to default install? Thanks for mentioning fragmentation by the way, because I have been wondering about ext(2,3,4) and if these filesystems fragment. If they do, is there a utility to defrag? sorry this is off topic as well.
There's no official degrag tool, you can search for some external tools, like "shake" though.

That's a common misconception. All filesystems fragments, it's something inherent to the very nature of a filesystem. What's different about *most* linux filesystems is that the effect of fragmentation is negligible because the i/o schedulers do a very good job reordering the operations in the smarter way so the heads of your hd don't need to go jumping back and forth to seek your data.

There are exceptions to the rule: reiserfs (3.x) for one has some serious issues with fragmentation.


Quote:
Originally Posted by Quakeboy02 View Post
I'm curious about the fear of fragmentation in this case, since it's not a big concern in the case of a single "/" partition.
It doesn't matter how much data is there on the partition as much as it matters how much of this data tends to fragment. I'll explain myself: some system dirs tend to fragment more than others: /var, /tmp, /home... those are dirs where you will be updating, removing and adding files very quickly and in a big amount. System dirs like /usr or /opt shouldn't fragment that much. Hence, what you do if you put /var and /home in the same partition, you are doing two things:
  • you are moving two of the "top-frag" directories into a single location
  • you are reducing the available space for them, the less free space on a partition, the more chance for a file to be fragmented

Of course, the second is only relevant if that partition is full enough.


Also, the effect of fragmentation in a single / might matter or not matter depending on many things. My fs's tend to last years untouched (to be exact, until hardware breaks and I have to migrate forcingly, I don't reinstall).

Quote:
No, there are no real contemporary utilities to defrag an ext3 partition. I haven't looked into ext4 much, but I seem to remember something related to defragging.
ext4 is supposed to have a userland tool to do this and also an on-line degragmented embedded in the same fs driver. However I know nothing about the state of these.
 
Old 05-22-2009, 09:26 AM   #21
phoenix_precedent
LQ Newbie
 
Registered: May 2009
Posts: 15

Rep: Reputation: 2
If you're going to share /var between distros, I'd highly recommend configuring (at least) your logs to use separate directories (i.e /var/log/distroX & /var/log/distroY).

For desktop systems I generally have separate partitions for:

/boot (the rest is encrytped, so this is vital to be able to boot)
swap
/var
/var/tmp (symlinked to /tmp)
/
/usr
/usr/local (apps not found in distro repos)
/var/cache/build (source based distros only)
/home

These are all (except /boot) under LVM, so I can resize as needed. I can also choose different filesystems & fs options based on the characteristics of these directories.

If I was going to run two linux distros on the same machine, my altered partition scheme would be:

/boot (shared)
swap (shared)
/var (shared)
/var/tmp (shared)
/ (distroX)
/ (distroY)
/usr (distroX)
/usr (distroY)
/usr/local (shared)
/var/cache/build (possibly shared)
/home (shared)

Take a look at lvm. It could really help if you decide you need some extra partitions, or in the event you decide to go with just one distro (I predict this will be so ;-) ) you can easily reclaim and reassign the space.

Hope this gives you some ideas,
Phoenix
 
Old 05-22-2009, 09:38 AM   #22
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by phoenix_precedent View Post
If you're going to share /var between distros, I'd highly recommend configuring (at least) your logs to use separate directories (i.e /var/log/distroX & /var/log/distroY).
I don't recommend to share it at all. If you absolutely must, then create a partition for all vars and then create a different var inside it for each distro. Then mount -o bind the relevant directory into /var for each given distro.

Sharing var between many distros require a deep understanding of the things that your distro puts in there. Otherwise you are going to run into problems that no one can solve (partly because no one will expect you do share var with other distros).

There can be conflicts, the issue about the logs is just one of them.

I don't say that it can't be done. All I say is that you shouldn't expect this to run flawlesly without any manual work on your side.
 
Old 05-22-2009, 11:04 AM   #23
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
I see all this advice, but I still can't figure out why all the trouble to dual-boot Xubuntu and Kubuntu. Aren't they really the exact same distro with Kubuntu have the added KDE packages? I mean I could see doing it with different versions or completely different distros, but this seems a little extreme. If you don't want to run KDE just log out of it and pick a different window manager, and when you are done with that one, log out and go back to KDE.

Forrest
 
Old 05-22-2009, 12:19 PM   #24
phoenix_precedent
LQ Newbie
 
Registered: May 2009
Posts: 15

Rep: Reputation: 2
I have to agree with i92guboj (that's why I said "at least") and forrestt above.

Sharing /var could be a fun and educational experience, and I think sharing between ubuntu variants could be relatively easy (as compared to say ubuntu and gentoo), but then again, why not just fire up your package manager on Kubuntu and install the Xubuntu dummy package to bring in all the dependencies (besides the massive bloat and functionally duplicate programs ;-) )?

Well, best of luck whatever you decide,
Phoenix
 
Old 05-23-2009, 08:15 PM   #25
wabbalee
Member
 
Registered: Oct 2006
Location: brisbane - australia
Distribution: ubuntu
Posts: 335

Original Poster
Rep: Reputation: 38
Thanks again guys,

Quote:
I see all this advice, but I still can't figure out why all the trouble to dual-boot Xubuntu and Kubuntu. I mean I could see doing it with different versions or completely different distros, but this seems a little extreme.
I agree Forrestt, it doesn't make much sense in this case, but it is not always (K)(X)Ubuntu. My 12yo son is asking me tons of questions related to sound and video editing, so I am also thinking in the likes of Ubuntu Studio, which uses an RT kernel and may be I might even use a different distro altogether. I think the biggest hassle is /home; I like to be able to have my files and settings to be synchronized throughout the system(s).

Quote:
why not just fire up your package manager on Kubuntu and install the Xubuntu dummy package to bring in all the dependencies (besides the massive bloat and functionally duplicate programs ;-) )?
phoenix_precedent, I thought of that option as well. That is possibly a way to go too. Still I would want to have /home and /var separate from / with regards to upgrading. I know the packages in /var will be of little use once the distro is upgraded to the next release, which would be the only time I will actually delete all the files in there to get a clean lot when updating that next release.

I have learned quiet a bit from this thread, also for the off topic bits; the info on defragmentation is also valuable. It will certainly change the way I have been doing things so far. I hope sharing a /home partition with various distro's will work as that seems to be the most annoying one when switching, especially for thunderbird and mozilla, but also general system behavior and user settings wise. this is all stored in /home right?

Thanks for all advice.
Ron

Last edited by wabbalee; 05-23-2009 at 08:16 PM.
 
Old 05-24-2009, 03:44 AM   #26
phoenix_precedent
LQ Newbie
 
Registered: May 2009
Posts: 15

Rep: Reputation: 2
Quote:
Originally Posted by wabbalee View Post
My 12yo son is asking me tons of questions related to sound and video editing, so I am also thinking in the likes of Ubuntu Studio, which uses an RT kernel and may be I might even use a different distro altogether.
Ubuntu Studio is still Ubuntu. You can probably live with an RT kernel in your everyday use, but if you really can't you can just boot a different kernel with the same filesystems.

Dual booting Linux Distros means duplicating maintenance efforts without much benefit. Find one distro that offers most of the functionality your family requires (possibly Ubuntu Studio in this case) and then add and remove software to taste.

Quote:
Originally Posted by wabbalee View Post
I know the packages in /var will be of little use once the distro is upgraded to the next release, which would be the only time I will actually delete all the files in there to get a clean lot when updating that next release.
If your system is kept up to date, you'll actually find that most of the packages in /var are still usable. Ubuntu (Debian in general) can update your distro on the fly using apt or any of its frontends. It's a lot less work than a fresh install, as all your packages will be kept/upgraded as appropriate.

Quote:
Originally Posted by wabbalee View Post
I hope sharing a /home partition with various distro's will work as that seems to be the most annoying one when switching, especially for thunderbird and mozilla, but also general system behavior and user settings wise. this is all stored in /home right?
It most definitely will work. I've shared /home partitions between OS's before (FreeBSD & Linux)!

Sharing /var is a little more adventurous. If you choose this path, know that you are most likely forging new ground. It may be easier to share only the directories you're actually interested in (/var/cache/apt/archives I believe).

Good luck,
Phoenix

Last edited by phoenix_precedent; 05-24-2009 at 04:11 AM. Reason: spelling ;-)
 
Old 05-24-2009, 11:48 AM   #27
wabbalee
Member
 
Registered: Oct 2006
Location: brisbane - australia
Distribution: ubuntu
Posts: 335

Original Poster
Rep: Reputation: 38
Quote:
Sharing /var is a little more adventurous. If you choose this path, know that you are most likely forging new ground.
I am indeed,

Quote:
It may be easier to share only the directories you're actually interested in (/var/cache/apt/archives I believe).
You are right again. how is this done? does that involve editing /etc/fstab? will a separate partition be useful or even helpful, with regards to mounting it in the fs?

Quote:
If your system is kept up to date, you'll actually find that most of the packages in /var are still usable.
that would be good! my system is up to date most of the time. Synaptic can sort the crap from the good so it seems, although I have never actually tried this feature: (Preferences -> files -> only delete files which are no longer available).

Thanks.
 
Old 05-24-2009, 06:08 PM   #28
phoenix_precedent
LQ Newbie
 
Registered: May 2009
Posts: 15

Rep: Reputation: 2
Quote:
Originally Posted by wabbalee View Post
how is this done? does that involve editing /etc/fstab? will a separate partition be useful or even helpful, with regards to mounting it in the fs?
If you are going to share /var/cache/apt/archives between your dual boot systems, then yes, a separate partition will be required. Check how much space the directory is using, by running:
Code:
du -sh /var/cache/apt/archives
You will need more. Probably a great deal more.

You will definitely need a line in /etc/fstab. If you're installing the other distro from scratch, when you partition for it, just create the extra one with the right mount point. After it has been formatted, mount whichever partition your original distro's /var is on and copy the files over (be sure to preserve permissions and maybe timestamps). Then continue with installation.

When you get to the end, verify that all your copied files are still on the new partition, and copy the /var/cache/apt/archives line from your new distro's /etc/fstab to the old distro's. Remove all the files in your old distro's /var/cache/apt/archives (your new partition will mount here, so they'll just take up space for nothing). Unmount your old distro's partition and reboot.

If you're not installing from scratch, you'll need to repartition your disk using gparted or similar. Once done, you can get the UUID using:
Code:
vol_id --uuid /dev/sdXN
Add a line to /etc/fstab using this UUID and appropriate options.

Good luck,
Phoenix
 
Old 05-25-2009, 06:57 AM   #29
wabbalee
Member
 
Registered: Oct 2006
Location: brisbane - australia
Distribution: ubuntu
Posts: 335

Original Poster
Rep: Reputation: 38
I think I have my answers now, I will dive into this within the next week (hopefully), using this thread as a guide and report here how everything went.

Cheers
Ron
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot write $(HOME).dmrc file home is on a seperate partition Person_1873 Linux - Newbie 5 12-07-2008 01:41 PM
I am creating a website Server what is the best partition for /var /root /home etc. RMLinux Linux - Newbie 3 12-01-2008 07:46 AM
8.10 partition size requirements for / /home/ /swap /var /usr going from 8.04 Ubuntu Thane Ubuntu 10 11-30-2008 07:27 PM
change $HOME var paul_mat Linux - Networking 3 05-01-2006 09:57 PM
moving /home /root & /var to new partition CrashedAgain Linux - General 8 11-24-2005 10:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:48 PM.

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