Discussion:
install fails at newfs
Mayuresh Kathe
2014-06-22 05:34:15 UTC
Permalink
hello,

i had to wipe out my system and reinstall 6.1.4 (for amd64) because my
constant tinkering messed up something somewhere and the system stopped
booting successfully.

during the install, at the point where newfs is run it stopped moving
ahead.
it mentioned something about rwd0a being busy.

so i dropped into a shell and ran the following command;
/sbin/newfs -V2 -O 2 -b 32768 -f 4096 /dev/rwd0a

it gave me the following error;
newfs: /dev/rwd0a: open for read: Device busy

i ran a 'ps -aux' to see if something else was accessing that disk.
nothing was.

is there something i'm doing wrong (the installer usually doesn't allow
for
much mistakes)?

best,

~mayuresh
Martin Husemann
2014-06-22 08:49:27 UTC
Permalink
Post by Mayuresh Kathe
it gave me the following error;
newfs: /dev/rwd0a: open for read: Device busy
You should check the output of mount in this case - it is probably already
mounted somewhere.


Martin
Mayuresh Kathe
2014-06-22 09:17:01 UTC
Permalink
Post by Martin Husemann
Post by Mayuresh Kathe
it gave me the following error;
newfs: /dev/rwd0a: open for read: Device busy
You should check the output of mount in this case - it is probably already
mounted somewhere.
will do, just can't figure how it can get mounted somewhere without
being asked to.

~mayuresh
Mayuresh Kathe
2014-06-22 09:55:05 UTC
Permalink
Post by Martin Husemann
Post by Mayuresh Kathe
it gave me the following error;
newfs: /dev/rwd0a: open for read: Device busy
You should check the output of mount in this case - it is probably already
mounted somewhere.
did, here's the output;
root_device on / type cd9660 (read-only, local)
tmpfs on /dev type tmpfs (union, local)
tmpfs on /tmp type tmpfs (local)
tmpfs on /var type tmpfs (local)
tmpfs on /etc type tmpfs (union, local)

as a check for hardware problems, i installed ubuntu 14.04 followed
by openbsd 5.4, both installed quite successfully and smoothly.
post that, retried installing netbsd 6.1.4, and dang, it failed at
exactly the same point.

any advice, suggestions and/or pointers to a solution would be more
than welcome.

thanks,

~mayuresh
Martin Husemann
2014-06-22 10:03:09 UTC
Permalink
Post by Mayuresh Kathe
did, here's the output;
root_device on / type cd9660 (read-only, local)
tmpfs on /dev type tmpfs (union, local)
tmpfs on /tmp type tmpfs (local)
tmpfs on /var type tmpfs (local)
tmpfs on /etc type tmpfs (union, local)
And in this state, can you re-run the newfs?
I suppose something(tm) went wrong before and left the device mounted
eroneously, which then caused further fallout.

Martin
Mayuresh Kathe
2014-06-22 10:06:23 UTC
Permalink
Post by Martin Husemann
Post by Mayuresh Kathe
did, here's the output;
root_device on / type cd9660 (read-only, local)
tmpfs on /dev type tmpfs (union, local)
tmpfs on /tmp type tmpfs (local)
tmpfs on /var type tmpfs (local)
tmpfs on /etc type tmpfs (union, local)
And in this state, can you re-run the newfs?
I suppose something(tm) went wrong before and left the device mounted
eroneously, which then caused further fallout.
i tried re-running 'newfs' as below;
/sbin/newfs -V2 -O 2 -b 32768 -f 4096 /dev/rwd0a

it gave the same error as before (below);
newfs: /dev/rwd0a: open for read: Device busy

~mayuresh
Martin Husemann
2014-06-22 10:09:09 UTC
Permalink
Post by Mayuresh Kathe
i tried re-running 'newfs' as below;
/sbin/newfs -V2 -O 2 -b 32768 -f 4096 /dev/rwd0a
it gave the same error as before (below);
newfs: /dev/rwd0a: open for read: Device busy
Interesting - what does "disklabel wd0" report?
And just as a sanity check, "ls -l /dev/rwd0a"?

