View previous topic :: View next topic |
Author |
Message |
printf Tux's lil' helper
Joined: 02 Dec 2010 Posts: 123
|
Posted: Tue Sep 10, 2013 8:10 am Post subject: [Solved] conditional mounting |
|
|
i have a notebook with an ssd used for / and /home
it came with a docking station that has an ultrabay, where i put a normal hdd.
i would like to use a partition of the docking station's hdd as /var/tmp/portage (so it wont hurt the ssd)
but i want to disable /var/tmp/portage altogether when the notebook is not docked (optionally i could mount it as tmpfs if i absolutely need to install something on-the-go)
is this possible?
i know that then i will have to set up different scripts when it is removed from the docking station, but first i would like it to see that it has the hard drive with the correct uuid and mount it or disable /var/tmp/portage or redirect it somewhere so nothing gets written to the ssd
Last edited by printf on Wed Oct 16, 2013 12:32 pm; edited 1 time in total |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54300 Location: 56N 3W
|
Posted: Tue Sep 10, 2013 9:11 am Post subject: |
|
|
printf,
In /etc/fstab, use the noauto option for the line that is used for the /var/tmp/portage entry.
When the hdd partition is mounted there, you will use the hdd. When its not, /var/tmp/portage will be in /
You will need to mount /var/trmp portage by hand when you want to use the hdd.
Alternatively, ignore the error message when the hdd is not present.
If you have 4G RAM or more, then /var/tmp/portage can be in RAM for all but the biggest packages. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
printf Tux's lil' helper
Joined: 02 Dec 2010 Posts: 123
|
Posted: Tue Sep 10, 2013 11:07 am Post subject: |
|
|
NeddySeagoon wrote: | ...
When its not, /var/tmp/portage will be in /
... |
that is what i would like to avoid, if the hdd is not presend somehow disable access to /var/tmp/portage to avoid any accidental write to the ssd
NeddySeagoon wrote: | If you have 4G RAM or more, then /var/tmp/portage can be in RAM for all but the biggest packages. |
i have 4 gb ram, but i just dont need portage in memory all the time when i only do an update once in every 2 weeks/1 month |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 21708
|
Posted: Tue Sep 10, 2013 10:15 pm Post subject: |
|
|
You could mount a very tiny tmpfs on /var/tmp/portage, then overmount it with the HDD when available. Any attempt to access it when the HDD is unmounted would immediately encounter a "No space left on device" error. |
|
Back to top |
|
|
printf Tux's lil' helper
Joined: 02 Dec 2010 Posts: 123
|
|
Back to top |
|
|
Akkara Bodhisattva
Joined: 28 Mar 2006 Posts: 6702 Location: &akkara
|
Posted: Wed Sep 11, 2013 7:45 am Post subject: |
|
|
You can also mount something on it, but read-only. No writes will happen. |
|
Back to top |
|
|
|