Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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 made my original /usr directory too small and it is pretty full. I managed to free some space on another drive and create a partition named /testusr that's twice as big and mount it on startup.
How would you recommend I copy /usr to /testusr and then make it so testusr is the new usr from here on out? Also, I'd like to regain the space in the now "old" usr for something else.
I tried two things:
cp -p -r /usr /testusr
-- resulted, after a long time, of /usr directory in /testusr
mount --move usr testusr
-- worked, but upon rebooting testusr was empty again
I'm sure the cp may be the way to go (WITH SOME MANIPULATION), and then going with a change to /etc/fstab afterwards, but I wanted to know if there was a foolproof way of doing this.
I think you should be able to resize the /usr partition with parted. If it's not the last partion you would first use parted to move it to the end, then resize. You'll then have a "hole" that you can add to other partions by resizing them.
I'm not really sure why the cp didn't work. Maybe it should have been
cp -pr /usr/* /testusr/
Someone who knows what they're talking about should correct me if I'm wrong...
Distribution: Distribution: RHEL 5 with Pieces of this and that.
Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700
Rep:
You are on the right track there. This is my way.
Mount the new partition like /testusr
Copy the contents of /usr to /testusr
Drop to single user mode with the ' init 1 ' command
Unmount /usr and /testusr
remount new partition as /usr
Edit /etc/fstab and change /dev/hd** to correct partitions.
Reboot.
Thanks,
I would have never guessed going to init 1. For my edification, what's the purpose of that part. I tried it first by just editing fstab and rebooting, and that did not work.
Worked like a charm.
Kurt
Distribution: Distribution: RHEL 5 with Pieces of this and that.
Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700
Rep:
init is a command to change runlevel. Linux has multiple runlevels from startup to shutdown. When the shutdown command is issued it runs the scripts in /etc/rc6.d. Not not all distro work matching runlevel numbers. Some vary as to what each is.
This list is a few of the ones based on Redhat/Fedora or similiar. Others may vary.
runlevel 1 is basic single user mode, no networking or gui.
runlevel 3 multiuser and networking
runlevel 5 multiuser, networking, and X
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.