summaryrefslogtreecommitdiffstats
path: root/sbin/newfs
diff options
context:
space:
mode:
authorwes <wes@FreeBSD.org>2003-11-16 07:08:27 +0000
committerwes <wes@FreeBSD.org>2003-11-16 07:08:27 +0000
commit546aec2dd673375b176313efbc3150f607e196de (patch)
tree81c5c78b5be0e614e96eb96dfc675ee5d06486de /sbin/newfs
parent11baeec8ad8ffc68802dd66d8f19f663003d9d3e (diff)
downloadFreeBSD-src-546aec2dd673375b176313efbc3150f607e196de.zip
FreeBSD-src-546aec2dd673375b176313efbc3150f607e196de.tar.gz
Write the UFS2 superblock with a 'BAD' magic number at the beginning
of newfs, to signify the newfs operation has not yet completed. Re- write the superblock with the correct magic number once all of the cylinder groups have been created to show the operation has finished. Sponsored by: St. Bernard Software
Diffstat (limited to 'sbin/newfs')
-rw-r--r--sbin/newfs/mkfs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index 1c117e6..4cbce26 100644
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
@@ -259,7 +259,7 @@ mkfs(struct partition *pp, char *fsys)
sblock.fs_old_postblformat = 1;
sblock.fs_old_nrpos = 1;
} else {
- sblock.fs_magic = FS_UFS2_MAGIC;
+ sblock.fs_magic = FS_BAD2_MAGIC;
sblock.fs_sblockloc = SBLOCK_UFS2;
sblock.fs_nindir = sblock.fs_bsize / sizeof(ufs2_daddr_t);
sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs2_dinode);
@@ -449,6 +449,9 @@ mkfs(struct partition *pp, char *fsys)
chdummy, SBLOCKSIZE);
}
}
+ if (!Nflag)
+ sbwrite(&disk, 0);
+ sblock.fs_magic = FS_UFS2_MAGIC;
/*
* Now build the cylinders group blocks and
OpenPOWER on IntegriCloud