Bug 79840 - sysinstall(8): Partitioning and formating a new disk fails using sysinstall
Summary: sysinstall(8): Partitioning and formating a new disk fails using sysinstall
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 5.4-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-sysinstall (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-12 23:00 UTC by Thomas Schweikle
Modified: 2015-11-10 09:12 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Schweikle 2005-04-12 23:00:46 UTC
	walnut# dd if=3D/dev/zero of=3Ddev/da2 bs=3D1024 count=3D4
	walnut# /stand/sysinstall

	Goto "Configure"
	Goto "Fdisk"
	Select "da2"
	Key "A" - "Use Entire Disk"
	Key "W" - "Write Changes"
	Select "Yes" for "User Confirmation Requested"
	Select "BootMgr"
	Tab to "OK"
	Key "CR"
	Message "Wrote FDISK partition information out successfully."
	Key "CR"
	Key "Q"

	Goto "Label"
	Key "C"
	Partition Size: "384M"; Key "CR"
	Partition Type: "FS"; Key "CR"
	Mount Point: "/new"; Key "CR"
	Partition Size: "256M"; Key "CR"
	Partition Type: "SWAP"; Key "CR"
	Partition Size: "384M"; Key "CR"
	Partition Type: "FS"; Key "CR"
	Mount Point: "/new/tmp"; Key "CR"
	Partition Size: "384M"; Key "CR"
	Partition Type: "FS"; Key "CR"
	Mount Point: "/new/var"; Key "CR"
	Partition Size: "1G"; Key "CR"
	Partition Type: "FS"; Key "CR"
	Mount Point: "/new/home"; Key "CR"
	Partition Size: keep what is given; Key "CR"
	Partition Type: "FS"; Key "CR"
	Mount Point: "/new/usr"; Key "CR"
	Select "da2s1d"; Key "S"

	Now it is shown:
	Disk: da2       Partition name: da2s1   Free: 0 blocks (0MB)

	Part      Mount          Size Newfs
	----      -----          ---- -----
	da2s1d    /new          384MB UFS2   Y
	da2s1b    swap          256MB SWAP
	da2s1e    /new/tmp      384MB UFS2+S Y
	da2s1f    /new/var      384MB UFS2+S Y
	da2s1g    /new/home    1024MB UFS2+S Y
	da2s1h    /new/usr     3710MB UFS2+S Y

	Key "W"
	"User Confirmation Requested" - Select "Yes"; Key "CR"
	"Unable to add /dev/da2s1b as swap device: \
	   No such file or directory"; Key "CR"
	"Error mounting /dev/da2s1d on /new : \
	   No such file or directory"; Key "CR"
	"Error mounting /dev/da2s1g on /new/home : \
	   No such file or directory"; Key "CR"
	"Error mounting /dev/da2s1e on /new/tmp : \
	   No such file or directory"; Key "CR"
	"Error mounting /dev/da2s1h on /new/usr : \
	   No such file or directory"; Key "CR"
	"Error mounting /dev/da2s1f on /new/var : \
	   No such file or directory"; Key "CR"
	Key "Q"
	Select "X Exit"; Key "CR"
	Select "X Exit Install"; Key "CR"

	Now have a look at what "ls" tells us:
	walnut# ll /
	total 60
	-r--r--r--   1 root  wheel  6192 Jan 31 10:18 COPYRIGHT
	drwxr-xr-x   2 root  wheel  1024 Apr  7 01:22 bin
	[...]
	drwxr-xr-x   6 root  wheel   512 Apr  7 23:06 new
	[...]
	walnut#
	The errors above are not because "/new" did not exist.

	What about "ls -la /dev/da2*":
	crw-r-----  1 root  operator    4,  14 Apr  8 20:07 /dev/da2
	crw-r-----  1 root  operator    4,  91 Apr  8 18:24 /dev/da2s1
	crw-r-----  1 root  operator    4,  92 Apr  8 18:24 /dev/da2s1c

	The same with a "DD" disk:
	walnut# dd if=3D/dev/zero of=3Ddev/da2 bs=3D1024 count=3D4
	walnut# /stand/sysinstall

	Goto "Configure"
	Goto "Fdisk"
	Select "da2"
	Key "A" - "Use Entire Disk"
	Key "F" - "'DD' Mode"
	"Do you want to do this with a true ..."; Select "No"; Key "CR"
	Key "W" - "Write Changes"
	Select "Yes" for "User Confirmation Requested"
	Message "Wrote FDISK partition information out successfully."
	Key "CR"
	Key "Q"

	Goto "Label"
	Key "C"
	Partition Size: "384M"; Key "CR"
	Partition Type: "FS"; Key "CR"
	Mount Point: "/new"; Key "CR"
	Partition Size: "256M"; Key "CR"
	Partition Type: "SWAP"; Key "CR"
	Partition Size: "384M"; Key "CR"
	Partition Type: "FS"; Key "CR"
	Mount Point: "/new/tmp"; Key "CR"
	Partition Size: "384M"; Key "CR"
	Partition Type: "FS"; Key "CR"
	Mount Point: "/new/var"; Key "CR"
	Partition Size: "1G"; Key "CR"
	Partition Type: "FS"; Key "CR"
	Mount Point: "/new/home"; Key "CR"
	Partition Size: keep what is given; Key "CR"
	Partition Type: "FS"; Key "CR"
	Mount Point: "/new/usr"; Key "CR"
	Select "da2s1d"; Key "S"

	Now it is shown:
	Disk: da2       Partition name: da2s1   Free: 0 blocks (0MB)

	Part      Mount          Size Newfs
	----      -----          ---- -----
	da2s1d    /new          384MB UFS2   Y
	da2s1b    swap          256MB SWAP
	da2s1e    /new/tmp      384MB UFS2+S Y
	da2s1f    /new/var      384MB UFS2+S Y
	da2s1g    /new/home    1024MB UFS2+S Y
	da2s1h    /new/usr     3710MB UFS2+S Y

	Key "W"
	"User Confirmation Requested" - Select "Yes"; Key "CR"
	"Unable to add /dev/da2s1b as swap device: \
	   No such file or directory"; Key "CR"
	"Error mounting /dev/da2s1d on /new : \
	   No such file or directory"; Key "CR"
	"Error mounting /dev/da2s1g on /new/home : \
	   No such file or directory"; Key "CR"
	"Error mounting /dev/da2s1e on /new/tmp : \
	   No such file or directory"; Key "CR"
	"Error mounting /dev/da2s1h on /new/usr : \
	   No such file or directory"; Key "CR"
	"Error mounting /dev/da2s1f on /new/var : \
	   No such file or directory"; Key "CR"
	Key "Q"
	Select "X Exit"; Key "CR"
	Select "X Exit Install"; Key "CR"

	Now have a look at what "ls" tells us:
	walnut# ll /
	total 60
	-r--r--r--   1 root  wheel  6192 Jan 31 10:18 COPYRIGHT
	drwxr-xr-x   2 root  wheel  1024 Apr  7 01:22 bin
	[...]
	drwxr-xr-x   6 root  wheel   512 Apr  7 23:06 new
	[...]
	walnut#
	The errors above are not because "/new" did not exist.

	What about "ls -la /dev/da2*":
	crw-r-----  1 root  operator    4,  14 Apr  8 20:07 /dev/da2
	crw-r-----  1 root  operator    4,  91 Apr  8 18:24 /dev/da2s1
	crw-r-----  1 root  operator    4,  92 Apr  8 18:24 /dev/da2s1c

Fix: 

Workaround: use fdisk/bsdlabel instead.

        walnut# dd if=3D/dev/zero of=3Ddev/da2 bs=3D1024 count=3D4
        walnut# fdisk -I -v /dev/da2
        ******* Working on device /dev/da2 *******
        fdisk: invalid fdisk partition table found
        parameters extracted from in-core disklabel are:
        cylinders=3D783 heads=3D255 sectors/track=3D63 (16065 blks/cyl)

        parameters to be used for BIOS calculations are:
        cylinders=3D783 heads=3D255 sectors/track=3D63 (16065 blks/cyl)

        Information from DOS bootblock is:
        1: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
            start 63, size 12578832 (6142 Meg), flag 80 (active)
                beg: cyl 0/ head 1/ sector 1;
                end: cyl 782/ head 254/ sector 63
        2: <UNUSED>
        3: <UNUSED>
        4: <UNUSED>
        walnut# ls -la /dev/da2*
        crw-r----- 1 root  operator  4,  14 Apr  8 20:46 /dev/da2
        crw-r----- 1 root  operator  4, 101 Apr  8 18:24 /dev/da2s1
        crw-r----- 1 root  operator  4, 102 Apr  8 18:24 /dev/da2s1c

	OK so far. Take the part with bsdlabel. First create a file
	holding all partition information (I have named it "label.txt"):
        # /dev/da2:
        8 partitions:
        #        size   offset    fstype   [fsize bsize bps/cpg]
          a:     384M        *    4.2BSD
          b:     256M        *    swap
          d:     384M        *    4.2BSD
          e:     384M        *    4.2BSD
          f:       1G        *    4.2BSD
          g:        *        *    4.2BSD

	walnut# bsdlabel -B -R label.txt
        walnut# ls -la /dev/da2*
        crw-r-----  1 root operator  4,  14 Apr  8 20:46 /dev/da2
        crw-r-----  1 root operator  4, 101 Apr  8 18:24 /dev/da2s1
        crw-r-----  1 root operator  4, 118 Apr  8 18:26 /dev/da2s1a
        crw-r-----  1 root operator  4, 119 Apr  8 18:26 /dev/da2s1b
        crw-r-----  1 root operator  4, 102 Apr  8 18:24 /dev/da2s1c
        crw-r-----  1 root operator  4, 121 Apr  8 18:26 /dev/da2s1d
        crw-r-----  1 root operator  4, 122 Apr  8 18:26 /dev/da2s1e
        crw-r-----  1 root operator  4, 123 Apr  8 18:26 /dev/da2s1f
        crw-r-----  1 root operator  4, 124 Apr  8 18:26 /dev/da2s1g

        Now no errors creating the file systems and mounting:
        walnut# newfs -O2 /dev/da2s1a
        walnut# newfs -O2 -U /dev/da2s1d
        walnut# newfs -O2 -U /dev/da2s1e
        walnut# newfs -O2 -U /dev/da2s1f
        walnut# newfs -O2 -U /dev/da2s1g

        walnut# mount /dev/da2s1a /new
        walnut# mkdir /new/tmp; mount /dev/da2s1d /new/tmp
        walnut# mkdir /new/var; mount /dev/da2s1e /new/var
        walnut# mkdir /new/home; mount /dev/da2s1f /new/home
        walnut# mkdir /new/usr; mount /dev/da2s1g /new/usr

        walnut# mount
        [...]
        /dev/da2s1a on /new (ufs, local)
        /dev/da2s1d on /new/tmp (ufs, local, soft-updates)
        /dev/da2s1e on /new/var (ufs, local, soft-updates)
        /dev/da2s1f on /new/home (ufs, local, soft-updates)   =20
        /dev/da2s1g on /new/usr (ufs, local, soft-updates)   =20


--nextPart4155202.9uMENfhfao
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (FreeBSD)

iD8DBQBCXESnJuPdOes4UCQRAtzWAJ9Ocx0Heh77Mus1XWKgd/6E25FyDQCePlsV
tpEJASvrwzq3eou75u5DqPU=
=aGE2
-----END PGP SIGNATURE-----

--nextPart4155202.9uMENfhfao--
How-To-Repeat: 	start sysinstall, then follow the instructions above.
Comment 1 Gavin Atkinson freebsd_committer freebsd_triage 2007-06-28 17:38:21 UTC
State Changed
From-To: open->feedback


To submitter:  Do you still see this problem on later versions of FreeBSD? 
I suspect this was fixed when sysinstall was taught about GEOM.
Comment 2 Thomas Schweikle 2007-07-05 07:10:05 UTC
I do see this problem with 6.1, 6.2 I did not test --- maybe
tomorrow. With 7.0 it seems gone.

-- 
Thomas
Comment 3 Gavin Atkinson freebsd_committer freebsd_triage 2007-07-30 11:14:23 UTC
State Changed
From-To: feedback->open

Submitter provided feedback: this seems fixed in -HEAD but not 6.1.
Comment 4 Thomas Schweikle 2007-08-29 22:06:38 UTC
I could test again with the latest system compiled for
- FreeBSD 5.5
- FreeBSD 6.1
- FreeBSD 6.2
- FreeBSD HEAD

The problem exists with
- FreeBSD 5.5
- FreeBSD 6.1
- FreeBSD 6.2

The problem does not exist anymore with
- FreeBSD HEAD

All systems checked out at Aug., 27th 2007

-- 
Thomas
Comment 5 ranajas 2008-11-21 22:03:17 UTC
I got the same error several times on several diffrent machines.
label in sysinstall is not working correctly.

1 workaround to get it to work is to exit sysinstall och enter it again.
-----
Usally the label will only show the last disk that was handled last time?


So except problem with label not beeing able to write the changes (mount 
problem?)
Label cache the last used disk and dont display other disks..

7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008     
root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2009-04-20 21:29:45 UTC
Responsible Changed
From-To: freebsd-i386->freebsd-bugs

Canonicalize assignment.
Comment 7 Gavin Atkinson freebsd_committer freebsd_triage 2010-07-13 14:37:18 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-sysinstall

Over to maintainer(s)
Comment 8 Enji Cooper freebsd_committer freebsd_triage 2015-11-10 09:08:13 UTC
sysinstall has been replaced by bsdinstall in FreeBSD 9.x. Closing.
Comment 9 Enji Cooper freebsd_committer freebsd_triage 2015-11-10 09:12:28 UTC
sysinstall has been replaced by bsdinstall in FreeBSD 9.x. Closing.