System Hung while copying large file

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
tszkitc

System Hung while copying large file

Post by tszkitc »

Hi all,

I am using linuxmint 18.3 with a swap partition of 8gb. 8gb ram as well.

When I copy and paste a large file of 9gb in size. The system hung up.

May i know what is the problem? Could it be the swap partition is too small?

Thank you.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Mute Ant

Re: System Hung while copying large file

Post by Mute Ant »

Not swap, no. A default Mint kernel is set to use a maximum of 10% RAM as a disk-write buffer...
cat /proc/sys/vm/dirty_background_ratio -----> 10 -----> 800MB

If the write-speed of the destination drive is lower than the read-speed of the source, and it often is, the process will appear to hang when that buffer is full. No problem with small files, lumpy with large files.

You can't speed-up the destination drive, but you can smooth-out the progress report by reducing the buffer size. Something similar to the drive's internal RAM, I use 10MB with no problems...
sudo sysctl vm.dirty_bytes=10000000
...which stays in effect until the next boot.
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: System Hung while copying large file

Post by Flemur »

tszkitc wrote: Wed Feb 28, 2018 2:42 amWhen I copy and paste a large file of 9gb in size. The system hung up.
Are you copying with Cinnamon and nemo? To or from a USB gizmo?
If so, try "cp" in a terminal, or the simple "xfe" file-browser.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
tszkitc

Re: System Hung while copying large file

Post by tszkitc »

Anyway to permanently solve this problem?

How come windows don't have this kind of problem?

Thanks.
Mute Ant

Re: System Hung while copying large file

Post by Mute Ant »

"How come Windows don't have this kind of problem?" It does, exactly the same problem. Microsoft have no more control over what you connect than Linux. Their solution (last time I looked) was to de-buffer writing to incompetent storage and simply report what's happening... Image
Linux can do the same with a 'synchronous mount' if you want to try it.
User avatar
JoeFootball
Level 13
Level 13
Posts: 4673
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: System Hung while copying large file

Post by JoeFootball »

tszkitc wrote:Anyway to permanently solve this problem?
Use the appropriate tools for the job at hand. :) To me, copying a 9 GB file would be an unusual situation, and one that would dictate special handling, as detailed above.

Joe
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: System Hung while copying large file

Post by Flemur »

tszkitc wrote: Thu Mar 08, 2018 7:15 amAnyway to permanently solve this problem?
Why, yes, yes there is!

Are you copying with Cinnamon and nemo? To or from a USB gizmo?
If so, try "cp" in a terminal, or the simple "xfe" file-browser.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
tszkitc

Re: System Hung while copying large file

Post by tszkitc »

So when it hung, I should just wait or reboot?

How to use CP or Xfe by the way?

Thanks.
tszkitc

Re: System Hung while copying large file

Post by tszkitc »

By the way, I was trying to copy a 9GB file from /home to the other partition.

Only one physical HDD.

Thanks.
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: System Hung while copying large file

Post by Flemur »

tszkitc wrote: Thu Mar 08, 2018 8:17 pm So when it hung, I should just wait or reboot?
How to use CP or Xfe by the way?
Thanks.
To restart it -
https://lifehacker.com/298891/gently-re ... zen-system
1. Hold down the Alt and SysRq (Print Screen) keys.
2. While holding those down, type the following in order. Nothing will appear to happen until the last letter is pressed: REISUB
3. Watch your computer reboot magically.

You use "cp" in a terminal. "xfe" is another file browser which you can install.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mute Ant

Re: System Hung while copying large file

Post by Mute Ant »

"Copy a 9GB file from /home to the other partition, only one physical HDD." I get 1GB/minute doing this, using the Thunar file-manager with drag-and-drop. You almost certainly have a better HDD than the one I am using[*], so if your system stays unresponsive for more than 9 minutes, it's the fault of the software you are using, not the hardware. Strictly speaking, it's not a Linux problem either, Linux is just the kernel.

[*] Right now my OS is on a ST380011A circa 2003 80GB 7200rpm PATA. That can manage 50MB/s write-only, 50MB/s read-only and 16MB/s doing mixed read-write duplicating the 9GB file.
Mattyboy

Re: System Hung while copying large file

Post by Mattyboy »

tszkitc wrote: Thu Mar 08, 2018 8:17 pm How to use CP
https://www.computerhope.com/unix/ucp.htm
Easier than it looks. You just need to learn the source and destination paths.
Tip use pwd "print working Directory"
And the tab key to auto fill.
The -R "Copy directories recursively" is probably the most useful when dealing with a directory full of files.

That will make sense eventually ;)
User avatar
JoeFootball
Level 13
Level 13
Posts: 4673
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: System Hung while copying large file

Post by JoeFootball »

tszkitc wrote:How to use CP or Xfe by the way?

Code: Select all

sudo apt install xfe
Joe
Locked

Return to “Beginner Questions”