SlackwareThis Forum is for the discussion of Slackware Linux.
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'm trying to work out what is the best way to rejig the way my 10.0 partitions are being used.
Initially I installed as follows:
/hdb2 - / This is a tiny physical partition that I intended to just use to boot the system - I was at the time confused about the 1024th cylinder limit and/or whether I could boot Linux from a logical / partition.
/hdb5 = /user This is a more substantial logical partition which is essentially empty since everything I install seems to go into /var or /opt under /
So my question: Can I move /var and /opt from under / to the partition holding /user?
Reading around here I get the impression that moving say /home to a NEW partition is easy enough but moving /home to a pre-existing partition already holding another directory isn't easy or maybe even possible...
I would suggest using the Linux Logical Volume Manager (LVM). It allows you to assign a disk or one or more partitions to a volume group. Within this volume group you can create logical partitions for each file system. The best part about it is you can add and remove space from these paritions on the fly.
In your case I'd move /usr back to the root partition by doing something like cp -a /usr /usr2 and then boot off of the CD and move /usr2 to /usr and remove the mount of /usr in the fstab. Once that is done use cfdisk to mark the old /usr partition for use with the LVM and boot and setup the LVM on that parition. You can then move any parition you wish off of root onto the LVM in its own logical partition.
I've been using the LVM for years and years and never setup a machine w/o it.
There are procedures for moving a / (root) partition to the LVM, in my experience it's not worth the effort. I always keep a small root for the the basics, and move most of the biggies off to their own partition. (/usr, /opt, /home, /var, others...)
The procedures that you stated in your second post will not work. They will copy the contents of /opt into your /usr partition, and once mounted as /opt your /usr will go away. Did you have plans to copy off /usr onto / first?
I have never tried with Slackware, but I tell you what I know about Unix in general.
Moving /var : take care.
When the system boots, it needs some of that /var tree.
Before mounting any other partition, Unix mount first /, and in single user mode you only have this / partition.
So I recommand to move only some non essential directories for unix but big, like /var/.../database for instance.
Moving /opt : no problem.
Instead of using links, you can do loopback mounting.
e.g. : you moved /opt tree in /usr/opt.
so you mount (lo option?), after /usr is mounted, /usr/opt under /opt, and you see an /opt filesystem.
I do not suggest to try this with the top of /var, but you can do it with /var/.../database.
Here is the basic approach I have used in the past:
1. If lacking sufficient drive space for the new partition, then make new space with a partitioning tool.
2. Create the new partition.
3. Mount the new partition to a temporary mount point (e.g., /mnt/opt).
4. Format and install the file system on the new partition (e.g., e2fsck).
5. Copy the contents of /opt to /mnt/opt.
6. Do not delete the /opt directory point in the root file system, but delete the contents.
7. Edit fstab to mount the new partition as /opt.
8. Reboot to test fstab.
9. Delete temporary mount point /mnt/opt.
Revise as necessary if you are using separate mount points for subdirectories in /opt.
Crabboy: No I hadn't thought of moving the contents of /usr - I was kind of working on the assumption that if you can share a partition amongst several trees when you're installing linux, that you could then manually do the same at a later time. I'm supposing that this isn't the case! I'm going to implement LVM when I have some time - looks interesting
ppoisson: I like the look of what you're suggesting here- it's simple enough for me to do and makes some sense for the time being - merci!
Woodsman - I had thought of going this way, so thanks for putting the details in - if the other ways fail I guess I'll come back and do it like this.
Besides, right now I need to figure out what the heck's happened to lilo.conf - its empty and KDE reports that its a PCX file?!?!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.