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.
How do I copy the contents of a folder(files and subfolders) to a directory or a mount point?
For example; I want to move /usr to a new partition, without altering permissions, symlinks or anything else, so I would then write:
cp -av /usr /mnt/newpartition
However, this will create a usr-directory on newpartition, which I don't want(because if I then mount the new partition in /usr the path to all the files would be /usr/usr).
I bet its so simple its embarassing, but I really cant figure it out...
Note the added -r. That will make the copy recursive so that not only files will be copied, but any directories and the files they contain will be copied as well. Since you are copying /usr, I am assuming you want every file and directory under it as well.
Heres a bit of an unrelated question, but I dont want to start a new topic just for this...
The thing is I have moved my Gentoo installation to different harddrives. I have pretty much backed up /, /usr and /home, switched harddrives and moved the files back again. Hopefully this will work. One thing that remains though is installing Grub to /dev/hda(one of the drives that were replaced).
When I installed Gentoo I ran this command, before installing Grub, in a chrooted environment:
grep -v rootfs /proc/mounts > /etc/mtab
Now im just booting from a livecd. Can I run this even though im not chrooted? That would make my life a bit easier as im feeling quite unsure of how the chrooting is done properly.
You want to start a new topic, so that those that have the answer will see the question. Burying it at the bottom of a solved thread will get no attention. It also makes it much harder for people to search, to find the answer themselves (which I assume you'll do, since installing grub from a bootcd is a common question).
Oh, sorry - I forgot to search. Happens easily when I start to approach things in an unnecessarily complicated way(that is, looking in the Gentoo handbook about installing Grub... reading strange commandlines and "chroot" - uh oh! confusion, etc. et al - "I better ask on this board"!). Yeah, well, sometimes my brain works that way so I need to be reminded to search. Thanks!
It was really a piece of cake. Mount root-partition, cd to /boot/grub, run 'grub' the, 'root (hd, partition)' and 'setup (hd)'(where you want Grub installed in mbr).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.