Linux copying to USB flash drive “No space left on device”












1















I have a new USB Flash drive, 16GB. I am trying to copy a folder from my local drive to this flash drive. The folder I am trying to copy contains about 225000 4KB files. I have tried to copy using the folder GUI and with terminal. Both times it copies exactly 21844 files and then I get the error:



"cannot create regular file `filename': No space left on device"



I also have a compressed copy of the files and I have tried extracting this directly into the USB drive, again stopping after 21844 files.



I have looked for possible solutions and tried emptying the trash but that does not solve the issue. I have also formatted the drive to FAT32 and tried again, but that doesn't work. Does anyone have any suggestions?



I am running Ubuntu 12.04 and the USB drive is an ADATA S107.










share|improve this question

























  • I also have this problem, will try formatting as ext4.

    – SomeNickName
    Sep 10 '16 at 11:28
















1















I have a new USB Flash drive, 16GB. I am trying to copy a folder from my local drive to this flash drive. The folder I am trying to copy contains about 225000 4KB files. I have tried to copy using the folder GUI and with terminal. Both times it copies exactly 21844 files and then I get the error:



"cannot create regular file `filename': No space left on device"



I also have a compressed copy of the files and I have tried extracting this directly into the USB drive, again stopping after 21844 files.



I have looked for possible solutions and tried emptying the trash but that does not solve the issue. I have also formatted the drive to FAT32 and tried again, but that doesn't work. Does anyone have any suggestions?



I am running Ubuntu 12.04 and the USB drive is an ADATA S107.










share|improve this question

























  • I also have this problem, will try formatting as ext4.

    – SomeNickName
    Sep 10 '16 at 11:28














1












1








1








I have a new USB Flash drive, 16GB. I am trying to copy a folder from my local drive to this flash drive. The folder I am trying to copy contains about 225000 4KB files. I have tried to copy using the folder GUI and with terminal. Both times it copies exactly 21844 files and then I get the error:



"cannot create regular file `filename': No space left on device"



I also have a compressed copy of the files and I have tried extracting this directly into the USB drive, again stopping after 21844 files.



I have looked for possible solutions and tried emptying the trash but that does not solve the issue. I have also formatted the drive to FAT32 and tried again, but that doesn't work. Does anyone have any suggestions?



I am running Ubuntu 12.04 and the USB drive is an ADATA S107.










share|improve this question
















I have a new USB Flash drive, 16GB. I am trying to copy a folder from my local drive to this flash drive. The folder I am trying to copy contains about 225000 4KB files. I have tried to copy using the folder GUI and with terminal. Both times it copies exactly 21844 files and then I get the error:



"cannot create regular file `filename': No space left on device"



I also have a compressed copy of the files and I have tried extracting this directly into the USB drive, again stopping after 21844 files.



I have looked for possible solutions and tried emptying the trash but that does not solve the issue. I have also formatted the drive to FAT32 and tried again, but that doesn't work. Does anyone have any suggestions?



I am running Ubuntu 12.04 and the USB drive is an ADATA S107.







usb usb-drive transfer






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 14 '13 at 4:37









Nathan Osman

21k32144237




21k32144237










asked Jul 18 '13 at 0:11









HerbHerb

613




613













  • I also have this problem, will try formatting as ext4.

    – SomeNickName
    Sep 10 '16 at 11:28



















  • I also have this problem, will try formatting as ext4.

    – SomeNickName
    Sep 10 '16 at 11:28

















I also have this problem, will try formatting as ext4.

– SomeNickName
Sep 10 '16 at 11:28





I also have this problem, will try formatting as ext4.

– SomeNickName
Sep 10 '16 at 11:28










1 Answer
1






active

oldest

votes


















0














There are two ways to run out of space on a filesystem:
1)Actually running out of space for the data
2)Running out of some filesytem resource like inodes or
fat table entries.
Lots of little files may cause running out of inodes -- the filesystems
are built with a default number of inodes and that may not meet
your needs. The FAT32 filesystem is limited to 64k files per directory
(max, long names will reduce that), so that will not work for you unless
you combine the small files with an archiver like tar before you copy them.
The archiver approach should work for any case, and will certainly reduce the
stress on the flash memory -- think of the number of writes the directory
block may get while being built, and hope the drivers are smart about buffering.
Maybe you should put the same type of filesystem on the 16G stick
as you have on your hard drive? (I'm guessing ntfs, since its directory
limit is over 4 million).
You can run mke2fs with switches to change the default inode size/number.
Run the manual pages



