Slackware This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-13-2006, 09:32 PM
|
#1
|
|
LQ Newbie
Registered: Nov 2005
Location: United Kingdom
Distribution: Sol11 > Slack12 >> XP
Posts: 29
Rep:
|
Moving /opt etc to another partition...
Hello,
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...
Your advice would be greatly appreciated!
|
|
|
|
08-14-2006, 12:07 AM
|
#2
|
|
LQ Newbie
Registered: Nov 2005
Location: United Kingdom
Distribution: Sol11 > Slack12 >> XP
Posts: 29
Original Poster
Rep:
|
OK, so this is what I'm thinking of doing - any feedback would be great esp if I'm about to wreck my setup!
Using /opt as a example
Make a new mount point for the new /opt:
mkdir /mnt/newopt
Mount it to the required partition (to be shared with /usr)
mount /dev/hdb5 /mnt/newopt
Move the old /opt files to /newopt
cd /opt
cp -ax * /mnt/newopt
Backup the old /opt just in case - once everything is ok can delete
cd /
cp opt opt.old
Create the symlinks so that Linux and software can find the /opt files
cd /
ln -s /mnt/newopt /opt
Edit /etc/fstab to reflect changes
/dev/hdb5 /opt ext2 defaults 1 2
Reboot.
|
|
|
|
08-14-2006, 12:13 AM
|
#3
|
|
Moderator
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,816
Rep: 
|
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.
http://www.tldp.org/HOWTO/LVM-HOWTO/
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...)
|
|
|
|
08-14-2006, 12:16 AM
|
#4
|
|
Moderator
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,816
Rep: 
|
What is on hdb5 now? Is it mounted?
Post your df -h.
|
|
|
|
08-14-2006, 12:31 AM
|
#5
|
|
LQ Newbie
Registered: Nov 2005
Location: United Kingdom
Distribution: Sol11 > Slack12 >> XP
Posts: 29
Original Poster
Rep:
|
Quote:
|
Originally Posted by crabboy
What is on hdb5 now? Is it mounted?
Post your df -h.
|
Hi there, thanks for your reply - I'll look into LVM since I know zero about it at the moment!
Here is the above requested:
Filesystem Size Used Avail Use% Mounted on
/dev/hdb1 1.2G 657M 426M 61% /
/dev/hdb5 12G 2.5G 8.1G 24% /usr
/dev/hda5 8.9G 8.1G 774M 92% /winpad
the last entry is a FAT32 data swap partition on another drive (for WinXP<->Linux)
|
|
|
|
08-14-2006, 01:14 AM
|
#6
|
|
Moderator
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,816
Rep: 
|
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?
|
|
|
|
08-14-2006, 04:23 AM
|
#7
|
|
LQ Newbie
Registered: Mar 2006
Location: Lille, France
Distribution: slackware 10.2
Posts: 3
Rep:
|
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.
Hope that helps.
|
|
|
|
08-14-2006, 05:34 PM
|
#8
|
|
Senior Member
Registered: Oct 2005
Distribution: Slackware 14.0
Posts: 2,961
|
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.
|
|
|
|
08-14-2006, 10:33 PM
|
#9
|
|
LQ Newbie
Registered: Nov 2005
Location: United Kingdom
Distribution: Sol11 > Slack12 >> XP
Posts: 29
Original Poster
Rep:
|
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?!?!
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:02 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|