Using an SSD but keeping home directory on hard drive


I have a dual boot windows XP/OpenSuse 11.3 system running from a hard drive. They are both 32 bit in spite of the fact that the system can run 64 bit.

I would like to upgrade to Windows 7 64 bit (the wife insists, not yet a Linux possibility) and OpenSuse 11.4 64 bit, but having the programme files on an SSD for faster loading, with my data files on the existing hard drive.

I’m happy with the notion of getting the SSD going as a dual boot system. With Windows, as I understand it, it can tell it fairly easily where to look for the “my documents” folder on the hard drive.

However, the Home directory in Linux is not quite the same. How (if it’s possible) could I run the SSD but use my existing Home directory on the hard drive?

At install time you can set your /home partition to a hard drive partition, it’s that simple. I do it every time, so I can upgrade oS to a new version without losing most of my settings (important things, like supertux scores :)). You can even change it on a working system, but this will require some low-level intervention, probably with a liveCD tool.
I’d also set the /tmp and /var partitions to the hard drive, as these are constantly written IINM. That will save your SSD a bit. Perhaps someone with a SSD will have more info.

See any of the many install manuals or stickies or wikis for more details.

Not only is it easy to set up /home on a partition of its own, it is also a recommended practice, whether using an SSD boot drive (as I do ) or not. Any reinstallation can then simply be told to use the existing /home without reformatting it, which is much easier - as well as much safer - than using backups.
Backing up /home is still necessary, of course, but not for this purpose…

Go into runlevel 1. Then you are sure there are no normal users loged in any more and you can the umount /home, copy it to the new partition (e.g. with tar or *cp, *mind the options to use to retain ownership and timestamps), change /etc/fstab to mount the new partition on /home, *reboot, *ready.
Prerequisit is of course that the new partition is there and that it has a fresh (empty) file system created on it. Can be done with YaST (before you go for this exercise), or fdisk and mkfs (either also before this exercise. or when beiing in the runlevel 1 state as above.

I forgot about RL1, thanks.
What about the tmp and var directories, should they also be kept away from SSD as I assumed? I’m just curious, no SSDs in the foreseeable future for me.

On 2011-06-14 18:36, brunomcl wrote:
> I forgot about RL1, thanks.
> What about the tmp and var directories, should they also be kept away
> from SSD as I assumed? I’m just curious, no SSDs in the foreseeable
> future for me.

tmp is easy to move. Var I’m not sure.

Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Do not make the error to see ./tmp and /var as the same sort of beasts. At the most /var/tmp comes into the same sort of usage category as /tmp.

you could e.g. place /tmp in memory (tmpfs), which will btw give you a nice clean /tmp aftyer every reboot. But do not do this with /var, you would throw away important system data.

Thanks everyone for your help. I will do all my backups and take the plunge this weekend …

Philip Timms

Since I’ve installed Conky I notice that my SSD is constantly being written to, even when I’m not doing much at all. As I’ve already moved /tmp to a ramdisk, the obvious suspect is /var. Now I know that a lot of stuff in there has to be persistent between boots, and I should really have thought of putting it on the hard disk during the install, but is there any way known to man to move /var elsewhere on an existing installation?

See my signature. My OS is on SSD disk and home on the other 500 Gb disk
My system boots from grub in 25 s .

Be carefull at jumping to conclusions. I read from your remark above that you think that /tmp has a lot of I/O. That is not true in general. Not all applications arte constantly storing/retrieving there.
Same is for /var/tmp (please do NOT talk about /var as if it is something like /tmp. It is not. You could even compare it better with /etc).

I/O activity on your / could be everything. E.g. at every minute cron is checking if iit must do something. And there are much more system activities. Also cahing activities (e.g. writing of buffers after a certian time), other activities. Even when I am not loged in at all, I see the disk led flashing now and then.

gminnerup wrote:
> is there any way known to man to move /var elsewhere on an existing
> installation?

Easiest to do it by booting some other system (liveCD?) thenmaking the
new place, copying everything across and adjusting /etc/fstab

I know that /var is much more than /var/tmp. I’m not that bothered by the issue anyway as SSDs are much more wear-resistant now than the early ones. Just curious really about the constant disk writes (averaging every 5-10 seconds or so)…

Thanks, pretty straightforward really.

Yes, but I wonder why you seem to think all the time that disk activity on / is due to activity in /var. Except when you have your MySQL database on it of course.

I had a closer look with iotop, and it seems the majority of write i/o’s to /dev/sda are caused by the process jdb2, which I understand is to do with ext4 journaling…

Looks like a better analasys. Thus has nothing to to with /var.

I did not realy look into this, but I remember vaguely that there are some do’s and don’t’s around with respect to SSD devices. It could be that the advise is to turn off journaling. You could try to find some more info about this on the internet.

Some suggest disabling journals but I’m reluctant to do that because of its advantages, especially after unclean shutdowns. All the other stuff (noatime in fstab and so on) I’ve researched and already applied. That’s also when the suggestion to move /var came up…
Ah well, I’m fairly confident that the SSD will survive until I’ll buy a new, bigger, and faster one anyway, and if I hadn’t installed Conky I probably wouldn’t even have noticed! A case of too much information…

A case of too much information…

Can certainly be the case :wink:
Just enjoy the usage of the device.