Is there any way to make a folder behave the same as /tmp/?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have a large folder with a few million files on my external hard drive that I have to delete. Using rm -rf
works, but is very slow due to the sheer amount of files, and the size of the folder.
Files that are in /tmp/
seem to be deleted instantly on reboot, no matter how big they are or how many files there are. So I am wondering if it is possible to give a folder on an external drive the same attributes as, and make it behave in the same way as /tmp/
.
files tmp
add a comment |Â
up vote
0
down vote
favorite
I have a large folder with a few million files on my external hard drive that I have to delete. Using rm -rf
works, but is very slow due to the sheer amount of files, and the size of the folder.
Files that are in /tmp/
seem to be deleted instantly on reboot, no matter how big they are or how many files there are. So I am wondering if it is possible to give a folder on an external drive the same attributes as, and make it behave in the same way as /tmp/
.
files tmp
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a large folder with a few million files on my external hard drive that I have to delete. Using rm -rf
works, but is very slow due to the sheer amount of files, and the size of the folder.
Files that are in /tmp/
seem to be deleted instantly on reboot, no matter how big they are or how many files there are. So I am wondering if it is possible to give a folder on an external drive the same attributes as, and make it behave in the same way as /tmp/
.
files tmp
I have a large folder with a few million files on my external hard drive that I have to delete. Using rm -rf
works, but is very slow due to the sheer amount of files, and the size of the folder.
Files that are in /tmp/
seem to be deleted instantly on reboot, no matter how big they are or how many files there are. So I am wondering if it is possible to give a folder on an external drive the same attributes as, and make it behave in the same way as /tmp/
.
files tmp
asked Feb 15 at 19:31
DisplayName
4,25584272
4,25584272
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
rm
is only necessary because you want to delete one piece of data (a specific file), while leaving the rest of the data on the filesystem in place.
If you segregate your data so that you can retire all the data at the same time, then you don't have to remove the pieces individually. You can discard (and probably recreate) the filesystem quickly.
/tmp
is often created using virtual memory as the storage space instead of a disk partition. When this is true, the data is not stable across reboots, so it is created (empty) at every boot.
You can't do that with a folder, but you can create a separate filesystem and mount it at the location you want. When you're ready to expire the data, you need to unmount it, recreate it, then remount it. Should take a few seconds.
add a comment |Â
up vote
0
down vote
The difference in performance that you are seeing is likely because your /tmp directory is mounted in RAM as opposed to physical storage. You can check this with mount
.
Also different types of file systems have different performance impacts in certain operations. XFS should outperform ext4, as should btrfs.
These links could be useful too:
- Efficiently delete large directory containing thousands of files
- Deleting billions of files from a directory while seeing the progress as well
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
rm
is only necessary because you want to delete one piece of data (a specific file), while leaving the rest of the data on the filesystem in place.
If you segregate your data so that you can retire all the data at the same time, then you don't have to remove the pieces individually. You can discard (and probably recreate) the filesystem quickly.
/tmp
is often created using virtual memory as the storage space instead of a disk partition. When this is true, the data is not stable across reboots, so it is created (empty) at every boot.
You can't do that with a folder, but you can create a separate filesystem and mount it at the location you want. When you're ready to expire the data, you need to unmount it, recreate it, then remount it. Should take a few seconds.
add a comment |Â
up vote
2
down vote
rm
is only necessary because you want to delete one piece of data (a specific file), while leaving the rest of the data on the filesystem in place.
If you segregate your data so that you can retire all the data at the same time, then you don't have to remove the pieces individually. You can discard (and probably recreate) the filesystem quickly.
/tmp
is often created using virtual memory as the storage space instead of a disk partition. When this is true, the data is not stable across reboots, so it is created (empty) at every boot.
You can't do that with a folder, but you can create a separate filesystem and mount it at the location you want. When you're ready to expire the data, you need to unmount it, recreate it, then remount it. Should take a few seconds.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
rm
is only necessary because you want to delete one piece of data (a specific file), while leaving the rest of the data on the filesystem in place.
If you segregate your data so that you can retire all the data at the same time, then you don't have to remove the pieces individually. You can discard (and probably recreate) the filesystem quickly.
/tmp
is often created using virtual memory as the storage space instead of a disk partition. When this is true, the data is not stable across reboots, so it is created (empty) at every boot.
You can't do that with a folder, but you can create a separate filesystem and mount it at the location you want. When you're ready to expire the data, you need to unmount it, recreate it, then remount it. Should take a few seconds.
rm
is only necessary because you want to delete one piece of data (a specific file), while leaving the rest of the data on the filesystem in place.
If you segregate your data so that you can retire all the data at the same time, then you don't have to remove the pieces individually. You can discard (and probably recreate) the filesystem quickly.
/tmp
is often created using virtual memory as the storage space instead of a disk partition. When this is true, the data is not stable across reboots, so it is created (empty) at every boot.
You can't do that with a folder, but you can create a separate filesystem and mount it at the location you want. When you're ready to expire the data, you need to unmount it, recreate it, then remount it. Should take a few seconds.
answered Feb 15 at 19:51
BowlOfRed
2,335612
2,335612
add a comment |Â
add a comment |Â
up vote
0
down vote
The difference in performance that you are seeing is likely because your /tmp directory is mounted in RAM as opposed to physical storage. You can check this with mount
.
Also different types of file systems have different performance impacts in certain operations. XFS should outperform ext4, as should btrfs.
These links could be useful too:
- Efficiently delete large directory containing thousands of files
- Deleting billions of files from a directory while seeing the progress as well
add a comment |Â
up vote
0
down vote
The difference in performance that you are seeing is likely because your /tmp directory is mounted in RAM as opposed to physical storage. You can check this with mount
.
Also different types of file systems have different performance impacts in certain operations. XFS should outperform ext4, as should btrfs.
These links could be useful too:
- Efficiently delete large directory containing thousands of files
- Deleting billions of files from a directory while seeing the progress as well
add a comment |Â
up vote
0
down vote
up vote
0
down vote
The difference in performance that you are seeing is likely because your /tmp directory is mounted in RAM as opposed to physical storage. You can check this with mount
.
Also different types of file systems have different performance impacts in certain operations. XFS should outperform ext4, as should btrfs.
These links could be useful too:
- Efficiently delete large directory containing thousands of files
- Deleting billions of files from a directory while seeing the progress as well
The difference in performance that you are seeing is likely because your /tmp directory is mounted in RAM as opposed to physical storage. You can check this with mount
.
Also different types of file systems have different performance impacts in certain operations. XFS should outperform ext4, as should btrfs.
These links could be useful too:
- Efficiently delete large directory containing thousands of files
- Deleting billions of files from a directory while seeing the progress as well
answered Feb 19 at 14:02
Pedro
59429
59429
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424451%2fis-there-any-way-to-make-a-folder-behave-the-same-as-tmp%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password