You are not logged in.

#1 2012-12-02 15:49:09

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

binding HDD directories to SSD home folder

I've recently purchased an SSD (240gb) and reinstalled Arch from scratch. I put everything on the SSD (root, /home, and so on) but I plan to use the HDD for /Pictures, /Downloads, /VirtualBoxVM and few others.

I was thinking to create symlinks for those directories from the HDD to my user's SSD /home. Is this a good practice? Is the SSD stressed anyway? I have the feeling that there must be a better fstab voodoo I could do... something like:

UUID=1bba81b1-c5ae-470f-9b43-3cad451fab6c	/mnt/hdd	ext4      	rw,relatime		0 2
/mnt/hdd/Downloads		/home/matteo/Downloads		none		bind,rw		0 0
/mnt/hdd/Pictures		/home/matteo/Pictures		none		bind,rw		0 0
...

bear with me if this is complete bullshit

Offline

#2 2012-12-02 15:59:10

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: binding HDD directories to SSD home folder

This is what I was doing as well when I had an mSATA SSD and my Seagate Momentus XT.  I started off using symlinks, but I ended up with bind mounts... I can't remember exactly why I switched, but it seemed cleaner to me.

I think all the FUD surrounding SSD lifespan is really pretty unfounded with todays SSDs.  You really don't have to worry about killing them these days.  For instance, if you have a drive rated for 5k writes, that means that you could really write around 5GB a day everyday for 10 years or something like that.  5GB may not seem like much, but unless you are using it for something that involves contant writing, normal usage will not achieve that.

I do think that your idea of having the root of your home folder on the SSD is a good one.  I did this as well, for the same reason as I thought it was a good idea to have /etc on the SSD.  Access time to configs is just way faster.  I think the motivation behind continuing to use a HDD is just the space it provides.  That and the access time necessary to play a HD movie is still sufficiently provided by a normal HDD, and pictures and music are in the smae boat.

Edit: I didn't realize that you hadn't put that sutff in your fstab. Do it!

Last edited by WonderWoofy (2012-12-02 16:00:25)

Offline

#3 2012-12-02 16:10:16

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

Re: binding HDD directories to SSD home folder

Thanks for your feedback the fstab way seems way cleaner.

Is the fstab syntax I posted correct? I'm a bit scared of playing with fstab smile

Edit:
I just tried and the fstab seems to work, but now Nautilus shows all bind directories as mountable devices. Is there a way to hide them from Nautilus?

Last edited by Matt3o (2012-12-02 16:44:58)

Offline

#4 2012-12-03 05:27:59

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: binding HDD directories to SSD home folder

I don't use nautilus... but I might try putting 'nouser' though I am not sure that this is something that will override whatever user mounting service you have running. 

Edit: Also, you don't need 'rw' as this is the default.  You would only need to specify 'ro' if you wanted that.

Last edited by WonderWoofy (2012-12-03 05:28:39)

Offline

#5 2012-12-03 08:57:36

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

Re: binding HDD directories to SSD home folder

Unfortunately nouser doesn't seem to have any effect. I searched all over the interweb and I start to believe that there's no real solution to that issue...

Offline

#6 2012-12-09 00:10:39

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: binding HDD directories to SSD home folder

I just did a clean install in order to do this very thing (among other, less practical reasons), but currently have an entire HDD mounted to /media and symlinked.  Looking at the idea of binding the mounts in fstab:  Where would the "cleanest" mount point be for the disk itself-- /mnt, /media or /run/media?  For the moment I can just keep doing it through /media and just add the extra info, but it's my (very possibly mistaken) understanding that eventually, /media may done away with.

I know /run is a tmpfs directory and /run/media is where udisks2 currently mounts external disks by default (if "udisksctl mount --block-device /dev/sdx" is passed), so would mounting at /run/media currently present any issues for unmounting at reboot/shutdown (the udisks man page is scant on the issue)?  I wouldn't think so, but /run is fairly new, and seems intended mostly for temporary application use, so I'm just a bit wary of using it without a little feedback first.

Offline

#7 2012-12-09 00:45:44

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: binding HDD directories to SSD home folder

Really, probably any way you want to do it is fine.

However, the "cleanest" way would be to partition the HHD and actually mount them. You could use LVM so you can grow the size of the Logical Volumes as needed.

/dev/sdb1     /home/user/Videos     ext4     rw,nodev,noexec,nosuid,uid=1000,gid=100,mode=700,noatime,errors=remount-ro 0 2
/dev/sdb2     /home/user/Pictures     ext4     rw,nodev,noexec,nosuid,uid=1000,gid=100,mode=700,noatime,errors=remount-ro 0 2
/dev/sdb3     /home/user/Downloads     ext4     rw,nodev,noexec,nosuid,uid=1000,gid=100,mode=700,noatime,errors=remount-ro 0 2
/dev/sdb4     /home/user/VirtualBoxVM     ext4     rw,nodev,noexec,nosuid,uid=1000,gid=100,mode=700,noatime,errors=remount-ro 0 2

Or one Big partition and have your extra directories in there

/dev/sdb1     /home/user/extra     ext4     rw,nodev,noexec,nosuid,uid=1000,gid=100,mode=700,noatime,errors=remount-ro 0 2

Or just mount it to /mnt and symlink it or bind them (ya, I would use /mnt not /media to avoid conflicts with udisks)

/dev/sdb1     /mnt     ext4     rw,nodev,noexec,nosuid,uid=1000,gid=100,mode=700,noatime,errors=remount-ro 0 2

I don't know about nautilus, but with KDE's Dolphin I can Right-Click on a device and select "Hide"


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#8 2012-12-09 02:42:26

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: binding HDD directories to SSD home folder

Thanks, hunterthomson. Not using a DE or graphical file manager, and I mount external disks manually with udisksctl, so that's not an issue. wink Rejiggering the filesystem to use LVM might be more than I want to bother with. I've currently just got a single partition, and was planning on mounting individual directories to empty ones in /home/$USER, as Matt3o did (so, the third option you mentioned).  Just didn't want to change fstab and mount them now, then find out on reboot I botched something.

Offline

#9 2012-12-09 05:19:41

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: binding HDD directories to SSD home folder

That sounds like it will work just fine.

There is no need to worry about editing fstab. It is true that systemd will not boot if ANY partition listed in fstab can not be found, (I found that out the hard way... which makes not sense to me.) If you ever ran into a problem all you would need to do is boot into a live CD and fix it. So, just like either comment out lines you change or back up the file first.

Last edited by hunterthomson (2012-12-09 05:23:14)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#10 2012-12-09 05:40:12

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: binding HDD directories to SSD home folder

@ANOKNUSA, if you are willing to use btrfs, you could always use btrfs subs and mount those.

Offline

#11 2012-12-09 08:23:17

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

Re: binding HDD directories to SSD home folder

it seems that bind mounts really piss nautilus off. Mount points are shown under the device panel, so I removed them from fstab and loaded the mount points from a script at boot. The problem is that nautilus doesn't seem able to handle Trash bins correctly for each mount. Trash bins are not flushed when clicking on "Empty Trash" even though files are placed in the correct directory (.Trash-xxxx) for each mount.

As far as I can tell, if you plan to use Gnome bind mounts inside the user folder is a no-no.

Offline

#12 2012-12-09 16:38:11

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: binding HDD directories to SSD home folder

@ WonderWoofy: I do use btrfs on the system partition on the SSD, but not the storage partition on the HDD.  I'll almost certainly convert the HDD at some point (guessing I'll need to in order to use subvolumes between the two disks anyway; haven't actually done any btrfs research in almost a year, so I'm kinda out of the loop). For now, I just want something more solid and less abstract than a symlink.  Thanks, though.

Offline

#13 2012-12-09 16:53:35

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: binding HDD directories to SSD home folder

Yeah, I understand the symlink thing.  The issue I had was that if I were to use sftp and have any user chrooted to their own home directory, a symlink to some far off place in the filesystem would obviously not work.  But if I bind mounted them, they would be there, and working great. 

What I am suggesting is instead of huntertompson's suggestion of LVM and separate partitions for each directory, you could use btrfs. So creat a subdir for music, one for movies, etc and then actually mount the subvols insetad of mounting separate LVM partitions.  Essentially you come out with somethign very similar whether you use LVM or btrfs, but with btrfs, you don't need to worry about provisioning space to each partition, as it just alots as needed.

Recently I have been reading about thin-provisioning with LVM and it sounds like it achieves the same thing.  But LVM has to be compiled with it enabled, as it does not do it by default.  I have been wanting to try it, but haven't gotten around to setting up a test bed for it.

Offline

#14 2012-12-09 18:44:06

Matt3o
Member
From: Firenze, Italy
Registered: 2007-09-13
Posts: 177

Re: binding HDD directories to SSD home folder

btrfs seems promising but I admit that...

experimental copy-on-write file system for Linux. Development began at Oracle Corporation in 2007. It is still in heavy development and marked as unstable.

... is a bit scary smile

Offline

#15 2012-12-09 19:32:06

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: binding HDD directories to SSD home folder

I have been kind of putzing with btrfs for some time, knowing full well I am not using it to its fullest potential, but I have not experienced any issues with it.  I would really like to use zfs, but can't get past the idea of haing to recompile the module on every kernel update (or rather the chance of forgetting and ending up with an unbootable system).

Offline

#16 2012-12-09 23:08:52

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: binding HDD directories to SSD home folder

hunterthomson wrote:

There is no need to worry about editing fstab. It is true that systemd will not boot if ANY partition listed in fstab can not be found, (I found that out the hard way... which makes not sense to me.) If you ever ran into a problem all you would need to do is boot into a live CD and fix it. So, just like either comment out lines you change or back up the file first.

You probably didn't wait long enough. It takes ages to time out (5 min?) but it does carry on eventually if you wait it out - no need for a live media. (Though if you have one, it might be quicker!)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#17 2012-12-10 01:58:35

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: binding HDD directories to SSD home folder

I think somewhere there is a setting to control the timeout.  I've never had the need to find it though.

Offline

Board footer

Powered by FluxBB