How to copy files from one hard drive to another? SOLVED

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
drrdf

How to copy files from one hard drive to another? SOLVED

Post by drrdf »

In the more recent versions of Mint, and I presume also Ubuntu, it seems to have become impossible to copy or move files from one hard drive to another. This was not so in earlier versions. So when the capacity of one drive becomes near to full, it is not immediately possible to move the excessive files to another drive. Mint seems to impose administrator permissions on a new drive but will not let you change the permssion, nor open another drive as Administrator, claiming that you are not the owner, even where you actually are. This seems to be becoming increasingly ridiculous?

How on earth can you overcome this if Mint will not allow you to open a new drive as Administrator? Do you just have to wait until your existing drive becomes completely full and your PC will then not operate any longer, and then throw it away?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
kyphi
Level 9
Level 9
Posts: 2735
Joined: Sat Jul 09, 2011 1:14 am
Location: The Hunter Valley, Australia

Re: How to copy files from one hard drive to another?

Post by kyphi »

What methods have you tried to move files from one drive to another?

For what it is worth, I have 3 internal drives and one external drive and have no problem at all with transferring files from one to the other if I wish.
I also back up my home directory at least once a day to another drive.

This has nothing to do with versions of Linux Mint or Ubuntu - it is a very basic Linux manoeuvre.
Linux Mint 21.3 Cinnamon
drrdf

Re: How to copy files from one hard drive to another?

Post by drrdf »

Hi kyphi,

So far I have only tried normal copying by either dragging and dropping or copy and paste from my main drive to the other. When I try to do that I get an error message stating that I do not have the permission to do that. I have a similar problem with attempting to delete files on a usb back-up hard drive which I also have intermittently connected. The system will also not allow me to open any of these files as Administrator nor to delete files on the second drive. I have tried to change the permissions but it will not let me do that either. Of course something has been done to prevent logging in as Administrator now in the previous manner in which you could, it seems in versions after 13 Maya.

If all else fails I shall just have to use a file manager without Mint running at all to do it. It does not seem sensible that it should have come to that though. (BTW I also have a couple of cloned drives for OS back-up purposes, and having tried one of those to run up Mint the situation is exactly the same; so it is clear that the problem is not just due to the system on my main hard drive.) In any case there does not seem to be any sense in the developers writing this restriction into Mint now, when users can use other means to override it anyway? The question is really, why has this change been implemented, so that the system can no longer be used in what would be considered a normal manner?
chiefjim
Level 6
Level 6
Posts: 1157
Joined: Sun Jun 07, 2009 7:26 am
Location: South Texas, USA

Re: How to copy files from one hard drive to another?

Post by chiefjim »

Permissions can be a tricky subject. In this case you need permission to access the files being moved and their destination. We're talking permissions set for both the host and destination folders.
Mint-21.0 Mate 64 bit / LMDE-5 64 bit
Gigabyte H370M D3H
Intel G3258
Crucial Ballistic Sport 32GB DDR4 2400
8TB HDD Seagate Baracuda 5400rpm
drrdf

Re: How to copy files from one hard drive to another?

Post by drrdf »

Hi chiefjim,

Yes I agree, but somtimes if permissions are set without your knowledge it can make things even more difficult. I have discovered what the cause of this problem is, but I do not yet have a solution. For some reason when the secondary drives were formatted, without any OS of course, in ext3, the permissions were set as Administrator only, without my knowledge of that occurring. Since the system will not allow me to open these as Administrator I cannot change the permssions. That is the nub of the problem. How can I now change the permssions of these new drives to allow a user to copy files over?
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: How to copy files from one hard drive to another?

Post by altair4 »

I can't really follow your symptoms since what you are describing is not how Linux works. A newly formatted Linux partition is automatically owned by root ( not administrator ) with read access to everyone else. If you want to change that then alter permissions of the mounted partition to allow it:

*** To make it writeable to you and readable to everyone else:

Code: Select all

sudo chown drrfs /media/whatever-the-mount-point-is
*** On the other extreme you can make it avaiable to everyone to write:

Code: Select all

sudo chmod 0777 /media/whatever-the-mount-point-is
Better yet since this is an internal partition have it automount at boot. To do that:

[1] Run the following command to find out how the system sees your partition:

Code: Select all

sudo blkid -c /dev/null
[2] Create a mount point for the partition to live in:

Code: Select all

sudo mkdir /media/Data
[3] Edit /etc/fstab as root:

Code: Select all

gksu gedit /etc/fstab
[4] Then add the following line at the end of that file:

Code: Select all

UUID=076426af-cbc5-4966-8cd4-af0f5c879646 /media/Data ext3 defaults,noatime 0 2
NOTE: Change 076426af-cbc5-4966-8cd4-af0f5c879646 to the UUID number you found by running the command in step [1].

[5] If you have the partition currently mounted unmount it.

[6] Then run this command to have it mount with the new instructions in fstab:

Code: Select all

sudo mount -a
[7] Finally and only after the partition is mounted change permissions to serve your needs:

*** To make it writeable to you and readable to everyone else:

Code: Select all

sudo chown drrfs /media/Data
*** On the other extreme you can make it avaiable to everyone to write:

Code: Select all

sudo chmod 0777 /media/Data
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
drrdf

Re: How to copy files from one hard drive to another?

Post by drrdf »

Hi altair4,

Thanks for your reply. I presume you mean the error which I made in using the term "Adminstrator" instead of "root" indicated to you a problem in following my symptoms? I apologise for that, but after years of working with many other OSs in a professional capacity (including VAX-VMS) the mind gets stuck in a rut!

Since originally posting this problem I have discovered that many other users are having the same problem with later versions of Linux. It is due to the fact that after Mint 7 for example you are not allowed to open any drive or file as root in a straightforward manner within the GUI. This facility has evidently been now prohibited. Also now when you first mount a newly formatted additional drive it is automatically changed to make write permissions for root only, without informing you of this, nor obtaining your permssion as the owner of the drive and/or files to do so. This evidently occurs at the moment of mounting, not at the moment of formatting as you imply, particularly if you format the new drive using an external utility in ext 3 or 4. It seems to be all part of the present reversion to make Linux accessible to geeks only again and not to normal users?

I have tried your suggestion of entering sudo chown drrfs /media/Data, but that does not work. I get:

