You are not logged in.
I've been trying to move /usr to a new disk. I did this:
rsync -a /usr /usr /new_disk
changed fstab so the new disk was mounted as /usr
telinit 1
mv /usr /oldusr
reboot
Now I get this error at startup:
/bin/bash: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
Then startup hangss with "respawing too fast" messages.
If I move back /oldusr to /usr (using knoppix) everything works fine again.
Some got an idea of what's happening?
Last edited by ftornay (2009-02-05 22:13:45)
Offline
If you are moving a directory from one location another all files permission status are to be maintained. The best way is using cpio command.
This link http://www.psychocats.net/ubuntu/separatehome will give an idea how to move your /home directory from one partition to another. In the same way you can try for your /usr directory.
Don't delete your original /usr directory unless you are satisfied with the result you want.
Offline
I just found a mistake I made. My rsync command copied usr to a --subdirectory-- called usr at the new disk, not its root folder.
As a matter of fact, I made a previous attempt in which usr was correctly moved. That try probably failed because I used rsync -r rather than -a (which preserves ownerships and that). I'll move usr to my new disk root directory using rsync -a and tried again.
I'll keep you posted in case someone's interested. Thank you anyway to those of you who read this and thought about it.
Offline
Still no luck
I've made sure usr was correctly copied to the new disk. I'm able to mount it as usr manually from the shell and my fstab line works without problems when I mount the disk under another name and keep my old usr.
But when I try to reboot after renaming usr and changing fstab to mount the disk as /usr I get the same libncurses error at startup.
Any pointers?
Thanks in advance
Offline
Thanks, kgas. I just read your post. I'll try the solution you mentioned but I'm rather sure rsync -a keeps permissions as well.
Offline
At this play they insist on using rsync for the task and explain why
https://help.ubuntu.com/community/Parti … ome/Moving
Since I'd like to find a convenient way of moving usr, I'm going to try the options that are suggested at this site: rsync -axS. At the same time, I've moved the fstab line that mounts /usr to just below the one that mounts / Above that which mounts /home, rather than below that. Does that make any difference?
At any right, I still don't understand why the system complains about not finding linbcurses. If it were a permission problem, shouldn't the error message state it explicitly?
Offline
Update:
I've done the whole process again. Now I'm pretty sure it's not a permission problem. I mounted again the disk manually as /usr (in runlevel 1), then went back to use the desktop without rebooting: everything was perfect.
Then I rebooted. I got a message about "could not unmount /usr, it's busy' or something like that before the power went off.
At the startup I still got the same message about libncurses before the process hanged, just as before. But this time I've noticed that the root gets mounted and then bash tries to read libncurses, apparently without trying to mount /usr first!!!
That could be the problem Why is that so? Is there a file that controls the startup process, mounting order, etc.? I had a look at inittab but there doesn't seem to be anything like that.
Offline
/bin/bash: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
This file is likely a symlink pointing to libncurses.so; does your rsync command copy symlinks too?
M*cr*s*ft: Who needs quality when you have marketing?
Offline
Yes, it does. I even run a rsync -aH to copy hard links.
Offline
Is there a way to look for all links pointing to libncurses in the system?
Offline
I found a link at /lib called libncursesw.so.5 pointing at libncursesw.so.5.6 which also exists at that folder. I moved both to my home folder and replaced it with links to their /usr/lib counterparts. I'm gonna try again and see whether the error message changes.
Offline
I did it!
Changing the libncursesw I told you made things worse: even going back to console mode without moving /usr did not work.
So I copied the old files back to /lib and I also copied all libncurses* files from /usr to /lib
Now everything works!!!!!
It seems the startup process needs to find libncurses libraries before mounting the other filesystems.
I hope my experience can help someone in the same case because I don't think there's documentation about this, or at least it's not easy to found.
Offline
Most people have no need to separate /usr from their root partition.
Glad you figured it out, though. Please consider marking this thread as [SOLVED].
M*cr*s*ft: Who needs quality when you have marketing?
Offline
Yes, I guess it's not something you do very often.
I sure would like to mark the thread as solved but I can't figure out how to do it. I'm a newbie at the forum.
I guess I'm just too tired at this time. I'll keep trying tomorrow. Howeve, if someone could just tell me, I'd be thankful.
See you,
Offline
It's done! It was simple, as I said I wa just too tired (it's 23:14 pm here).
Offline