LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 05-15-2022, 11:28 AM   #1
princess-rubble
LQ Newbie
 
Registered: Mar 2021
Posts: 11

Rep: Reputation: Disabled
cp won't copy more than 32Gb of a large file on the same SSD


Hi folks,

I have a 70Gb file on an EXT4 volume in ~/folder1 that I want to copy to ~/folder2.

Code:
cp -v ~/folder1/bigfile ~/folder2/bigfile
generates this error:

Code:
 cp: error copying 'bigfile' to '~/folder2/bigfile': Input/output error
The copy process fails when the destination file hits 32Gb in size (or thereabouts).

I've tried using rsync and rclone, and the same thing happens: the copying process fails at around 32Gb destination file size. The volume has 750Gb free space so I do not think it is a disk space problem. It seems like some internal limit is being hit but I haveno idea where to start looking for this.

The EXT4 volume is LUKS encrypted. I do not know whether this is relevant.

I noticed the problem when I was trying to migrate a VirtualBox .vdi file using VBoxManage. The source disk file is 70Gb and the migration failed repeatedly about half way through the migration process. It now seems like an OS problem rather than anything to do with VirtualBox because I cannot cp successfully. I'm not running out of disk space or inodes.

Can anyone suggest a way forward with this?

OS: Arch Linux x86_64 5.17.5-arch1-1

Thanks
 
Old 05-15-2022, 11:37 AM   #2
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,604

Rep: Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547Reputation: 2547
Quote:
Originally Posted by princess-rubble View Post
I noticed the problem when I was trying to migrate a VirtualBox .vdi file
VM disk files are often implemented as sparse files, so the guest OS sees a large disk, without actually occupying that space on the host.

See if cp --sparse=when and/or rsync --sparse helps?

 
Old 05-15-2022, 11:45 AM   #3
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,173

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
I saw an old post abut using the 'nocache' command before the cp,rsync,dd, ect. but it seemed more about performance loss during large file transfers, but it might help. It may not be installed by default it seems, but it should be in your standard repo.
 
Old 05-15-2022, 12:14 PM   #4
princess-rubble
LQ Newbie
 
Registered: Mar 2021
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by boughtonp View Post

See if cp --sparse=when and/or rsync --sparse helps?

Great idea ... but it didn't work. I got the same Input/output Error at around 32Gb destination file size.
 
Old 05-15-2022, 12:33 PM   #5
princess-rubble
LQ Newbie
 
Registered: Mar 2021
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by uteck View Post
I saw an old post abut using the 'nocache' command before the cp,rsync,dd, ect. but it seemed more about performance loss during large file transfers, but it might help. It may not be installed by default it seems, but it should be in your standard repo.
Thanks for the suggestion. I didn't use nocache but, based on some web searching, I tried dd with the following options that disable caching:

Code:
 dd if=source_file of=destination_file bs=4M iflag=direct oflag=direct
I got the same Input/output error, and the copying failed when the destination file reached about 32Gb in size.
 
Old 05-15-2022, 12:42 PM   #6
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382
Blog Entries: 1

Rep: Reputation: 71
Can you copy the file to a different disk? And then back to /folder2?
 
Old 05-15-2022, 01:13 PM   #7
princess-rubble
LQ Newbie
 
Registered: Mar 2021
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Debian6to11 View Post
Can you copy the file to a different disk? And then back to /folder2?
I should have mentioned this in the original post. No I can't copy the file to a different disk. It hits the same 32Gb limit and generates the Input/output Error.
 
Old 05-15-2022, 01:27 PM   #8
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,798

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
Do you have a 32bit OS?
Code:
uname -a
file /bin/cp
 
Old 05-15-2022, 01:45 PM   #9
princess-rubble
LQ Newbie
 
Registered: Mar 2021
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by MadeInGermany View Post
Do you have a 32bit OS?
Code:
uname -a
file /bin/cp
I'm running Arch 64-bit.
OS: Arch Linux x86_64 5.17.5-arch1-1
 
Old 05-15-2022, 02:25 PM   #10
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,798

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
Just seeing that was already answered in your initial post.
Do you get an I/O error?
Maybe a limit in a low level driver, maybe integrated in the SSD.
Did you try to copy to another SSD type or a non-SSD disk?
 
Old 05-15-2022, 06:03 PM   #11
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,638