drrdf@DRDAF700 ~ $ sudo chown drrdf /media/Data
chown: cannot access `/media/Data': No such file or directory

or if I enter the full: $ $ sudo chown drrdf /media/Data

I get:

drrdf@DRDAF700 ~ $ $ sudo chown drrdf /media/Data
$: command not found

It seems that the solution is to enter:

sudo chmod 777 /dev/hda1/pathbname or whatever?

So really this is a problem now for anyone who adds any new hard drive to their system, and quite a few others are complaining of it in Linux generally now. What we really need for normal users (who are not and do not want to be Linux geeks) is a clear unambiguous procedure to be followed to add a hard drive, and then to be able to write to it with a current Linux MInt OS.

I am now going to try what I think might work, to circumvent this current nonsense. I am going to run Linux Mint 7 or another earlier version of Linux from a dvd and then change the permssions in the GUI, as you used to be able to do. This is really becoming quite pathetic, and is enough to drive people back to Windows!
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: How to copy files from one hard drive to another?

Post by altair4 »

It seems that the solution is to enter:

sudo chmod 777 /dev/hda1/pathbname or whatever?
And that would be the wrong way to do this.

Your other error message appears to be caused by not creating /media/Data to start with. And if you did this without adding anything to fstab your partition isn't mounted at /media/Data.

Why not just use Windows?
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
WinterTroubles

Re: How to copy files from one hard drive to another?

Post by WinterTroubles »

change the permssions in the GUI, as you used to be able to do
I'm on Mint 16 cinnamon and can do exactly that. Open nemo as root, right click the device/directory/file in question, select properties, open permissions tab.....

Of course not everyone uses nemo, but, changing permissions in GUI is certainly possible with modern Linux Mint.
User avatar
austin.texas
Level 20
Level 20
Posts: 12003
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: How to copy files from one hard drive to another?

Post by austin.texas »

drrdf wrote:Thanks for your reply. I presume you mean the error which I made in using the term "Adminstrator" instead of "root" indicated to you a problem in following my symptoms?
No, that was not it.
drrdf wrote:I have tried your suggestion of entering sudo chown drrfs /media/Data, but that does not work.
It did not work because you skipped the part about creating a mount point.
drrdf wrote:I am now going to try what I think might work, to circumvent this current nonsense.
Now we have identified the problem. You want to make it work the way you want it to work instead of finding out how it is structured and how it is supposed to work.

It is true that your file manager does not display on the side panel any partitions that are not mounted, while they are displayed in the side panel of the users file manager. And I agree that that is odd. It didn't bother me too much to find that out. But there are some avenues to suggest changes in Mint or Nemo that you could go to.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
User avatar
kyphi
Level 9
Level 9
Posts: 2735
Joined: Sat Jul 09, 2011 1:14 am
Location: The Hunter Valley, Australia

Re: How to copy files from one hard drive to another?

Post by kyphi »

sudo chown drrfs /media/Data
Should that not read

Code: Select all

sudo chown <username> /media/Data
where username = drrdf and not drrfs?
Linux Mint 21.3 Cinnamon
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: How to copy files from one hard drive to another?

Post by altair4 »

kyphi wrote:
sudo chown drrfs /media/Data
Should that not read

Code: Select all

sudo chown <username> /media/Data
where username = drrdf and not drrfs?
It should have been but he corrected for that:
drrdf@DRDAF700 ~ $ sudo chown drrdf /media/Data
chown: cannot access `/media/Data': No such file or directory
There's a good chance it would have worked too had there been a /media/Data to chown :)
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
kyphi
Level 9
Level 9
Posts: 2735
Joined: Sat Jul 09, 2011 1:14 am
Location: The Hunter Valley, Australia

Re: How to copy files from one hard drive to another?

Post by kyphi »

