From 81d6b311020dc650aa2b900f7a08156ffecedba9 Mon Sep 17 00:00:00 2001 From: rwatson Date: Sun, 20 Apr 2003 14:08:05 +0000 Subject: Throw the switch--change to UFS2 as our default file system format for FreeBSD 5.1-RELEASE and later: - newfs(8) will now create UFS2 file systems unless UFS1 is specifically requested (-O1). To do this, I just twiddled the Oflag default. - sysinstall(8) will now select UFS2 as the default layout for new file systems unless specifically requested (use '1' and '2' to change the file system layout in the disk labeler). To do this, I inverted the ufs2 flag into a ufs1 flag, since ufs2 is now the default and ufs1 is the edge case. There's a slight semantic change in the key behavior: '2' no longer toggles, it changes the selection to UFS2. This is very similar to a patch David O'Brien sent me at one point, and that I couldn't find. Approved by: re (telecon) Reviewed by: mckusick, phk, bmah --- usr.sbin/sade/help/partition.hlp | 24 ++++++++++++++---------- usr.sbin/sade/install.c | 2 +- usr.sbin/sade/label.c | 28 +++++++++++++++++++++------- usr.sbin/sade/sade.h | 2 +- 4 files changed, 37 insertions(+), 19 deletions(-) (limited to 'usr.sbin/sade') diff --git a/usr.sbin/sade/help/partition.hlp b/usr.sbin/sade/help/partition.hlp index a6de29e..9b5a822 100644 --- a/usr.sbin/sade/help/partition.hlp +++ b/usr.sbin/sade/help/partition.hlp @@ -126,16 +126,20 @@ with significant activity can temporarily overflow if the soft updates policy results in free'd blocks not being "garbage collected" as fast as they're being requested. -To make use of UFS2, press '2' on a UFS file system to toggle the -on-disk format revision. UFS2 provides native support for extended -attributes, larger disk sizes, and forward compatibility with new -on-disk high performance directory layout and storage extents. -However, UFS2 is unsupported on versions of FreeBSD prior to 5.0, -so it is not recommended for environments requiring backward -compatibility. Also, UFS2 is not currently recommended as a root -file system format for non-64-bit platforms due to increased size -of the boot loader; special local configuration is required to boot -UFS2 as a root file system on i386 and PC98. +The UNIX File System (UFS) on FreeBSD supports two different on-disk +layouts: UFS1 and UFS2. UFS1 was the default file system in use +through FreeBSD 5.0-RELEASE; as of FreeBSD 5.1-RELEASE, the default +is now UFS2. UFS2 provides sparse inode allocation (faster +fsck), 64-bit storage pointers (larger maximum size), and native +extended attributes (required for ACLs, MAC, and other advanced +security and file system services). The selection of UFS1 or +UFS2 must be made when the file system is created--later conversion +is not currently possible. UFS2 is the recommended file system, but +if disks are to be used on older FreeBSD systems, UFS1 improves +portability. When dual-booting between FreeBSD 4.x or earlier and +FreeBSD 5.x, UFS1 file systems will be accessible from both. +To toggle a file system to UFS1, press '1'. To restore it to UFS2, +press '2'. To add additional flags to the newfs command line for UFS file systems, press 'N'. These options will be specified before the diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index 59dc6ea..366edb2 100644 --- a/usr.sbin/sade/install.c +++ b/usr.sbin/sade/install.c @@ -879,7 +879,7 @@ performNewfs(PartInfo *pi, char *dname, int queue) snprintf(buffer, LINE_MAX, "%s %s %s %s %s", NEWFS_UFS_CMD, pi->newfs_data.newfs_ufs.softupdates ? "-U" : "", - pi->newfs_data.newfs_ufs.ufs2 ? "-O2" : "-O1", + pi->newfs_data.newfs_ufs.ufs1 ? "-O1" : "-O2", pi->newfs_data.newfs_ufs.user_options, dname); break; diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c index 24d438f..e2ff08c 100644 --- a/usr.sbin/sade/label.c +++ b/usr.sbin/sade/label.c @@ -337,7 +337,7 @@ new_part(char *mpoint, Boolean newfs) pi->newfs_data.newfs_ufs.acls = FALSE; pi->newfs_data.newfs_ufs.multilabel = FALSE; pi->newfs_data.newfs_ufs.softupdates = strcmp(mpoint, "/"); - pi->newfs_data.newfs_ufs.ufs2 = FALSE; + pi->newfs_data.newfs_ufs.ufs1 = FALSE; return pi; } @@ -461,7 +461,7 @@ getNewfsCmd(PartInfo *p) case NEWFS_UFS: snprintf(buffer, NEWFS_CMD_ARGS_MAX, "%s %s %s %s", NEWFS_UFS_CMD, p->newfs_data.newfs_ufs.softupdates ? "-U" : "", - p->newfs_data.newfs_ufs.ufs2 ? "-O2" : "-O1", + p->newfs_data.newfs_ufs.ufs1 ? "-O1" : "-O2", p->newfs_data.newfs_ufs.user_options); break; case NEWFS_MSDOS: @@ -686,10 +686,10 @@ print_label_chunks(void) switch (pi->newfs_type) { case NEWFS_UFS: strcpy(newfs, NEWFS_UFS_STRING); - if (pi->newfs_data.newfs_ufs.ufs2) - strcat(newfs, "2"); - else + if (pi->newfs_data.newfs_ufs.ufs1) strcat(newfs, "1"); + else + strcat(newfs, "2"); if (pi->newfs_data.newfs_ufs.softupdates) strcat(newfs, "+S"); else @@ -872,6 +872,21 @@ diskLabel(Device *dev) clear_wins(); break; + case '1': + if (label_chunk_info[here].type == PART_FILESYSTEM) { + PartInfo *pi = + ((PartInfo *)label_chunk_info[here].c->private_data); + + if ((pi != NULL) && + (pi->newfs_type == NEWFS_UFS)) { + pi->newfs_data.newfs_ufs.ufs1 = true; + } else + msg = MSG_NOT_APPLICABLE; + } else + msg = MSG_NOT_APPLICABLE; + break; + break; + case '2': if (label_chunk_info[here].type == PART_FILESYSTEM) { PartInfo *pi = @@ -879,8 +894,7 @@ diskLabel(Device *dev) if ((pi != NULL) && (pi->newfs_type == NEWFS_UFS)) { - pi->newfs_data.newfs_ufs.ufs2 = - !pi->newfs_data.newfs_ufs.ufs2; + pi->newfs_data.newfs_ufs.ufs1 = false; } else msg = MSG_NOT_APPLICABLE; } else diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index d26ef8a..cf53575 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.h @@ -334,7 +334,7 @@ typedef struct _part_info { Boolean acls; /* unused */ Boolean multilabel; /* unused */ Boolean softupdates; - Boolean ufs2; + Boolean ufs1; } newfs_ufs; struct { /* unused */ -- cgit v1.1