man mke2fs


for a full description.
The other possibility is you are really running out of space for the data --
you know your files are only 4K, but ask yourself, how much space does the
filesystem allocate for them? Check the free space left when the stick
says no more space -- free space indicates lack of inodes. No free space,
well, there's always the archiver to fix that too.






share|improve this answer
























  • I have a .tar.gz file of the whole folder and copied that to the flash drive easily, but when extracting I get: tar: info/B28965-gb7-R.info: Cannot open: No space left on device info/L5689-lmc13-R.info

    – Herb
    Jul 18 '13 at 2:34













  • OK, now what does the df command report as free space? Lots of free space indicates you ran out of inodes.

    – ubfan1
    Jul 18 '13 at 16:23











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f321324%2flinux-copying-to-usb-flash-drive-no-space-left-on-device%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














There are two ways to run out of space on a filesystem:
1)Actually running out of space for the data
2)Running out of some filesytem resource like inodes or
fat table entries.
Lots of little files may cause running out of inodes -- the filesystems
are built with a default number of inodes and that may not meet
your needs. The FAT32 filesystem is limited to 64k files per directory
(max, long names will reduce that), so that will not work for you unless
you combine the small files with an archiver like tar before you copy them.
The archiver approach should work for any case, and will certainly reduce the
stress on the flash memory -- think of the number of writes the directory
block may get while being built, and hope the drivers are smart about buffering.
Maybe you should put the same type of filesystem on the 16G stick
as you have on your hard drive? (I'm guessing ntfs, since its directory
limit is over 4 million).
You can run mke2fs with switches to change the default inode size/number.
Run the manual pages



man mke2fs


for a full description.
The other possibility is you are really running out of space for the data --
you know your files are only 4K, but ask yourself, how much space does the
filesystem allocate for them? Check the free space left when the stick
says no more space -- free space indicates lack of inodes. No free space,
well, there's always the archiver to fix that too.






share|improve this answer
























  • I have a .tar.gz file of the whole folder and copied that to the flash drive easily, but when extracting I get: tar: info/B28965-gb7-R.info: Cannot open: No space left on device info/L5689-lmc13-R.info

    – Herb
    Jul 18 '13 at 2:34













  • OK, now what does the df command report as free space? Lots of free space indicates you ran out of inodes.

    – ubfan1
    Jul 18 '13 at 16:23
















0














There are two ways to run out of space on a filesystem:
1)Actually running out of space for the data
2)Running out of some filesytem resource like inodes or
fat table entries.
Lots of little files may cause running out of inodes -- the filesystems
are built with a default number of inodes and that may not meet
your needs. The FAT32 filesystem is limited to 64k files per directory
(max, long names will reduce that), so that will not work for you unless
you combine the small files with an archiver like tar before you copy them.
The archiver approach should work for any case, and will certainly reduce the
stress on the flash memory -- think of the number of writes the directory
block may get while being built, and hope the drivers are smart about buffering.
Maybe you should put the same type of filesystem on the 16G stick
as you have on your hard drive? (I'm guessing ntfs, since its directory
limit is over 4 million).
You can run mke2fs with switches to change the default inode size/number.
Run the manual pages



man mke2fs


for a full description.
The other possibility is you are really running out of space for the data --
you know your files are only 4K, but ask yourself, how much space does the
filesystem allocate for them? Check the free space left when the stick
says no more space -- free space indicates lack of inodes. No free space,
well, there's always the archiver to fix that too.






share|improve this answer
























  • I have a .tar.gz file of the whole folder and copied that to the flash drive easily, but when extracting I get: tar: info/B28965-gb7-R.info: Cannot open: No space left on device info/L5689-lmc13-R.info

    – Herb
    Jul 18 '13 at 2:34













  • OK, now what does the df command report as free space? Lots of free space indicates you ran out of inodes.

    – ubfan1
    Jul 18 '13 at 16:23