@ altair4 - I should have looked more closely :(

By the way, "# blkid -c /dev/null" and "# blkid" produce the same output. "ls -l /dev/disk/by-uuid" (no sudo) gives a bit more information. But then, you probably knew all that.
Linux Mint 21.3 Cinnamon
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: How to copy files from one hard drive to another?

Post by altair4 »

By the way, "# blkid -c /dev/null" and "# blkid" produce the same output.
Not always and that's the reason I run it the way I do. If you do a lot of work resizing, deleting, creating new, or in any way changing partitions the blkid cache gets corrupted. Old values remain and in fact partitions that no longer exist can show up in the output.

By default blkid will run against the default cache at /etc/blkid.tab. If you use the "-c" switch you are telling it to use some other cache and if you specify "/dev/null" you are by design sending it to an empty file causing it to create the list from scratch.

If you are a normal user who hasn't done extensive partition work then my way is unnecessary. But in a forum you really don't have any idea what the user has done to his machine so I always opt for the most reliable output to work from.

I found all this out the hard way working on a new machine with 4 physical hard drives and countless partitions all of which I changed repeatedly. Nearly drove me insane until I discovered the "c" switch.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
kyphi
Level 9
Level 9
Posts: 2735
Joined: Sat Jul 09, 2011 1:14 am
Location: The Hunter Valley, Australia

Re: How to copy files from one hard drive to another?

Post by kyphi »

Thank you, altair4, for your detailed explanation.
One of the things I particularly like about using Linux is that one never stops discovering, sharing and learning new commands.
It keeps this "grasshopper ;-)" young.
Linux Mint 21.3 Cinnamon
drrdf

Re: How to copy files from one hard drive to another? SOLVED

Post by drrdf »

Hi Altair4,

Thank you for your help, but with all due respect I don't agree that this problem is about "the way in which Linux works" as you suggest. It is in fact about introduced limitations of Ubuntu and thus Mint. Other flavours of Linux do not have the same problems, but they do not have the same strengths as Mint in other respects. Mint was without doubt the best Linux distro so far for those who want to be able to use an OS and applications out of the box, and are not interested in "playing computers". Since then, in my opinion, Mint seems to have lost its way a bit. However, for you to suggest that users do go back to Windows is I think a bit defeatist, and not in the Linux cause.

Hi WinterTroubles,

Thank you for your suggestion. However I am using the Mate version of Mint, so that does not have the nemo file manager but caja. I have now found that if you set up caja properly which is not done by default at installation it does restore the option to open files as root, but it does not allow changing the permissions set automatically by Mint.

Hi kyphi,

Thank you also for your help.

I have now discovered a straightforward solution to the problems now with Mint when connecting any new hard drive or other hardware to the system. These problems all occur because Ubuntu and Mint automatically without asking your permission as the legal owner of a new drive (having purchased it with your own money), and some other devices which you may connect via USB, elevate all permissions except read-only to root alone, as soon as you mount your new hardware, without even informing you that it has done that! As a result you then need to change these mutilated permissions to allow you to use your own new hardware. It is all a bit like MS preventing you from using a PC with an OS you have purchased, when you change some item of hardware, until you go through a nauseas process, wasting your time and energy, so that they will give you permission once again to use the OS you purchased from them! When you put a lot of people into a <violates forum rules> uniform they immediately become <violates forum rules>; power corrupts. The reason most people left MS and came to Linux was that they were sick of that sort of idiocy.

Now, as usual these days with so many things, there is a complete absence of joined-up thinking. The nerds who have done this have also decided to remove the straightforward possibility of logging-in as root at the main log-in screen, mainly because they consider that it is dangerous to log in as root, which is of course true, normally. However by executing the nonsense of taking away your right to use your newly-installed hardware they have thus made it necessary for you to be able to log-in as root to recover the right to use your own new hardware (unless you want to play Linux on the command line and have all the inconvenience of needing to establish the mount point and path etc. of your new devices, with all the correct syntax, which many normal users do not). The reason we moved from command line computing to the GUI was that it was an advance to save time and errors, and to make things work more reliably. To take actions which condemn people to having to go backwards to that again is just plain Luddite nonsense.

So, after a whole load of hassle as a result of this, I have now devised a procedure to circumvent having to resort to using command line language to be able to use your own newly-installed hardware. For anyone else wanting to add hard drives etc. and get them to work in a straightforward way, I offer it here to save anyone else facing the same issues. I have found it to work perfectly without any further hassle.

Add the new drive or other hardware to your system, first turning off the power to your PC, unless it is a usb device which you adding. (I have to assume that the user understands how to do this, and how to set any necessary jumpers etc.) You can as I do format a new drive with an external utility first if you want.

Since MInt will automatically then change the permissions as soon as the device is mounted, you now need to do two things, and exactly how you do them will be a little different depending upon which exact version of Mint you are using. I am using the Mate LTS version here. This has the file manager Caja.

Firstly ensure that Caja is set up properly, which it will not be by default at installation. On main menu select "Preferences" then "Preferred Appplications". Then select tab "System", and under "File Manager" select MATE file Manager; "caja" will then be displayed in the "Command" box under that, so that the option "Open as administrator" will then be available in all file manager windows. You may need to use this sometimes.

Then select the "Terminal" in main menu. Enter "sudo passwd root" and Return. Then enter your existing user password at the prompt. Enter your desired password for root at the prompt "Enter new UNIX password"; then enter this password again at the prompt "Retype new UNIX password".

Now on main menu select "Control Centre"; then select "System" and then "Login Window". On Login Window Preferences (as superuser), select "Security" tab. Under "Security" select box "Allow local system administrator login", so that this then has a tick. Close down the system.

Then start up your system again and log in as root with the new password you have just set. Mount and select the new hardware device and you will then be able to permanently change the permissions in Caja ("properties", "permissions") so as to be able to use your new added hardware; select the change all files permissions option. Once you have changed the permissions as you require shut down your system again. Do NOT stay logged in as root.

Then log in as a normal user again. You will then be able at last to write to your hard drive or other hardware, delete files etc. Hooray. In future if you add other hardware all you need to do is briefly log in as root and alter the automatically sequestered permissions as you require. Do not forget to log out as root immediately you have done this.

http://forums.linuxmint.com/viewtopic.php?f=18&t=141731
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: How to copy files from one hard drive to another? SOLVED

Post by altair4 »

Or .................

If you really really wanted to do this graphically then:

Open Caja
Mount the new partition
Go to the where the partition auto mounts - the /media folder
Right click /media/tester1 ( in my example ) and choose Open As Administrator.
Right click the mount point
Select Properties and change this:
Before.png
To this to take possession of the mounted partition:
After.png
Now you know why responses on the forum tend to favor the command line - it's easier and less steps :wink:

A special note to those who are wondering why this is even necessary. See, the fatal flaw in Linux is the same one that you encounter in UNIX. It always assumes the user knows what he's doing and doesn't presume to guess what kind of permissions on a new Linux partition that user wants to apply. By default it always mounts a newly created Linux filesystem formatted partition as owned and writeable only to root but readable to everyone else. Been that way if you include UNIX for over 40 years now.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
drrdf

Re: How to copy files from one hard drive to another? SOLVED

Post by drrdf »

Hi Altair4,

Thanks for your further reply. That is really excellent and a much quicker and better method; it also avoids having to log in as root, which is always dangerous and not to be recommended lightly. All that you need to also do first I would suggest is my step:

Firstly ensure that Caja is set up properly, which it will not be by default at installation. On main menu select "Preferences" then "Preferred Appplications". Then select tab "System", and under "File Manager" select MATE file Manager; "caja" will then be displayed in the "Command" box under that, so that the option "Open as administrator" will then be available in all file manager windows.

Then your method works a treat!

I am afraid however, that I do not agree that this method is slower than using a command line approach. The reason that we went to GUIs is because it is quicker and less subject to entry errors to use a GUI. I think the point is that people like you who are long-term experts in Linux may find the command line approach quicker and easier, because you know exactly what to do and have the syntax at your finger tips; for the rest of us mostly, and certainly for ordinary users, we find it much easier to use the GUI approach wherever possible.

So thanks for this method and for your help. It is people like you who have the expertise to help and guide the rest of us. Thanks again.
allypink

Re: How to copy files from one hard drive to another? SOLVED

Post by allypink »

Boot with a live disk. Open terminal and type:
sudo fdisk -l (this will show all your disks and partitions) Then......

cp -pdRv /home/al /media/al/My_Book/

Where 'al' (my home directory) will be changed to 'your home directory' to copy and 'My_Book' the disk or partition you wish to copy to.
These commands will preserve permissions copy all the files and directories keeping the structure and give you an output in terminal so you know what's happening.
Works for me and quick if you are using USB 3 or esata.

Quickest way to backup your home directory.
User avatar
eastrader
Level 1
Level 1
Posts: 43
Joined: Wed May 03, 2017 12:35 pm
Location: Dallas, Texas

Re: How to copy files from one hard drive to another? SOLVED

Post by eastrader »

And yet there is another way with Linux Mint 19:
1. Use Files and open the first location with the folder containing the files.
2. Right click with the mouse and select "Open as root" it will ask you for your password.
3. Use a second instance of Files and locate where you want to copy the files over.
4. And then make a new folder, you may have to right click on the location and again "Open as root" on that drive.
5. Go back to the Copy From location and select all files you want to bring over, and select copy
6. Change to the second location to Copy to, right click and select paste.
Almost like drag and drop... but I found it to be fairly fast.
Always learning.
Locked

Return to “Other topics”