I feel like I've missed something or perhaps I'm just a little dense. Quick synopsis When I installed SuSE 7.2 originally I had it create file system-partitions for /boot, /home and /. /usr, /opt and /var were all created on the / partition (/dev/hdb6) As my disk filled up I realized I needed more space. Yesterday I installed a new disk (hdc), created partitions and installed filesystems (reiser & ext2). (thanks to this list I was able to find answers to most of my questions) I created mountpoints and edited my fstab to mount my new partitions. /dev/hdc5 is mounted as /usr2 /dev/hdc6 is mounted as /opt2 /dev/hdc7 is mounted as /var2 Now I want to copy /usr to /usr2, opt to opt2 and var to var2 keeping my file permissions, user id's and symlinks intact. This seems pretty straightforward cp -ax /usr/* /usr2 cp -ax /opt/* /opt2 cp -ax /var/* /var2 Will this really work? or am I missing something? Is there a better way? Once this is done I plan to change my fstab to reflect the new assignments /dev/hdc5 will be mounted as /usr /dev/hdc6 will be mounted as /opt /dev/hdc7 will be mounted as /var If all goes well then I'd like to free up the space from the original /var, /opt and /usr directories on /dev/hdb6. How do I accomplish this as these directories are no longer mounted. Thanks to the list for all your help, I hope to return the favor. dh
Sorry for replying to my own post - I have found a problem with the "cp -ax " part of my process (see below). I tried it with cp -ax /home/mesa* /mesa2 When I finished, I compared the sizes of the two directories and found out that none of the hidden directories were copied over to the new location. Obviously I need help there On Friday 09 November 2001 01:42 pm, David Herman wrote:
I feel like I've missed something or perhaps I'm just a little dense.
Quick synopsis When I installed SuSE 7.2 originally I had it create file system-partitions for /boot, /home and /.
/usr, /opt and /var were all created on the / partition (/dev/hdb6)
As my disk filled up I realized I needed more space.
Yesterday I installed a new disk (hdc), created partitions and installed filesystems (reiser & ext2). (thanks to this list I was able to find answers to most of my questions)
I created mountpoints and edited my fstab to mount my new partitions. /dev/hdc5 is mounted as /usr2 /dev/hdc6 is mounted as /opt2 /dev/hdc7 is mounted as /var2
Now I want to copy /usr to /usr2, opt to opt2 and var to var2 keeping my file permissions, user id's and symlinks intact. This seems pretty straightforward cp -ax /usr/* /usr2 cp -ax /opt/* /opt2 cp -ax /var/* /var2 Will this really work? or am I missing something? Is there a better way?
Once this is done I plan to change my fstab to reflect the new assignments /dev/hdc5 will be mounted as /usr /dev/hdc6 will be mounted as /opt /dev/hdc7 will be mounted as /var
If all goes well then I'd like to free up the space from the original /var, /opt and /usr directories on /dev/hdb6. How do I accomplish this as these directories are no longer mounted.
Thanks to the list for all your help, I hope to return the favor.
dh
On Saturday 10 November 2001 00:11, you wrote:
I tried it with cp -ax /home/mesa* /mesa2
and found out that none of the hidden directories were copied over to the new location.
Please read this through to the end, *before* starting ;) Recently I had to do something similar (add space for the spool directory on my print-host). In the 'configuration' manual (7.1 p244) I found this bit: (assuming partitions are formatted) # cd /opt # mount /dev/hdc6 /opt2 # tar cSpf - . | (cd /opt2 ; tar xvSpf - ) man tar for the specifics of the switches. This *should* copy all files (dot-files included) to the new partition, preserving ownership/permissions et al. Check the result! If everything looks good: # cd / (just to be sure you're not in the way for the next bit of mounting/unmounting) # mv /opt /opt.old (get the old /opt out of the way) # mkdir /opt (to get a new point on which to mount the new /opt partition) # unmount /opt2 # mount /dev/hdc6 /opt (this gets your new partition mounted in the right spot) This last step (above) is prolly not really necessary, but rather a suggestion to make sure everything still looks right... (check it out by cd'ing to opt, and look around a bit) When you're satisfied that all is well, put an entry into fstab: /dev/hdc6 /opt ext2(or reiser) defaults 1 2 At this point, shut down and reboot. Verify that the new partition is mounted (in the right place) by doing: # mount if everything is o.k. you may now remove /opt.old # cd / # rm -fr opt.old That's about it... :) - Now, I suggest that you do all this in single-user mode (init 1), especially when moving /var... that way you reduce the risk of some process being in the middle of reading/writing files (logs and such) and messing stuff up. Generally when doing this kind of thing, you want as little disk activity as possible... Also I suggest you do *one* partition at a time, making *absolutely* sure everything works properly, before you do the next one... To get to runlevel 1, type linux 1 at the lilo prompt, or # init 1 at the command line I hope this covers everything... (If not, I'm sure someone will step in with corrections... ;) HTH Jon Clausen
On Saturday 10 November 2001 00:11, you wrote:
I tried it with cp -ax /home/mesa* /mesa2
and found out that none of the hidden directories were copied over to the new location.
The correct way to ensure hidden files are included is: cp -a /home/mesa /mesa2 This results in the directory /mesa2 which contains everything is the original /mesa. Regards, Terry
On Saturday 10 November 2001 04:24 am, Jon Clausen wrote:
On Saturday 10 November 2001 00:11, you wrote:
I tried it with cp -ax /home/mesa* /mesa2
and found out that none of the hidden directories were copied over to the new location.
Please read this through to the end, *before* starting ;)
Recently I had to do something similar (add space for the spool directory on my print-host). In the 'configuration' manual (7.1 p244) I found this bit:
(assuming partitions are formatted)
# cd /opt # mount /dev/hdc6 /opt2 # tar cSpf - . | (cd /opt2 ; tar xvSpf - )
man tar for the specifics of the switches. This *should* copy all files (dot-files included) to the new partition, preserving ownership/permissions et al.
Check the result! If everything looks good:
# cd / (just to be sure you're not in the way for the next bit of mounting/unmounting) # mv /opt /opt.old (get the old /opt out of the way) # mkdir /opt (to get a new point on which to mount the new /opt partition) # unmount /opt2 # mount /dev/hdc6 /opt (this gets your new partition mounted in the right spot) This last step (above) is prolly not really necessary, but rather a suggestion to make sure everything still looks right... (check it out by cd'ing to opt, and look around a bit) When you're satisfied that all is well, put an entry into fstab:
/dev/hdc6 /opt ext2(or reiser) defaults 1 2
At this point, shut down and reboot.
Verify that the new partition is mounted (in the right place) by doing: # mount
if everything is o.k. you may now remove /opt.old
# cd / # rm -fr opt.old
That's about it... :)
- Now, I suggest that you do all this in single-user mode (init 1), especially when moving /var... that way you reduce the risk of some process being in the middle of reading/writing files (logs and such) and messing stuff up. Generally when doing this kind of thing, you want as little disk activity as possible...
Also I suggest you do *one* partition at a time, making *absolutely* sure everything works properly, before you do the next one...
To get to runlevel 1, type
linux 1
at the lilo prompt, or
# init 1
at the command line
I hope this covers everything... (If not, I'm sure someone will step in with corrections... ;)
HTH
Jon Clausen
Hey thanks alot! ( especially for the thorough step by step, just what I need) This sounds like what I'm looking for, I probably won't get to try it until Monday though. I'll let you know how it goes. Thanks again dh
participants (3)
-
David Herman
-
Jon Clausen
-
Terrance Eck