Martin
Mayuresh Kathe
2014-06-22 10:51:12 UTC
Permalink
Post by Martin Husemann
Post by Mayuresh Kathe
i tried re-running 'newfs' as below;
/sbin/newfs -V2 -O 2 -b 32768 -f 4096 /dev/rwd0a
it gave the same error as before (below);
newfs: /dev/rwd0a: open for read: Device busy
Interesting - what does "disklabel wd0" report?
And just as a sanity check, "ls -l /dev/rwd0a"?
"disklabel wd0" reports the following;
# /dev/rwd0d:
type: unknown
disk: WDC WD5000AZRX-
label:
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 969021
total sectors: 976773168
rpm: 3600
interleave: 1
track skew: 0
cylinder skew: 0
lread switch: 0 # microseconds
track-to-track seek: 0 # microseconds
drive data: 0

16 partitions:
# size offset fstype [fsize bsize cpg/sgs]
a: 968999472 63 4.2BSD 4096 32768 0 # (Cyl. 0*-
961309*)
b: 7773633 968999535 swap # (Cyl. 961309*-
969020)
c: 976773105 63 unused 0 0 # (Cyl. 0*-
969020)
d: 976773168 0 unused 0 0 # (Cyl. 0*-
969020)

"ls -l /dev/rwd0a" reports the following;
crw-r----- 1 root operator 3, 0 Jun 22 10:14 /dev/rwd0a

thanks,

~mayuresh
Martin Husemann
2014-06-22 11:06:00 UTC
Permalink
Post by Mayuresh Kathe
"ls -l /dev/rwd0a" reports the following;
crw-r----- 1 root operator 3, 0 Jun 22 10:14 /dev/rwd0a
This all looks fine. Are you working with a custom kernel?
What does

sysctl hw.disknames

say?

Martin
Mayuresh Kathe
2014-06-22 11:20:52 UTC
Permalink
Post by Martin Husemann
Post by Mayuresh Kathe
"ls -l /dev/rwd0a" reports the following;
crw-r----- 1 root operator 3, 0 Jun 22 10:14 /dev/rwd0a
This all looks fine. Are you working with a custom kernel?
What does
sysctl hw.disknames
say?
no, it's just the generic kernel on the 6.1.4 install cd iso i
got off the netbsd.org site.

sysctl hw.disknames reports;
hw.disknames = wd0 dk0 cd0

i wonder what that "dk0" thing is.

thanks,

~mayuresh
Martin Husemann
2014-06-22 11:25:19 UTC
Permalink
Post by Mayuresh Kathe
i wonder what that "dk0" thing is.
This is your problem. Auto-discovery code created a wedge for you - dmesg
should tell you more details. this wedge covers parts of your wd0 drive
(probably exactly wd0a), and makes the wd0 device "busy".

If you use dk0 instead of wd0a everything should work fine.

Martin
Mayuresh Kathe
2014-06-22 11:41:45 UTC
Permalink
Post by Martin Husemann
Post by Mayuresh Kathe
i wonder what that "dk0" thing is.
This is your problem. Auto-discovery code created a wedge for you - dmesg
should tell you more details. this wedge covers parts of your wd0 drive
(probably exactly wd0a), and makes the wd0 device "busy".
If you use dk0 instead of wd0a everything should work fine.
a wedge! i'll have to read up on it.
in the meanwhile, is it possible to eliminate the wedge and do a normal
install
on the wd0 device?

~mayuresh
Martin Husemann
2014-06-22 11:43:22 UTC
Permalink
Post by Mayuresh Kathe
a wedge! i'll have to read up on it.
in the meanwhile, is it possible to eliminate the wedge and do a normal
install
on the wd0 device?
Just use the dk0 device for the installation, it basically just is an alias
for "wd0a".

Martin
Stephan
2014-06-23 07:09:15 UTC
Permalink
I have had exactly the same issue in the past. My solution was to
clear the first 512 Bytes of the physical disk* and rebooting.

* dd if=/dev/zero of=/dev/rsd0d bs=512 count=1


Regards,

Stephan
Post by Martin Husemann
Post by Mayuresh Kathe
a wedge! i'll have to read up on it.
in the meanwhile, is it possible to eliminate the wedge and do a normal
install
on the wd0 device?
Just use the dk0 device for the installation, it basically just is an alias
for "wd0a".
Martin
Continue reading on narkive:
Loading...