Commit Graph

136 Commits

Author SHA1 Message Date
Diomidis Spinellis
aa590d16d0 Remove a diagnostic message that can't occur: we lost the ability to
handle the old filesystem format on 2002/06/21.
2005-10-20 11:20:55 +00:00
Diomidis Spinellis
153fdc98cf Interpret correctly the glob(3) return value.
Previously, interactive commands specifying a non-existent file or
directory used to display an "out of memory error".

MFC after:	2 weeks
2005-07-21 16:12:35 +00:00
Philippe Charnier
35a974fdb8 rscid -> __FBSDID. Mark parameter as __unused when necessary. 2005-05-29 15:57:00 +00:00
Warner Losh
371c9f9384 Remove debug from last commit 2005-04-03 16:35:58 +00:00
Warner Losh
64a96794b7 /*- 2005-04-03 05:18:28 +00:00
Warner Losh
aad0ac34fe Revert bogus += -g change. I needed it to debug the problem.
Noticed by: njl, Andrej Tobola
2005-03-25 17:30:20 +00:00
Warner Losh
66b4217151 Restore the ability to read FreeBSD 1 tapes (and I think any net2
based tapes, but I'm not sure where NFS_MAGIC was introduced after
4.3).  When support for the pre-4.4 format was removed (the ability to
read 4.2 and 4.3 BSD tapes), the old format inode conversion was
junked as well.  However, FreeBSD 1 dump tapes use the NFS_MAGIC
format, but have this inode format.  Before, restore would fail
complaining that '.' wasn't found and the root directory wasn't on
this tape.  Since the conversion from the not so old format is
relatively trivial, restore the code to make that conversion.

FreeBSD 1 dumps are once again readable.

MFC After: a few days
2005-03-25 07:35:59 +00:00
Warner Losh
a2c0855654 dcvt is unused since the support for converting pre-4.4 tapes was
removed.  Go ahead and remove it and struct odirent since it too is
unused.

# FreeBSD 1.1.5 tapes are still unreadable, but 2.0 and newer work.
2005-03-25 06:57:50 +00:00
Warner Losh
84c248f850 c_tapea and c_firstrec are used for TS_TAPE blocks, so convert them
for the old (4.4-lite through FreeBSD 4.x and *BSD) format.  It looks
like they aren't used for TS_INODE, but conversion costs so little
there that I've not removed them there (in case my grep was wrong).

This makes at least some of the tapes work for me again.  Now, to
regresion test all my dusty tapes...
2005-03-25 06:03:11 +00:00
Warner Losh
372e256ad0 In order to print out the dump dates correctly, the date and ddate fields
also need to be convereted for old tapes for records of type TAPE.
2005-03-18 21:06:54 +00:00
Warner Losh
ecdd99f852 Sync usage and man page with reality. There's no '-c' command line
flag today.  Maybe we should still retain it, but I'll let others fight
that windmill.
2005-03-18 17:49:08 +00:00
Ruslan Ermilov
0227791b40 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
Ruslan Ermilov
8d646af581 Sync program's usage() with manpage's SYNOPSIS. 2005-02-10 09:19:34 +00:00
Ruslan Ermilov
6087df9e8b Sort sections. 2005-01-18 10:09:38 +00:00
Ruslan Ermilov
9806e23132 Mechanically kill hard sentence breaks. 2004-07-02 21:45:06 +00:00
Stefan Farfeleder
1916772e6f Use the correct types for the functions rst_opendir(), glob_readdir() and
rst_closedir() which are called by glob().

Reviewed by:	md5
Approved by:	das (mentor)
2004-05-24 16:24:26 +00:00
Stefan Farfeleder
e54fb3f2dc Include <timeconv.h> for time conversion functions.
Approved by:	das (mentor)
2004-05-24 16:10:57 +00:00
Ruslan Ermilov
d04b5dfe6c Assorted markup, grammar, and spelling fixes. 2004-05-17 08:35:43 +00:00
Brian Feldman
c51d70c690 Add -P arguments for dump(8) and restore(8) which allow the user to
use backup methods other than files and tapes.  The -P argument is
a normal sh(1) pipeline with either $DUMP_VOLUME or $RESTORE_VOLUME
defined in the environment, respectively.

For example, I can back up my home to three DVD+R[W]s as so:
Filesystem  1K-blocks     Used    Avail Capacity  Mounted on
/dev/ad0s2e  40028550 10093140 26733126    27%    /home
green# dump -0 -L -C16 -B4589840 -P 'growisofs -Z /dev/cd0=/dev/fd/0' /home
2004-04-13 02:58:06 +00:00
Mark Murray
4c723140a4 Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core, imp
2004-04-09 19:58:40 +00:00
Johan Karlsson
604d24db95 style.Makefile(5):
Use WARNS?= instead of WARNS=.
2004-02-23 20:25:27 +00:00
Peter Wemm
30d38f7b0d Fix gcc warnings. If NAME_MAX is 255, and d_namlen is a uint8_t, then
d_namlen can never be > NAME_MAX.  Stop gcc worrying about this by
using a preprocessor test to see if NAME_MAX changes.
2003-10-26 04:43:02 +00:00
Andrey A. Chernov
0407880f4b Localize 'ls' output
Don't set 8bit in quote processing
2003-08-06 08:46:21 +00:00
Philippe Charnier
9680d7b695 Add section number to .Xr 2003-06-08 12:51:28 +00:00
Ruslan Ermilov
44b81f0f89 Removed all vestiges of KerberosIV. 2003-05-01 21:18:36 +00:00
Ruslan Ermilov
cbfe6d117c Style. 2003-05-01 21:10:37 +00:00
Mark Murray
8edde085dd De-Kerberise (KerberosIV). KerberosIV is no longer present, and
remote backups can still be done with Kerberos authentication using
SSH and Kerberos 5.
2003-05-01 20:09:58 +00:00
Sheldon Hearn
c359d71a85 Add TAPE to the ENVIRONMENT section.
MFC after:	1 month
2003-01-10 10:55:13 +00:00
Sheldon Hearn
d1d5a33b13 Add an ENVIRONMENT section so that the reader knows that the TMPDIR envar
is honoured.

Reported by:	des
MFC after:	1 month
2003-01-10 10:45:48 +00:00
Ruslan Ermilov
463cfa804d Fixed the abuses of .Ql visible on stderr in troff mode.
PR:		docs/37176
2002-12-23 16:04:51 +00:00
Mike Barcroft
89fdc4e117 Use the standardized CHAR_BIT constant instead of NBBY in userland. 2002-09-25 04:06:37 +00:00
Philippe Charnier
7fed38d0a0 Replace various spelling with FALLTHROUGH which is lint()able 2002-08-25 13:10:45 +00:00
Warner Losh
0b0fe61dfb Use '0' instead of NULL when we mean the integer constant 0 and not a
"null pointer expression".
2002-08-21 18:52:32 +00:00
Tom Rhodes
ce66ddb763 s/filesystem/file system/g as discussed on -developers 2002-08-21 18:11:48 +00:00
Kirk McKusick
fb36a3d847 Change utimes to set the file creation time (for filesystems that
support creation times such as UFS2) to the value of the
modification time if the value of the modification time is older
than the current creation time. See utimes(2) for further details.

Sponsored by:	DARPA & NAI Labs.
2002-07-17 02:03:19 +00:00
Philippe Charnier
629e80effb The .Nm utility. 2002-07-06 19:35:14 +00:00
Kirk McKusick
1c85e6a35d This commit adds basic support for the UFS2 filesystem. The UFS2
filesystem expands the inode to 256 bytes to make space for 64-bit
block pointers. It also adds a file-creation time field, an ability
to use jumbo blocks per inode to allow extent like pointer density,
and space for extended attributes (up to twice the filesystem block
size worth of attributes, e.g., on a 16K filesystem, there is space
for 32K of attributes). UFS2 fully supports and runs existing UFS1
filesystems. New filesystems built using newfs can be built in either
UFS1 or UFS2 format using the -O option. In this commit UFS1 is
the default format, so if you want to build UFS2 format filesystems,
you must specify -O 2. This default will be changed to UFS2 when
UFS2 proves itself to be stable. In this commit the boot code for
reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c)
as there is insufficient space in the boot block. Once the size of the
boot block is increased, this code can be defined.

Things to note: the definition of SBSIZE has changed to SBLOCKSIZE.
The header file <ufs/ufs/dinode.h> must be included before
<ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and
ufs_lbn_t.

Still TODO:
Verify that the first level bootstraps work for all the architectures.
Convert the utility ffsinfo to understand UFS2 and test growfs.
Add support for the extended attribute storage. Update soft updates
to ensure integrity of extended attribute storage. Switch the
current extended attribute interfaces to use the extended attribute
storage. Add the extent like functionality (framework is there,
but is currently never used).

Sponsored by: DARPA & NAI Labs.
Reviewed by:	Poul-Henning Kamp <phk@freebsd.org>
2002-06-21 06:18:05 +00:00
Tom Rhodes
3468b317cb more file system > filesystem 2002-05-16 04:10:46 +00:00
Ian Dowse
a255f2f8fa Address a few minor style and consistency issues in revision 1.32.
Submitted by:	Joshua Goodall <joshua@roughtrade.net>
2002-05-06 15:15:51 +00:00
Ian Dowse
915a1dab22 Set the permissions on restored symbolic links.
PR:		bin/37665
Submitted by:	"Michael C. Adler" <mad1@tapil.com>
2002-05-02 17:39:19 +00:00
Ruslan Ermilov
71b3ac84e1 Replaced exists() tests with two equivalent defined().
LIBDIR is defined in bsd.own.mk but sys.mk no longer
includes bsd.own.mk as of revision 1.60.
2002-04-18 07:01:35 +00:00
Tom Rhodes
9532eef22c restore(8) manual page does not explain rrestore.
PR:		34234
Submitted by:	Gary W. Swearingen <swear@blarg.net>
2002-04-12 18:31:09 +00:00
Warner Losh
2db673ab00 o remove __P
o Use ANSI function definitions
o unifdef -D__STDC__
2002-03-20 22:49:40 +00:00
David E. O'Brien
3d438ad61f Remove 'register' keyword.
It does not help modern compilers, and some may take some hit from it.
(I also found several functions that listed *every* of its 10 local vars with
 "register" -- just how many free registers do people think machines have?)
2002-03-20 17:55:10 +00:00
Ian Dowse
ab3d6ee098 Use a more robust scheme for determining how many blocks to skip
after an EOT-terminated volume. We keep track of the current record
number, and synchronise it with the c_tapea field each time we read
a header. Avoid the use of c_firstrec because some bugs in dump can
cause it to be set incorrectly.

Move the initialisation of some variables to avoid compiler warnings.
2002-02-18 02:29:47 +00:00
Ian Dowse
dea08b6818 When we reach the end of the dump in findinode(), ask for another
volume if we missed some earlier tapes (the user can still enter
'none' later if the tapes are unavailable). Previously with 'x'
restores, we might not ask for all tapes if the tapes are supplied
in reverse order.

Clarify the message that describes what volume should be mounted
first; reverse order is only efficient when extracting a few files.
2002-02-18 00:54:18 +00:00
Ian Dowse
cfd8a00918 In createfiles(), properly handle a number of cases where no further
volumes are available, instead of getting stuck in a loop calling
getvol(). Normally restore in 'x' or 'i' modes will ask for a new
(earlier) volume when the current inode number on the tape is greater
than the last inode to be restored, since there can be no further
inodes of interest on that volume. However we don't want to change
volumes in this case either if the user explicitly said that there
are no more tapes, or if we are looking at the first volume.

When no more volumes are available but there are still inodes that
we have not found, we now just fall through to the code that prints
out a list of any missing files, so the restore completes normally.
Also simplify the logic a bit by always returning to the start of
the main for(;;) loop whenever the volume has changed.

This should completely fix the "Changing volumes on pipe input" bug
that is often observed when restoring dumps of active filesystems.

PR:		bin/4176, bin/34604, misc/34675
2002-02-14 01:30:45 +00:00
Ian Dowse
1603684d77 Fix a number of long-standing restore bugs in tape.c, mainly relating
to multi-volume restores:
 - In findinode(), keep a copy of header->c_type so that we don't
   exit the do-while loop until we have processed the current header.
   Exiting too early leaves curfile.ino set to 0, which confuses
   the logic in createfiles(), so multi-volume restores with the
   'x' command don't work if you follow the instructions and supply
   the tapes in reverse order.  This appears to have been broken
   by CSRG revision 5.33 tape.c (Oct 1992).
 - The logic in getvol() for deciding how many records to skip after
   the volume header was confused; sometimes it would skip too few
   records and sometimes too many, leading to "resync restore"
   warnings and missing files. Skip to the next header only when
   the current action is not `USING'. Work around a dump bug that
   sets c_count incorrectly in the volume header of the first tape.
   Some of the problems here date back to at least 1991.
 - Back out revision 1.23. This appeared to avoid warnings about
   missing files in the 'rN' verification case, but it made the
   problems with the 'x' command worse by stopping getvol() from
   even attempting to find the first inode number on the newly
   inserted tape. The bug it addressed is fixed by correcting the
   skipping logic as described above.
 - Save the value of `tpblksread' in case the wrong volume is
   supplied, because it is incremented each time we read a volume
   header. We already saved `blksread' for the same reson.
2002-02-13 12:06:58 +00:00
Ian Dowse
b6024ea8ed Don't refer to findinode()'s `complain' parameter in a comment; it
was removed in 1986.
2002-02-12 17:15:45 +00:00
Matthew Dillon
170ac683f2 I've been meaning to do this for a while. Add an underscore to the
time_to_xxx() and xxx_to_time() functions.  e.g. _time_to_xxx()
instead of time_to_xxx(), to make it more obvious that these are
stopgap functions & placemarkers and not meant to create a defacto
standard.  They will eventually be replaced when a real standard
comes out of committee.
2002-01-19 23:20:02 +00:00