Multiple Mounts for a device and move File systems
Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
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 see exactly what you're saying however, for each mount I'm using a different mount point/subdirectory. I guess my question is I want to move /var, /temp, /usr/local, /opt and /usr to a device with more disk space once Linux is installed.
The device is not present when I initially install Linux. The software raid device is created afte the install. Therefor, I want to use the software raid device by moving some standard linux directories to a device with more disk space.
Based on my first post and this one how do I accomplish my goal?
Originally posted by louisb
I see exactly what you're saying however, for each mount I'm using a different mount point/subdirectory.
Yes and you're just going to break things. A single device is meant to contain a single filesystem. If you mount /dev/md0 on /tmp and /home, you'll see the same files in both places. If you delete a file from /tmp it'll disappear from /home as well.
Quote:
I guess my question is I want to move /var, /temp, /usr/local, /opt and /usr to a device with more disk space once Linux is installed.
Either partition that device into as many mount points as you want or fold them back into one mount point.
Quote:
Based on my first post and this one how do I accomplish my goal?
Mount /dev/md0 somewhere and copy all of the data from your current fs there one mount point at a time.
Ok is understand what you're telling me. I can copy the /var, /opt, /usr, /usr/local, and /temp to the md0 device. How do I tell the Linux Kernel/system to use the directories on the md0 device instead of the orignal mount points?
Originally posted by louisb
Ok is understand what you're telling me. I can copy the /var, /opt, /usr, /usr/local, and /temp to the md0 device. How do I tell the Linux Kernel/system to use the directories on the md0 device instead of the orignal mount points?
Thanks
Tell it to use /dev/md0 as root, you'll need an initrd if you don't have everything you need in the kernel.
Does that mean I have to create an initrd file that will move the appropriate sub-directrories on the md0 device? After I've copy them to the md0 device.
I guest the basic question here is how do I get the startup of Linux to look at the directories on the md0 device instead of those located on the file systems that were created during the install.
I really appreicate all of the help you are giving me here. I'm still new to Linux.
No, the initrd would be used to start /dev/md0. If your kernel doesn't have the RAID autostart stuff in it, you would need the initrd to bring /dev/md0 up before everything else since it'll be holding the root filesystem.
After you copy all of the files from the old filesystems, in your bootloader (Grub or LILO) you'll need to change the root= line to use /dev/md0 and you'll need to change /etc/fstab.
I only wanted to have /var, /temp, /opt, /usr/local and /usr copied to /dev/md0. These files systems seem be affected the most when programs are added.
There are a number of files located in the /usr sub-directory that support system start-up as well as used when I do a rebuild using RPM sources. That being the case I wanted to make sure that the above files systems had lots of space. Since /dev/md0 contains 1.3TB of space.
What sparked this I was doing an rpmbuild for OpenOffice and ran out of disk space on the /usr file system during the build. Therefor, I wanted to move them to a device with plenty of disk space.
So when ever references are made to the above sub-directories I want the directories on the /dev/md0 to be used or written to.
Well just copying those won't be easy since their common parent is / and you don't want to put / on there.
You could create directories for them all on /dev/md0 and then create symlinks off of /, so /usr would be a symlink to /mnt/raid/usr or something but that's ugly.
Are you using an initrd already?
Do you know when the RAID device comes up? The kernel can be setup to detect and startup RAID devices without any help from an initrd, but I don't know if RH does it like that or not.
I'm using mdadm at a raid5 level. Once I configured the raid using command line from there the kernel knows about software raid. I have not made any config changes.
What I'm getting at, is that if you're not already using an initrd and you need one, they're a bit of a pain to setup. If the kernel RAID autostart stuff is there you won't need one and it'll be a lot simpler.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.