UFS Error device busy.

In the course of adding a second hard disk for local backup and invoking the partition editor I noticed that the data label was absent.
I then tried to delete the configuration to redo the configuration but the message 'error device busy' stopped me from doing so.

How can I identify the cause of the message & correct the problem? See attached original file. Thanks for any help.
Screenshot from 2019-09-24 02-00-29.png
partition editor file.
 
Please don't post screenshot, use copy/paste.

the data label was absent.
What?

It's hard to tell what aou are trying to do.
Is the external disk /dev/da0 the drive you want to use for backup?
Did you try to destroy it's partitions while it was mounted when you received the "busy" error?
If yes, then it looks like you mounted one rootfs onto another. If you actually booted in this configuration you can't umount them now.
You have to shutdown your computer, remove the external disk an boot up again.
When up, connect external disk. (What's on /dev/da0p1?)
Create a single partition on the whole disk, no need for swap.

Need help... post output from gpart show and content of /etc/fstab.
 
Yes, I did try to destroy the dao partitions while it was mounted when I received the "busy" error?
I can't see now what's on /dev/da0p1 as it has disappeared after removing the disk & rebooting and I am left with
Code:
da0           932GB  GPT
    da0p2   928GB   freebsd-ufs

I am unable to delete these entries.

gpart show gives the following;
Code:
$ su
Password:
root@FreeBSD11:/home/Brenton # gpart show
=>        40  1953525088  ada0  GPT  (932G)
          40        1024     1  freebsd-boot  (512K)
        1064  1946156024     2  freebsd-ufs  (928G)
  1946157088     7368039     3  freebsd-swap  (3.5G)
  1953525127           1        - free -  (512B)
Code:
=>        40  1953525088  da0  GPT  (932G)
          40        1024       - free -  (512K)
        1064  1946156024    2  freebsd-ufs  (928G)
  1946157088     7368040       - free -  (3.5G)
Code:
=>        40  1953525088  diskid/DISK-DB98765432143  GPT  (932G)
          40        1024                             - free -  (512K)
        1064  1946156024                          2  freebsd-ufs  (928G)
  1946157088     7368040                             - free -  (3.5G)

root@FreeBSD11:/home/Brenton #
/etc/fstab shows
Code:
# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/ada0p2     /               ufs     rw      1       1
/dev/ada0p3     none            swap    sw      0       0
proc    /proc           procfs  rw      0       0
/dev/ada0p2     /               ufs     rw      1       1


Thanks very much for any further help.
 
I am unable to delete these entries.
What did you try?

Please be careful now. Double check you don't make any typos. What follows now are destructive commands
This will wipe anything from your external disk!

To remove /dev/da0p2 use gpart delete -i 2 /dev/da0.
Then create a new partition gpart add -t freebsd-ufs -l backup /dev/da0.
Finally UFS filesystem with Soft Updates+Journaling newfs -jU /dev/da0p1

Just in case you somehow managed to completely bork the partition table and the above does not work, use gpart destroy -F /dev/da0 and gpart create -s gpt /dev/da0 to create a new GPT partition table.
Then use the above commands to create partition and filesystem

Remove the last line from your /etc/fstab.

Please look up the above commands in gpart(8) to understand what you are doing.
 
What did you try?

Please be careful now. Double check you don't make any typos. What follows now are destructive commands
This will wipe anything from your external disk!

To remove /dev/da0p2 use gpart delete -i 2 /dev/da0.
Then create a new partition gpart add -t freebsd-ufs -l backup /dev/da0.
Finally UFS filesystem with Soft Updates+Journaling newfs -jU /dev/da0p1

Just in case you somehow managed to completely bork the partition table and the above does not work, use gpart destroy -F /dev/da0 and gpart create -s gpt /dev/da0 to create a new GPT partition table.
Then use the above commands to create partition and filesystem

Remove the last line from your /etc/fstab.

Please look up the above commands in gpart(8) to understand what you are doing.
the first 2 commands worked fine but the last failed, as follows;
Using inode 4 in cg 0 for 33554432 byte journal
newfs: Failed to initialize new block: Operation not permitted
newfs: soft updates journaling can not be enabled
newfs: /dev/da0p1: failed to write superblock
root@FreeBSD11:/home/Brenton #
$ su
Password:
root@FreeBSD11:/home/Brenton # newfs -jU /dev/da0p1
newfs: /dev/da0p1: failed to open disk for writing
root@FreeBSD11:/home/Brenton #


$ su
Password:
root@FreeBSD11:/home/Brenton # ee /etc/fstab
===========================
# Device Mountpoint FStype Options Dump Pass#
/dev/ada0p2 / ufs rw 1 1
/dev/ada0p3 none swap sw 0 0
proc /proc procfs rw 0 0



.
root@FreeBSD11:/home/Brenton # sade

┌──────────────────Partition Editor────────────────────┐
│ Create partitions for FreeBSD. No changes will be │
│ made until you select Finish. │
│┌────────────────────────────────────────────────────┐│
││ada0 932 GB GPT ││
││ ada0p1 512 KB freebsd-boot ││
││ ada0p2 928 GB freebsd-ufs / ││
││ ada0p3 3.5 GB freebsd-swap none ││
││da0 932 GB GPT ││
││ da0p1 932 GB freebsd-ufs ││
││ ││
││ ││
│└────────────────────────────────────────────────────┘│
├──────────────────────────────────────────────────────┤
│<Create> <Delete> <Modify> <Revert> < Auto > <Finish> │
└──────────────────────────────────────────────────────┘









Thanks again
 
Back
Top