0












0








0







There are two ways to run out of space on a filesystem:
1)Actually running out of space for the data
2)Running out of some filesytem resource like inodes or
fat table entries.
Lots of little files may cause running out of inodes -- the filesystems
are built with a default number of inodes and that may not meet
your needs. The FAT32 filesystem is limited to 64k files per directory
(max, long names will reduce that), so that will not work for you unless
you combine the small files with an archiver like tar before you copy them.
The archiver approach should work for any case, and will certainly reduce the
stress on the flash memory -- think of the number of writes the directory
block may get while being built, and hope the drivers are smart about buffering.
Maybe you should put the same type of filesystem on the 16G stick
as you have on your hard drive? (I'm guessing ntfs, since its directory
limit is over 4 million).
You can run mke2fs with switches to change the default inode size/number.
Run the manual pages



man mke2fs


for a full description.
The other possibility is you are really running out of space for the data --
you know your files are only 4K, but ask yourself, how much space does the
filesystem allocate for them? Check the free space left when the stick
says no more space -- free space indicates lack of inodes. No free space,
well, there's always the archiver to fix that too.






share|improve this answer













There are two ways to run out of space on a filesystem:
1)Actually running out of space for the data
2)Running out of some filesytem resource like inodes or
fat table entries.
Lots of little files may cause running out of inodes -- the filesystems
are built with a default number of inodes and that may not meet
your needs. The FAT32 filesystem is limited to 64k files per directory
(max, long names will reduce that), so that will not work for you unless
you combine the small files with an archiver like tar before you copy them.
The archiver approach should work for any case, and will certainly reduce the
stress on the flash memory -- think of the number of writes the directory
block may get while being built, and hope the drivers are smart about buffering.
Maybe you should put the same type of filesystem on the 16G stick
as you have on your hard drive? (I'm guessing ntfs, since its directory
limit is over 4 million).
You can run mke2fs with switches to change the default inode size/number.
Run the manual pages



man mke2fs


for a full description.
The other possibility is you are really running out of space for the data --
you know your files are only 4K, but ask yourself, how much space does the
filesystem allocate for them? Check the free space left when the stick
says no more space -- free space indicates lack of inodes. No free space,
well, there's always the archiver to fix that too.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jul 18 '13 at 1:32









ubfan1ubfan1

9,62141730




9,62141730













  • I have a .tar.gz file of the whole folder and copied that to the flash drive easily, but when extracting I get: tar: info/B28965-gb7-R.info: Cannot open: No space left on device info/L5689-lmc13-R.info

    – Herb
    Jul 18 '13 at 2:34













  • OK, now what does the df command report as free space? Lots of free space indicates you ran out of inodes.

    – ubfan1
    Jul 18 '13 at 16:23



















  • I have a .tar.gz file of the whole folder and copied that to the flash drive easily, but when extracting I get: tar: info/B28965-gb7-R.info: Cannot open: No space left on device info/L5689-lmc13-R.info

    – Herb
    Jul 18 '13 at 2:34













  • OK, now what does the df command report as free space? Lots of free space indicates you ran out of inodes.

    – ubfan1
    Jul 18 '13 at 16:23

















I have a .tar.gz file of the whole folder and copied that to the flash drive easily, but when extracting I get: tar: info/B28965-gb7-R.info: Cannot open: No space left on device info/L5689-lmc13-R.info

– Herb
Jul 18 '13 at 2:34







I have a .tar.gz file of the whole folder and copied that to the flash drive easily, but when extracting I get: tar: info/B28965-gb7-R.info: Cannot open: No space left on device info/L5689-lmc13-R.info

– Herb
Jul 18 '13 at 2:34















OK, now what does the df command report as free space? Lots of free space indicates you ran out of inodes.

– ubfan1
Jul 18 '13 at 16:23





OK, now what does the df command report as free space? Lots of free space indicates you ran out of inodes.

– ubfan1
Jul 18 '13 at 16:23


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f321324%2flinux-copying-to-usb-flash-drive-no-space-left-on-device%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?