Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i have a directory, say /home/foo/data which is on partition A and is used by a program that runs 24/7 and produces lots of output data into this directory.
Now the space becomes too little.
I got more free space on another partition and create a directory /mnt/other/bar
on this one.
Now i want to combine those directories.
-> That means, extend the space in /home/foo/data with space borrowed from /mnt/other/bar
The running program can not be changed - so the change should be transparent.
Also i cannot move the old data to the other partition because there is not enough space -> i just need some more space from it.
example:
Filesystem Total Size Free Space Mount Point
--------------------------------------------------------------------
/dev/hdb1 80GB 1GB /home/foo
/dev/hdc1 40GB 39GB /mnt/other/bar
does anyone know how to "merge" those directories?
If you mount /mnt/other/bar into /home/foo You will not be able to get to /home/foo/data anymore (data is still there just not accessible). If you looked at /home/foo after mounting the directory it would hold /mnt/other/bar's data. Once you unmount /mnt/other/bar the contents of what were in /home/foo/data will be back. .. so mounting it will allow you to increase the space but at the price of not being able to access /home/foo/data until /mnt/other/bar is unmounted.
Not sure how safe that is to do though.. Ive done it before by accident and had no problems.
He would want to keep those existing logs/data would you not? So creating that link would require removing the old log/data, and he said he could not copy it over since it is larger than the drive.
I cant think of anything else that could help you out. Unless you got another partition on that same drive that you can enlarge that partitioin into..
Zero-0-Effect is right, i cannot move the files from /foo because they are too large for /bar. AND i need access to them so zipping em will not solve my problem.
I know this is a very weird case and maybe there is simply no solution possible at all
I know this is quite old but it's apparently unanswered so I figured I'd answer it in case someone else found the page via a google search or something.
'mount' provides a '--bind' option that allows you to bind something to a given directory. If you can momentarily pause the logging or whatever is writing data then you can copy everything there to a directory on the partition with plenty of space and then bind-mount that directory to your logging target. Then the logging can continue to log to the existing files as they are actually being updated on the partition with more space. This works as a decent temporary solution when you need something done NOW and works well with syslog-based logging on systems with very little space(e.g. embedded configurations). At a later point you really should make a better solution for the situation(e.g. changing the logging directory in some configuration or symlinking the directory desired, etc.) and not rely on this approach to serve you permanently. Keep in mind that this all gets undone if the machine reboots(info is still saved, but the bind-mount goes away).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.