- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Find sparse file?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-05-2006 07:26 AM
тАО10-05-2006 07:26 AM
Thanks and rgds
Prashant
Solved! Go to Solution.
- Tags:
- sparse file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-05-2006 08:06 AM
тАО10-05-2006 08:06 AM
SolutionDo something like this:
tr "\000" "x" < /dev/zero | dd bs=1 count=1 of=x1 # write 'x' at offset 0
tr "\000" "x" < /dev/zero | dd bs=1 count=1 oseek=999999 of=x1 # write 'x' at offset 999999
x1 is now a sparse 1MB file.
Now let's create a normal 1MB file (I'm doing this inefficiently so it will take a little time but this will closely mimic the way the sparse file was created for consistancy):
tr "\000" "x" < /dev/zero | dd bs=1 count=1000000 of=x2
Now do an "ls -l x1 x2"
and compare that to a "du -k x1 x2".
Note: du -k reports the file size in 1024 byte blocks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-05-2006 08:53 AM
тАО10-05-2006 08:53 AM
Re: Find sparse file?
Now frecover has an option to 'handle' sparse files on an fbackup tape, but what it really does is to convert long strings of nulls into lseek() operations to skip these null blocks. This minimizes the amount of space needed for a sparse file or perhaps a file that was never stored as sparse (actually full of nulls) but restores with less space.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-05-2006 09:49 AM
тАО10-05-2006 09:49 AM
Re: Find sparse file?
Use it like this:
find . -type f | xargs sparsechk.sh
It won't be particularly fast but it will work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-05-2006 10:13 AM
тАО10-05-2006 10:13 AM
Re: Find sparse file?
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000077186715