How to use bind mounts in linux
Tags: bind, fstab, howto, linux, mount, partition, storage, sysadmin, tips, unix
Have you ever dealt with a system that wasn’t partitioned properly when it was built and now it has gone into production? You’ll probably be hard pressed to find the time and patience to rebuild the system any time soon. Luckily there is a way to step around many of the limitations of a poorly partitioned system using bind mounts.
Bind mounts are quite simple. Instead of mounting a device (with a file system) on a particular path you are mounting one path into another path.
For example: Let’s say you have a small /var but a very large /opt partition and you need additional space for your growing log files.
First, shut down the services writing to log files, then…
You will now see this reflected when running the mount command:
At this point you are ready to restart the previously stopped services.
If you want this to persist across reboots, you’ll just need to update your /etc/fstab with the bind mount as well.
And there you have it! Its not beautiful, but it will help you keep the lights on until you can get a long-term fix in place.
More details about bind mounts
From the man page on ‘mount’.
From the man page on ‘mount’.
'OS > Linux' 카테고리의 다른 글
Oracle 12c CentOS 7에 설치 (0) | 2018.10.04 |
---|---|
특정폴더 마운트 fstab (0) | 2018.09.30 |
특정파일이나디렉토리를제외하고 모두 삭제하기 (0) | 2018.09.30 |
모니터 끄기 명령어 (0) | 2018.09.26 |
[Ubuntu] 우분투 방화벽(UFW) 설정 (0) | 2018.09.23 |