Rep: Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966Reputation: 7966
Quote:
Originally Posted by princess-rubble View Post
Hi folks,
I have a 70Gb file on an EXT4 volume in ~/folder1 that I want to copy to ~/folder2.
Code:
cp -v ~/folder1/bigfile ~/folder2/bigfile
generates this error:
Code:
 cp: error copying 'bigfile' to '~/folder2/bigfile': Input/output error
The copy process fails when the destination file hits 32Gb in size (or thereabouts).

I've tried using rsync and rclone, and the same thing happens: the copying process fails at around 32Gb destination file size. The volume has 750Gb free space so I do not think it is a disk space problem. It seems like some internal limit is being hit but I haveno idea where to start looking for this. The EXT4 volume is LUKS encrypted. I do not know whether this is relevant.

I noticed the problem when I was trying to migrate a VirtualBox .vdi file using VBoxManage. The source disk file is 70Gb and the migration failed repeatedly about half way through the migration process. It now seems like an OS problem rather than anything to do with VirtualBox because I cannot cp successfully. I'm not running out of disk space or inodes.
You seem to have checked a good amount of things so far, but I'll ask how is this disk connected? Is it an external drive or internal? I've seen externally-connected USB drives do flaky things with large files. And can you try to copy another large file, to see if it works? That file itself may be corrupted, or in use.
 
Old 05-15-2022, 06:27 PM   #12
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
All of the analysis so far has been directed toward finding out why the output file fails at 32Gb. Is it possible that the error is a physical problem with the input file at 32Gb? I suggest that you run fsck against the partition containing the input file.
 
2 members found this post helpful.
Old 05-16-2022, 06:14 AM   #13
princess-rubble
LQ Newbie
 
Registered: Mar 2021
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by MadeInGermany View Post
Just seeing that was already answered in your initial post.
Do you get an I/O error?
Maybe a limit in a low level driver, maybe integrated in the SSD.
Did you try to copy to another SSD type or a non-SSD disk?
I have tried copying the file to another folder on the same internal SSD, to an external SSD and to an external HDD. Copying fails every time with the same error.

Another post in this thread suggests that there may be something wrong with the source file. I will investigate this further.
 
Old 05-16-2022, 07:00 AM   #14
princess-rubble
LQ Newbie
 
Registered: Mar 2021
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jailbait View Post
All of the analysis so far has been directed toward finding out why the output file fails at 32Gb. Is it possible that the error is a physical problem with the input file at 32Gb? I suggest that you run fsck against the partition containing the input file.
That's a very good suggestion. Thanks.

I have hit a problem with running fsck though. I've booted from a live Ubuntu USB (I had one laying around) but I cannot see the encrypted partition that I need to scan. df -h (and df -a) only shows the partitions associated with the live USB and not the internal volume that I need to scan. I can see the internal volume from the Ubuntu GUI after boot, and can mount it, but cannot open the luks volume from the command line so cannot run fsck on it.

After booting from the live USB, I can mount the encrypted volume from the GUI, then:

Code:
 df -a
This lists all volumes, including the encrypted volume, shown as /dev/dm-012345678 (example only). I unmount this volume, then run

Code:
 df -a /dev/dm-012345678
but this produces a "No such file or directory" error. I'm stuck.

This does seem to be getting more complicated and I'm approaching the outer limits of my competence. Thank you to everyone who is helping me with useful suggestions. Who'd have thought that copying a file could be so difficult!
 
Old 05-16-2022, 11:56 AM   #15
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
The comment earlier about sparse files and copying is relevant.

You must be able to see the device containing that file system when booted to the live media, but since it is an encrypted volume may not be able to do anything with it except open and mount it.

If you can open the device and not mount it then you should be able to run fsck on it, but if it requires mounting then fsck is out.

You should be able to make a copy of the virtual device using dd, but I have no clue how that would work on an encrypted device, especially one that is a sparse file.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Install Linux in Toshiba u940 series with 32gb ssd and 750gb hdd I would like to have boot code in ssd only cvkchary Linux - Laptop and Netbook 4 08-31-2016 04:26 PM
[SOLVED] How to select more than 1 line,copy those selected more than one line,and paste them. shabariv Linux - Newbie 1 02-02-2015 11:51 AM
dd: can't copy a 32GB USB 3.0 SanDisk extreme to another 32GB USB 3.0 SanDisk Ultra basskleff Linux - Software 17 11-12-2013 10:58 AM
LXer: This week at LWN: Large pages, large blocks, and large problems LXer Syndicated Linux News 0 09-27-2007 11:40 AM
Making FAT32 partitions larger than 32GB's syzygy_eolith Linux - Newbie 5 04-23-2004 12:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration