Article 58EG0 Can't recovery partition or format device - device is in use

Can't recovery partition or format device - device is in use

by
jkroepke
from LinuxQuestions.org on (#58EG0)
Hi,

today I crashed my boot partition. While is normally no problem due backups, I can't write to the partition anymore.

Code:root@hades ~ # touch /boot/a
touch: cannot touch '/boot/a': Structure needs cleaningdmesg shows me:

Code:[317873.920810] EXT4-fs error (device md2): ext4_find_dest_de:1932: inode #2: block 518: comm touch: bad entry in directory: rec_len is smaller than minimal - offset=0, inode=0, rec_len=0, name_len=0, size=1024Even after umount the device, I can't fsck

Code:root@hades ~ # umount /boot
root@hades ~ # e2fsck /dev/md2
e2fsck 1.45.5 (07-Jan-2020)
/dev/md2 is in use.
e2fsck: Cannot continue, aborting.

root@hades ~ # fsck.ext4 /dev/md2
e2fsck 1.45.5 (07-Jan-2020)
/dev/md2 is in use.
e2fsck: Cannot continue, aborting.I'm unable to reformat or destroy the partition:

Code:root@hades ~ # wipefs /dev/md2
DEVICE OFFSET TYPE UUID LABEL
md2 0x438 ext4 2112045a-2e84-4c69-8c67-d76e8ad7a13a boot
root@hades ~ # wipefs -a /dev/md2
wipefs: error: /dev/md2: probing initialization failed: Device or resource busy
root@hades ~ # mkfs.ext4 -L boot /dev/md2
mke2fs 1.45.5 (07-Jan-2020)
/dev/md2 contains a ext4 file system labelled 'boot'
last mounted on /boot on Fri Sep 18 21:33:34 2020
Proceed anyway? (y,N) y
/dev/md2 is apparently in use by the system; will not make a filesystem here!fuser or lsof does now shoe any process except kernel threads:

Code:root@hades ~ # lsof | grep md2
md2_raid1 262 root cwd DIR 9,4 4096 2 /
md2_raid1 262 root rtd DIR 9,4 4096 2 /
md2_raid1 262 root txt unknown /proc/262/exe
jbd2/md2- 599 root cwd DIR 9,4 4096 2 /
jbd2/md2- 599 root rtd DIR 9,4 4096 2 /
jbd2/md2- 599 root txt unknown /proc/599/exe
root@hades ~ # fuser -v /dev/md2
root@hades ~ # fuser -v /dev
USER PID ACCESS COMMAND
/dev: root kernel mount /dev
root 57 .rc.. kdevtmpfsI'm not using LVM, no userspace is installed:

Code:root@hades ~ # vgs

Command 'vgs' not found, but can be installed with:

apt install lvm2I'm running Ubuntu 20.04.

Code:Linux hades 5.4.0-47-generic #51-Ubuntu SMP Fri Sep 4 19:50:52 UTC 2020 x86_64 x86_64 x86_64 GNU/LinuxI can't restart the server, because the system isn't bootable now. Currently I do not have physical access to the machine.

I already shutdown all services except systemd, ssh, polkit, rsyslog and mdadm monitor.

How I could identify the source which is using the device?latest?d=yIl2AUoC8zA latest?i=NAEG7p3DbZs:SRmriM-rRko:F7zBnMy latest?i=NAEG7p3DbZs:SRmriM-rRko:V_sGLiP latest?d=qj6IDK7rITs latest?i=NAEG7p3DbZs:SRmriM-rRko:gIN9vFwNAEG7p3DbZs
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments