04-25-2007
sparse files can have less than a block of 0x0 characters. especially uncopied (or unrestored) files.
The easiest way: copy the file and see a difference in stat results for st_size between file_uncopied vs file_copied.
When you copy a sparse file (if it not alrerady a copy or a restore) it becomes larger.
Note that sysadmins detest these files because of what they do to disk space when restored from tape. Are you playing with zum?
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
what are sparse files? (2 Replies)
Discussion started by: areef4u
2 Replies
2. Shell Programming and Scripting
Hi All,
Please advise me how to make a copy of file from a list and store in one particular location?
For example , I have aaa.txt which contains as below, But, those *usg files might be randomly store in different location....
> cat aaa.txt
adc.usg
dfdjkf.usg
ugjfk.usg
And I want... (3 Replies)
Discussion started by: cedrichiu
3 Replies
3. UNIX for Dummies Questions & Answers
I need to write a program that reads in data from a file with holes and copy the file.
the cp command copies the file but the holes use disk blocks then;
but when this progrm copies the file the new file should not have hose extra blocks.
the file should be copied with holes.
PLZZ help! (2 Replies)
Discussion started by: kominbhai
2 Replies
4. Shell Programming and Scripting
Hi,
I am writing a script to manage my server a bit better, but want to make it so if a path changes I dont need to update the script.
I was thinking of doing something like
if
then
echo -e "psa/admin/sbin located "
else
echo "no luck chump"
fi
but would need to... (2 Replies)
Discussion started by: foz
2 Replies
5. UNIX for Advanced & Expert Users
I'm trying to locate a block of text in a file, remove it and then replace with a new block.
I can find the first line number that the text starts on using grep -n. I then need to locate the ending line by searching for the string "}" that follows the line I found. Here's the steps I need to... (1 Reply)
Discussion started by: lchandle
1 Replies
6. Shell Programming and Scripting
I am submitting a concurrent program (of HOST tyme) from Oracle apps screen,
The MAIN shell program submits another program, (child) which is also a Shell program. The child writes data to log file. Now the main program, read the log and do some calculations and sends the data to user through... (1 Reply)
Discussion started by: Pradeep Garine
1 Replies
7. Shell Programming and Scripting
Hi All,
I have a matrix stored in a file matrix.mtx and looks like this:
1 0.5 0.33 0.25
0 0.33 0.25 0.2
0 0 0 0.16
0 0 0 0.14
I want to convert this matrix to its sparse representation like the one give below (sparse_matrix.mtx). This means that above matrix has been converted to its... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies
8. Shell Programming and Scripting
I am no Unix administrator...I live in windows land.
I wrote a script to find files of certain names and process them but was later advised to avoid checking sparse files since it would use up a lot of resources and the files I was looking for were not there.
How do I avoid doing the find on... (3 Replies)
Discussion started by: shellFun
3 Replies
9. Programming
Which data structure will be most appropriate to represent a sparse array? (1 Reply)
Discussion started by: rupeshkp728
1 Replies
10. UNIX for Dummies Questions & Answers
I have text file in Linux with two rows : first row conmtain the column nam and the second row contain its value .I nned to fetch few columns first and then redirect the data of those colum in the another file.
Any ideas?? (1 Reply)
Discussion started by: Anamica
1 Replies
LEARN ABOUT DEBIAN
o2image
o2image(8) OCFS2 Manual Pages o2image(8)
NAME
o2image - Copy or restore OCFS2 file system meta-data
SYNOPSIS
o2image [-r] [-I] device image-file
DESCRIPTION
o2image copies the OCFS2 file system meta-data from the device to the specified image-file. This image file contains the file system
skeleton that includes the inodes, directory names and file names. It does not include any file data.
This image file can be useful to debug certain problems that are not reproducible otherwise. Like on-disk corruptions. It could also be
used to analyse the file system layout in an aging file system with an eye towards improving performance.
As the image-file contains a copy of all the meta-data blocks, it can be a large file. By default, it is created in a packed format, in
which all meta-data blocks are written back-to-back. With the -r option, the user could choose to have the file in the raw (or sparse) for-
mat, in which the blocks are written to the same offset as they are on the device.
debugfs.ocfs2 understands both formats.
o2image also has the option, -I, to restore the meta-data from the image file onto the device. This option will rarely be useful to end-
users and has been written specifically for developers and testers.
OPTIONS
-r Copies the meta-data to the image-file in the raw format. Use this option only if the destination file system supports sparse files.
If unsure, do not use this option and let the tool create the image-file in the packed format.
-I Restores meta-data from the image-file onto the device. CAUTION: This option could corrupt the file system.
-i Interactive mode - before writing out the image file print it's size and ask whether to proceed. This setting only applies when '-I'
is not specified. It can be useful when the file system holding the image is low on disk space and the user might need to free up
space once the target image size is calculated.
EXAMPLES
[root@node1 ~]# o2image /dev/sda1 sda1.out
Copies metadata blocks from /dev/sda1 device to sda1.out file
[root@node1 ~] o2image -I /dev/sda1 sda1.out
Use with CAUTION. Copies meta-data blocks from sda1.out onto the
/dev/sda1 device.
SEE ALSO
debugfs.ocfs2(8) fsck.ocfs2(8)
AUTHORS
Oracle Corporation
COPYRIGHT
Copyright (C) 2007, 2010 Oracle. All rights reserved.
Version 1.6.4 September 2010 o2image(8)