summaryrefslogtreecommitdiff
path: root/sbin/scan_ffs
AgeCommit message (Collapse)Author
2023-01-24Work on swapped-endian FFS.mlelstv
2022-11-17Restore backward compatibility of UFS2 with previous NetBSD releases bychs
disabling support in UFS2 for extended attributes (including ACLs). Add a new variant of UFS2 called "UFS2ea" that does support extended attributes. Add new fsck_ffs operations "-c ea" and "-c no-ea" to convert file systems from UFS2 to UFS2ea and vice-versa (both of which delete all existing extended attributes in the process).
2022-01-20O_CLOEXEC is not a mode :-)christos
2022-01-20- use /dev/tty instead of stderr for SIGINFO messageschristos
- use uintmax_t instead of ull - print fractional percentage to show that we are making progress on large disks.
2022-01-19add SIGINFO support. now you can know how far along the scan is.mrg
2020-09-07remove GCC_NO_ADDR_OF_PACKED_MEMBER for several subdir buildsmrg
that are now handled by lfs_accessors.h internally.
2020-09-06add support for new GCC 9 warnings that may be too much to fixmrg
right now. new address-of-packed-member and format-overflow warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd GCC_NO_FORMAT_OVERFLOW variables to remove these warnings. apply to a bunch of the tree. mostly, these are real bugs that should be fixed, but in many cases, only by removing the 'packed' attribute from some structure that doesn't really need it. (i looked at many different ones, and while perhaps 60-80% were already properly aligned, it wasn't clear to me that the uses were always coming from sane data vs network alignment, so it doesn't seem safe to remove packed without careful research for each affect struct.) clang already warned (and was not erroring) for many of these cases, but gcc picked up dozens more.
2015-10-15Teach scan_ffs about lfs64.dholland
(and also about byte-swapped lfs volumes, which might or might not actually work)
2015-08-02Add a (draft) 64-bit superblock. Make things build again.dholland
Add pieces of support for using both superblock types where convenient, and specifically to the superblock accessors, but don't actually enable it anywhere. First substantive step on PR 50000.
2015-08-02Use accessor functions for the version field of the lfs superblock.dholland
I thought at first maybe the cases that test the version should be rolled into the accessors, but on the whole I think the conclusion on that is no.
2015-08-02Fix assorted 64 -> 32 truncations in lfs. Also, some minor tidyups anddholland
corrections in passing.
2015-07-28Add a new lfs header file: lfs_accessors.h.dholland
This contains all the accessor functions and macros out of lfs.h. Add an include of lfs_accessors.h after all uses of lfs.h... except for code that wants to define its own struct lfs-alike that the accessors are supposed to play along with. For these, set STRUCT_LFS and include lfs_accessors.h after the necessary structure has been defined, so that lfs_accessors.h can emit functions in terms of it.
2015-07-24More lfs superblock accessors.dholland
(This changes the rest of the code over; all the accessors were already added.) The difference between this commit and the previous one is arbitrary, but the previous one passed the regression tests on its own so I'm keeping it separate to help with any bisections that might be needed in the future.
2015-07-24Switch to accessor functions for elements of the LFS on-diskdholland
superblock. This will allow switching between 32/64 bit forms on the fly; it will also allow handling LFS_EI reasonably tidily. (That currently doesn't work on the superblock.) It also gets rid of cpp abuse in the form of fake structure member macros. Also, instead of doing sleep/wakeup on &lfs_avail and &lfs_nextseg inside the on-disk superblock, add extra elements to the in-memory struct lfs for this. (XXX: these should be changed to condvars, but not right now) XXX: this migrates a structure needed by the lfs code in libsa (struct salfs) into lfs.h, where it doesn't belong, but for the time being this is necessary in order to allow the accessors (and the various lfs macros and other goop that relies on them) to compile.
2013-06-23Stick ffs_ in front of the following macros:dholland
fragstoblks() blkstofrags() fragnum() blknum() to finish the job of distinguishing them from the lfs versions, which Christos renamed the other day. I believe this is the last of the overtly ambiguous exported symbols from ffs... or at least, the last of the ones that conflicted with lfs. ffs still pollutes the C namespace very broadly (as does ufs) and this needs quite a bit more cleanup. XXX: boo on macros with lowercase names. But I'm not tackling that just yet.
2013-06-23Stick ffs_, ext2_, chfs_, filecore_, cd9660_, or mfs_ in front ofdholland
the following symbols so as to disambiguate fully. (Christos already did the lfs ones.) lblkno lblktosize lfragtosize numfrags blkroundup fragroundup
2013-06-23fsbtodb() -> FFS_FSBTODB(), EXT2_FSBTODB(), or MFS_FSBTODB()dholland
dbtofsb() -> FFS_DBTOFSB() or EXT2_DBTOFSB() (Christos already did the lfs ones a few days back)
2013-06-19Rename ambiguous macros:dholland
MAXDIRSIZE -> UFS_MAXDIRSIZE or LFS_MAXDIRSIZE NINDIR -> FFS_NINDIR, EXT2_NINDIR, LFS_NINDIR, or MFS_NINDIR INOPB -> FFS_INOPB, LFS_INOPB INOPF -> FFS_INOPF, LFS_INOPF blksize -> ffs_blksize, ext2_blksize, or lfs_blksize sblksize -> ffs_blksize These are not the only ambiguously defined filesystem macros, of course, there's a pile more. I may not have found all the ambiguous definitions of blksize(), too, as there are a lot of other things called 'blksize' in the system.
2009-04-11fix sign-compare issueslukem
2007-12-15convert __attribute__s to applicable cdefs.h macrosperry
2007-10-06Use a two clause license for all the code I contributed.xtraeme
The envsys code will be changed later.
2007-05-01Add -b flag into usage().xtraeme
2007-05-01Bump date.xtraeme
2007-05-01Add a "-b" option to search a partition for valid alternate superblocks,perseant
rather than searching the disk for partitions. Also, test LFS superblock checksums before we report them.
2007-02-16* There's no need to use an int to store the returned value ofxtraeme
ffs_checkver() and later use it in the switch statement, just use ffs_checkver. * Remove unneded <sys/queue.h> header. * Remove LFS from fstypes, it was never used. * Increase SBCOUNT to 128, works faster. * Remove unneded casts. * (-F mode) close fd when the scan has finished or if pread() failed. * (-F mode) print total size of file.
2006-10-17Improve English.wiz
2006-10-15Use O_DIRECT (aka Direct I/O) when -F is used.xtraeme
2006-10-14Detect FFSv1 partitions with fragsize/blocksize greater thanxtraeme
2048/16384.
2006-09-10Sort options in usage and SYNOPSIS.wiz
2006-09-08- Change the cast of st_size to uint64_t to avoid future problemsxtraeme
with large files. - u_uintXX_t -> uintXX_t
2006-09-07Change -f to -F, per mrg's suggestion.xtraeme
2006-09-07Add -f file support. Useful to search for partitions on disk images.xtraeme
2006-08-12scan_ffs(8) has been pulled up into netbsd-3 and thus will haveghen
"first appeared in NetBSD 3.1", not 4.0.
2005-09-10Specify the scan_ffs manpage, otherwise it will use scan_ffs.1.xtraeme
2005-09-10Fold scan_lfs.8 into scan_ffs.8. It's the same program, after all.wiz
Ok'd by xtraeme.
2005-09-09Improve wording and comma usage.wiz
2005-09-02Remove an extra conditional while searching for LFS superblocks,xtraeme
it's not needed.
2005-08-09Undefine the 17 macros commonly defined by <ufs/ffs/fs.h> andhe
<ufs/lfs/lfs.h> before including the second of them, and also after including the second, to ensure the rest of the code doesn't depend on their (ambigious) definition. This fixes a build problem for vax; gcc 2.95.3's preprocessor apparently doesn't like redefinition of macros. Discussed with xtraeme.
2005-08-09* Replace lseek() and read() calls with one single pread()xtraeme
* Align cpg/sgs correctly.
2005-07-31Pass lint and get/setprogname.christos
2005-07-31typoxtraeme
2005-07-31Add scan_lfs(8), utility to find LFS partitions on disk, usefulxtraeme
to recover lost disklabels.
2005-06-27Move WARNS=3 to the Makefile.inc, and add a little const to the remainingchristos
programs that did not compile before.
2005-06-23Add missing '\n' into usage().xtraeme
2005-06-19Remove superfluous .El; a slight wording change.wiz
2005-06-19Incorporate my review comments.wiz
2005-06-15WARNS=4, misc cleanups.christos
- void casts - remove unused notreached - use a loop instead of code duplication - use switches and #define constants
2005-06-15fix the date, use .An for names, correct the name (scanffs -> scan_ffs),peter
.Ox/.Nx for OpenBSD/NetBSD, mention appearance in NetBSD.
2005-06-15Use EXIT_{SUCCESS,FAILURE}.kleink
2005-06-15No need to define SRCS here.kleink