Skip to main content

Questions tagged [sparse-files]

3votes
1answer
273views

How to get the actually used size of a sparse file?

I would like to know, how much is a sparse file really using on the disk. ls, statand similar commands all seem showing its virtual size, i.e. with the holes. I want to know the real disk usage of the ...
peterh's user avatar
  • 10.3k
0votes
1answer
177views

Encrypted LUKS fs inside a file: sparse or not?

I have a LUKS encrypted file filled with around 160 GB of data that I use a lot. For safety, I created the file with 400 GB.  That is, of course, a lot of wasted space.  So I switched to a sparse file,...
Luis A. Florit's user avatar
8votes
2answers
2kviews

What happens to a sparse file's holes when the space is needed?

The scenario Let's say you have a 1GB sparse file in a 2 GB filesystem and the sparse file is taking only 0.1 GB of space. The question(s) I guess you would have 1.9 GB to store data on disk, is that ...
loco.loop's user avatar
3votes
1answer
84views

Why does reading a file with hexdump sometimes change find's sparseness value (%S)?

I use a Lustre file system. I've noticed that if I look at the find's sparseness value (%S) for a file, then print the file with hexdump, then look at the find's sparseness value again, then ...
Franck Dernoncourt's user avatar
-1votes
1answer
140views

Truncate command not creating a hole

I am trying to create a file with hole using the truncate command. I read up in some posts and one of the answers in this post says to use truncate command. Filesystem used is btrfs. This is the ...
Shivanshu Arora's user avatar
8votes
1answer
1kviews

How transparent are sparse files for applications?

I am hoping I understand sparse file concept. I also do know cp command's --sparse=... However when googling for the practical applications I found ambiguous statements about how transparent it is for ...
g.pickardou's user avatar
0votes
1answer
950views

How to mount a sparsed disk image

I have an image of the mSATA SSD disk of a PC. The disk contains the operating system and has a capacity of 512GB. I do not have that free storage, so I have cloned the disk into an image with dd ...
Francisco de Javier's user avatar
1vote
1answer
206views

Extracting text with expressions from a text file using grep

I have the following 2 lines in my text file and wanted to calculate duration between those lines X & Y in minutes. line X: 18.05.2022 13:54:52 [ INFO]: Starting Component 'OWN_FUNDS_RULES' (5/15)...
Manoj Kumar's user avatar
20votes
3answers
4kviews

How do I uncompress a file with lots of zeroes as a sparse file?

I have a compressed raw image of a very large hard drive created using cat /dev/sdx | xz > image.xz. However, the free space in the drive was zeroed before this operation, and the image consists ...
jaymmer - Reinstate Monica's user avatar
0votes
1answer
184views

Shrunk virtual disk file, now reported file size doesn't match

I originally had a single virtual disk file (.qcow2) of roughly 3.5 TiB and I decided to "group" all similar data on its own virtual disk file, for various reasons. Obviously that meant I ...
Sahbi's user avatar
1vote
0answers
1kviews

Moving sparse files

cp not only auto-detects sparse files but also has --sparse=always option. I wonder if mv works with the same mechanism or the safe way for moving sparse files is cp && rm Or is there any ...
Googlebot's user avatar
2votes
2answers
6kviews

Tell if a file is a "sparse file"

There is an existing question for "Finding all sparse files", and I think I could use it, but the scripts were too complex to understand. I don't think the GUI of Ubuntu file manager ...
Damn Vegetables's user avatar
2votes
1answer
259views

Sparse, bootable Linux images? [closed]

I've set up a new Linux workstation and would like to create a backup image in order to save time in case something breaks. This is the situation: Workstation: 512 GB SSD, 12 GB used, ext4 file ...
david's user avatar
0votes
3answers
850views

Filter the rows of a file based on the number of columns that have =0.00000000

I would like to filter the rows of a file (e.g. file.txt below) based on the number of columns, after column 5, that have =0.00000000. The I/O below shows an example for filtering rows that have ...
Age87's user avatar
4votes
0answers
456views

Is it safe to enable Direct I/O for a loop device backed by a sparse file?

I'd like to have a sparse file, and mount it as a filesystem. It'd be great if the performance overhead is negligible, but only if that doesn't come with a data-loss risk! Is it safe to mount the ...
semekh's user avatar

153050per page
close