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.
This is starting to get so old...I can't do the simplest thing without asking how.
OK, this time its a simple copy from one hard drive (sda1) to another hard drive (sdb1) in the same Linux box. Easy in windows...a simple copy and paste op. I tried that with Nautilus...not even close. Is there a better file manager?
I know how to use cp:
Code:
cp /etc/fstab home/joe/mydir
would copy fstab to dir mydir. I should be able to enter:
Code:
cp /etc/fstab sdb1/mydir
would copy fstab to drive sdb1/mydir. I was dreaming, it won't even try. Where am I going wrong? How can I copy a file or directory from one disk drive to another?
I can't seem to figure anything out in Linux, so please assume I know nothing and please keep it ultra simple so I can understand.
If I enter "cp foo home/bar", cp looks for home/bar in the current ditectory. What you probably want is "cp foo /home/bar", which tells cp to copy to home/bar in the root directory (ie, /home/bar rather than current_directory/home/bar). These are only the same thing if the current working directory is /
Copying file from one drive to another is easy in Linux, as long as both drives or partitions are mounted.
Now, they are mounted but you cannot "write" files? Chances are: either you mistyped something in the syntax or that you have no permission on either of the drives.
Note: Once the drive is already mounted you must use the mount point in the syntax:
E.g. "cp /home/myname/myfile.txt /mnt/mymountpoint"
but not "cp file /home/myname /dev/sda2/mymountpoint"
About permissions you may also read and understand commands like "chmod", "chown" and their switches. Below is a link to a tutorial on Gnu/Linux you will profit much by reading it. It will not take too much of your time, but once you understand how Gnu/Linux works things will become easier for you to handle.
Also note that in Linux running as "root" is discouraged, so you have to learn the ways how to become root when needed.
hope it helps.
goodluck
Last edited by malekmustaq; 04-28-2009 at 08:53 AM.
once you understand how Gnu/Linux works things will become easier for you to handle.
Thank you for that link, and I will be looking at it. "easier" sounds really good.
Quote:
you have to learn the ways how to become root when needed.
From the little I know, in Ubuntu you are a "normal" user unless you choose the "root console" from applications > system tools. I normally use "sudo" at the "normal" console unless I am planning on a lot of root commands. I don't know of any way to login as "root".
billymayday
Quote:
Note also the use of a leading "/".
Thank You!...from what I have read that's called "absolute (/)" or "relative" paths. I almost always use absolute paths to be safe for now, even though it means more typing.
ozminh
Quote:
you should 'cp source /media/backdrive/..' instead of 'cp source /media/sdb1/..'
Fantastic suggestion, thank You!!!
I will be trying your suggestions very soon...Thanks again to all.
I always recommend creating such mountpoints in one's home directory, makes things a bit more manageable. You may still need to grant yourself write permissions, though, the first time a newly added partition is mounted (sudo chown -R $USER:$USER mountpoint).
In Nautilus I can't copy, cut, rename, move to trash, delete, or paste to the second drive (backdrive). I can do all this from the console. For Example to copy a file from Desktop to second drive I use:
Code:
cp /home/joe/Desktop/filex /media/backdrive/
to delete:
Code:
rm /media/backdrive/filex
ans so on. I think, this tells me I have permissions on the files, So why can't I do this in Nautilus?
In Nautilus I can't copy, cut, rename, move to trash, delete, or paste to the second drive (backdrive). I can do all this from the console. For Example to copy a file from Desktop to second drive I use:
Code:
cp /home/joe/Desktop/filex /media/backdrive/
to delete:
Code:
rm /media/backdrive/filex
ans so on. I think, this tells me I have permissions on the files, So why can't I do this in Nautilus?
Thanks in advance.
A simple way to find out is to use Nautilus and right-click on a file you can't delete. A menu will appear and you select "Properties". You should see some tabs appear in a window that opens and select "Permissions".
What are the permissions set for? Owner? Group? Others? The window will also tell you who owns the file. You should be able to figure out what's wrong from that information. If you still don't understand report back the information that Nautilus gives you regarding permissions and ownership of the file in question.
Cheers,
jdk
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.