Archive for April, 2010
Re-mounting linux filesystems on the fly.
by admin on Apr.30, 2010, under Server
You can remount a linux system on the fly like this:-
umount tmpfs
The above command will ask the OS to unmount the filesystem identified by tmpfs in the fstab file.
This may return an error if you are actively using it – i.e. you have an ssh session open and are in the filesystem or open files exist. – Exit any of these and try again
mount tmpfs
The above command will attempt to re-mount the drive.
When would you use this? Normally if you have done some dynamic re-sizing of a partition - for example the tmpfs partition – see post:
http://www.ihelm.org.uk/2010/04/resizing-ram-disk-in-linux-devshm/
for more info on how to do that.
Resizing Ram disk in Linux (/dev/shm)
by admin on Apr.28, 2010, under Server
As many people know linux has a built in ramdisk – this is temporary memory and is very very fast (as it’s in ram). AS standard linux allocates 50% of your ram to this (don’t worry if you don’t use it linux uses all your ram anyway).
However sometimes you may decide the 50% is not enough (or is too much) – especially if the server is upgradeable you may decide you would want to manage the percentage.
Below is an example default entry from /etc/fstab
tmpfs /dev/shm tmpfs defaults 0 0
This just creates the temporary system using default settings – nothing fancy – however if you want it to take 75% of your ram (or any other percentage) just change it to the code below
- reboot (or remount) and your done.
tmpfs /dev/shm tmpfs size=75% 0 0 How to unmount the tmpfs umount tmpfs To remount it with the new settings mount tmpfs