Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > The Community > Everything BSD
Reload this Page failed to open disk for writing
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Everything BSD For all discussions regarding Free/NetBSD and OpenBSD.

Reply
 
Thread Tools Display Modes
Old 05-17-2007   #1 (permalink)
technossomy
Linux User
 
Join Date: Dec 2004
Posts: 285
failed to open disk for writing

I am mounting a USB flash drive to my FreeBSD 6.2 box in order for it to be used to boot FreeBSD from it. When trying to set the filesystem I get the following error:
Code:
[root@athens /dev]# newfs -U -L FreeBSDonUSB /dev/da0
newfs: /dev/da0: failed to open disk for writing
I have not found a way to get around this problem. How do I open a disk for writing?

Thanks in advance
technossomy is offline   Reply With Quote
Old 05-17-2007   #2 (permalink)
anomie
Linux Guru
 
anomie's Avatar
 
Join Date: Mar 2005
Location: Texas
Posts: 1,699
Check
Code:
$ dmesg | grep da
to be sure we're really talking about /dev/da0.

If so, I think you want /dev/da0s1 (which is slice 1).
anomie is offline   Reply With Quote
Old 05-19-2007   #3 (permalink)
technossomy
Linux User
 
Join Date: Dec 2004
Posts: 285
Thanks for the response, and for your information, here is some more output:
Code:
[root@athens /dev]# dmesg | grep da
da0 at umass-sim0 bus 0 target 0 lun 0
da0: < USB Flash Memory 5.00> Removable Direct Access SCSI-0 device
da0: 40.000MB/s transfers
da0: 983MB (2013184 512 byte sectors: 64H 32S/T 983C)
[root@athens /dev]# newfs -U -L FreeBSDonUSB /dev/da0s1
newfs: /dev/da0s1: failed to open disk for writing
I am still not sure what needs to be done to make this work. Thanks in advance.
technossomy is offline   Reply With Quote
Old 05-19-2007   #4 (permalink)
anomie
Linux Guru
 
anomie's Avatar
 
Join Date: Mar 2005
Location: Texas
Posts: 1,699
From here we'll create a new slice and disk label, and then your newfs command should work.
  • First, use sysinstall to create the new slice on da0. If you're not familiar with it, its usage is here: Adding Disks - Section 18.3.1, steps 1 and 2. Only create the slice and then write the changes (say 'yes' when it asks you if you're sure). Don't worry about creating a label until the next step.
  • Next, write a standard label with the command:
    Code:
    # bsdlabel -w /dev/da0s1
  • Last, run the newfs command you specified.
anomie is offline   Reply With Quote
Old 05-19-2007   #5 (permalink)
technossomy
Linux User
 
Join Date: Dec 2004
Posts: 285
Thanks again for the response. I have done as outlined in the freebsd webpage on sysinstall. And when pressing 'W' to write the changes it says:
ERROR: unable to write data to disk: da0!
Disk partition write returned an error status!

Not sure where it is going wrong.
technossomy is offline   Reply With Quote
Old 05-19-2007   #6 (permalink)
anomie
Linux Guru
 
anomie's Avatar
 
Join Date: Mar 2005
Location: Texas
Posts: 1,699
You don't have da0 mounted already, do you? And you didn't boot from it?

I made a couple assumptions in this -- that you're running FBSD 6.2. on a box (w/ separate drive) and that you're trying to do this operation on a new usb drive that does not contain partitions already. (Is that all true?)

If da0 is mounted, unmount it first. If FBSD is actually running from da0 now, you're going to need to do this a different way. If da0 already contains partitions, delete them before creating new.
anomie is offline   Reply With Quote
Old 05-20-2007   #7 (permalink)
technossomy
Linux User
 
Join Date: Dec 2004
Posts: 285
Thanks again for your suggestions. By way of overview, some output of the commands I have tried. This is in /etc/fstab:
Code:
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ad0s1b             none            swap    sw              0       0
/dev/ad0s1a             /               ufs     rw              1       1
/dev/ad0s1e             /tmp            ufs     rw              2       2
/dev/ad0s1f             /usr            ufs     rw              2       2
/dev/ad0s1d             /var            ufs     rw              2       2
/dev/acd0               /cdrom          cd9660  ro,noauto       0       0
These are the commands I executed to arrive at the error message:
Code:
# mount the USB flash drive
sysctl vfs.usermount=1
mount_msdosfs /dev/da0s1 /mnt

# mount the iso on /dist
mkdir -p /dist
mdconfig -a -f /usr/FreeBSD/6.2-RC1-i386-disc1.iso
# output at this point is: md0
mount -t cd9660 /dev/md0 /dist

# create BSD slice and apply disklabel
fdisk -BI /dev/da0
bsdlabel -B -w da0s1

# create a filesystem
newfs -U -L FreeBSDonUSB /dev/da0s1a
# error output lead me to initiate this thread
By the way, the USB drive is new and empty.

For unmounting da0, I have the following output:
Code:
[root@athens /dev]# umount /dev/da0
umount: /dev/da0: unknown file system
Not sure where it is going wrong or how it should be corrected. Thanks again in advance

Last edited by technossomy; 05-20-2007 at 08:43 AM. Reason: Added last line
technossomy is offline   Reply With Quote
Old 05-20-2007   #8 (permalink)
anomie
Linux Guru
 
anomie's Avatar
 
Join Date: Mar 2005
Location: Texas
Posts: 1,699
You'll need to unmount the slice (just as you mounted it). So it would be:
Code:
# umount /dev/da0s1
or
Code:
# umount /mnt
After that is done, try following the steps in post #4 of this thread again.
anomie is offline   Reply With Quote
Old 05-21-2007   #9 (permalink)
technossomy
Linux User
 
Join Date: Dec 2004
Posts: 285
I am on my way, thanks for the guidance. Very helpful.
technossomy is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Eeek! Can't assemble degraded/dirty RAID6 array! cwilkins Servers 3 11-29-2006 03:49 PM
gtk-gnutella help crashandburn0420 Gentoo Linux Help 7 02-03-2006 10:55 AM
NO sound on kerne-l2.6 with KDE-3.4.1 operator Slackware Linux Help 16 07-23-2005 12:35 PM
New to wine street9009 Wine 4 05-13-2005 09:13 PM
Open Office Floppy Disk Save Question Anonymous Misc 2 12-02-2002 10:44 AM




All times are GMT. The time now is 11:01 PM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0