Results 1 to 9 of 9
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 05-17-2007 #1Linux User
- Join Date
- Dec 2004
- Posts
- 323
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:
I have not found a way to get around this problem. How do I open a disk for writing?Code:[root@athens /dev]# newfs -U -L FreeBSDonUSB /dev/da0 newfs: /dev/da0: failed to open disk for writing
Thanks in advance
- 05-17-2007 #2
Check
to be sure we're really talking about /dev/da0.Code:$ dmesg | grep da
If so, I think you want /dev/da0s1 (which is slice 1).
- 05-19-2007 #3Linux User
- Join Date
- Dec 2004
- Posts
- 323
Thanks for the response, and for your information, here is some more output:
I am still not sure what needs to be done to make this work. Thanks in advance.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
- 05-19-2007 #4
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.
- 05-19-2007 #5Linux User
- Join Date
- Dec 2004
- Posts
- 323
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.
- 05-19-2007 #6
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.
- 05-20-2007 #7Linux User
- Join Date
- Dec 2004
- Posts
- 323
Thanks again for your suggestions. By way of overview, some output of the commands I have tried. This is in /etc/fstab:
These are the commands I executed to arrive at the error message: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
By the way, the USB drive is new and empty.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
For unmounting da0, I have the following output:
Not sure where it is going wrong or how it should be corrected. Thanks again in advanceCode:[root@athens /dev]# umount /dev/da0 umount: /dev/da0: unknown file system
Last edited by technossomy; 05-20-2007 at 08:43 AM. Reason: Added last line
- 05-20-2007 #8
You'll need to unmount the slice (just as you mounted it). So it would be:
orCode:# umount /dev/da0s1
After that is done, try following the steps in post #4 of this thread again.Code:# umount /mnt
- 05-21-2007 #9Linux User
- Join Date
- Dec 2004
- Posts
- 323
I am on my way, thanks for the guidance. Very helpful.


Reply With Quote
