Help Me Run an fsck Please?

  • I've got two volumes that OMV is telling me need fsck manually run on them when I boot. When I put in admin password it's not letting me run fsck due to something being mounted.


    I tried rebooting under recovery mode, same problem, also tried rebooting under systemrestorecd (plugin i installed a while) and it's just hanging.


    I'm sure there is a stupid easy workaround or command I can run to get fsck to run without restrictions. Can someone help a dummy out?

    • Offizieller Beitrag

    Do you have a monitor? Not sure why systemrescuecd isn't booting unless it isn't picking the correct option. Why not unmount the volume that you are trying to run fsck on?

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Thanks so much for the fast reply -- The rescue CD and PartedMagic optionss both eventually booted but I'm missing something obvious as fsck is refusing to run due to other processes running.


    I tried a umount -a as well after entering the admin password during the boot, and it keeps telling me it can't unmount due to processes currently running.


    I'm an idiot when it comes to linux command line so bear with my dumbness. Is the command fsck -f -y /dev/XXX for the drive that is throwing errors at boot?


    Another idea...


    I do get into OMV eventually - Can I use the GUI to somehow unmount all the bad drives and ssh in and run fsck?

    • Offizieller Beitrag

    You can force an unmount. Login as root via ssh:


    Replace X and maybe partition number. If you are using something other than ext4, replace that too.
    umount -f /dev/sdX1
    fsck.ext4 -f /dev/sdX1

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I am trying to run e2fsck on my ext4 USB drive which has errors and the USB shared drive won't unmount. Per the web gui options, the drive unmounted OK in the OMV "File System" selection menu but something is still attached to it. I've also got transmission shut down but I can't figure out how to unmount the drive. I've shut down services including watchdog, transmission-daemon, samba-ad-dc, smdb and not sure what else to try at this point ...


    sudo service transmission-daemon stop

    pi@raspberrypi:~ $ sudo umount -f /Media (symbolic link for below)
    umount: /srv/dev-disk-by-id-usb-ST5000DM2: target is busy.


    sudo service samba-ad-dc stoppi@raspberrypi:~ $ sudo umount -f /Media

    umount: /srv/dev-disk-by-id-usb-ST5000DM2: target is busy.


    sudo service watchdog stoppi@raspberrypi:~ $ sudo umount -f /Media

    umount: /srv/dev-disk-by-id-usb-ST5000DM2: target is busy.


    sudo service smbd stoppi@raspberrypi:~ $ sudo umount -f /Media

    umount: /srv/dev-disk-by-id-usb-ST5000DM2: target is busy.


    Thanks!

  • I'm curious as to why you'd like to run an fsck on the drive.

    That said, there may be a background process, such as a scheduled USB backup, still running, or something else you set up to use the drive and then forgot about.

    Other options would be to reboot your server from a USB stick containing a Linux live/rescue environment, or connect the drive to your main PC. If you're running Windows, use a Linux VM to pass the drive through to. (A bit of overkill, but it's an option.)

  • I have a small raspberry pi in a closet in my open road camper with OMV running on the pi attached to a USB drive with media stored on it. The camper TV has Kodi linked to SMB shares and the radio linked to MP3 on the device. As I hit bumps and various other things it causes issues with the drive or the electronics go wacky from short losses of power. So I need to clean things up from time to time after any of the near daily small catastrophes. I know all the reasons that one wants to keep such a setup in a simulated "server farm' environment, but out on the road, it just doesn't always work out that way. I keep a backup of the USB drive and pi image to reload to SD card but I'm mostly looking for a few commands to fix things on the fly without spending all day on the project. I've been pulling the drive out of the closet, attaching it to my laptop and booting ubuntu, running e2fsck on the drive but I'd like to somehow just run the routine from the pi via the console which would save me having to shut the pi down, remove the drive, set up the laptop for the check disk and then mounting the drive back in the closet, etc. (P.S. I have none of those other services running on my pi other than transmission-daemon, which shares access to the USB drive but I shut it down. Note I also used to run this setup off my router using OpenWrt and samba share, which allowed shutting down the respective service, unmounting the drive and running the e2fsck on the drive to fix various issues from undesired power loss.)

    • Offizieller Beitrag

    You need to setup some kind of UPS backup to cover those momentary power drops. How do you power the Pi in your camper when on the road?

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

  • The power is non-stop (high current battery to 5V buck for pi and 12v buck for USB drive but when I have a road hazard sometimes the power comes unplugged, plus for some reason it stops working and a check disk just fixes everything. I'd like to run check disk on the drive without removing it to a laptop like I do now if you know of any way. Like I say, this was no issue on the OpenWRT platform but OMV seems to take over the entire machine. If I could simply kill enough porcesses where the drive would unmount, I'd be satisfied. It's not production work just media viewing but the thing I'm trying to avoid is removing the drive and just shutting down services, unmounting drive, running e2fsck, then rebooting the pi. Thanks.

  • That worked to show what resources had it but shutting them down didn't seem to release the USB drive, it was still saying it could not be unmounted. OMV Openmediavalut will not release the drive resources to run fsck or e2fsck on the USB drive.


    I found this on another forum which appears to have worked:


    RaspberryPi 4B: (with OMV installed)


    sudo touch /forcefsck

    sudo reboot


    Now it takes a while for it to run the fsck on the reboot but after the drive's fsck checks are run and the server console comes back up the drive is working again and the touched file has disappeared which I am just guessing but must indicate the procedure ran on restart.

  • The presence of a file named forcefsck in / will trigger a fsck of all drives on the next boot and the deletion of the file upon completion.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

  • Replace X and maybe partition number. If you are using something other than ext4, replace that too.
    umount -f /dev/sdX1
    fsck.ext4 -f /dev/sdX1

    I would fear that this action would affect the system stability or the system configuration.


    And what must be done, after the file system check was successfully finished?

    OMV 3.0.100 (Gray style)

    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1) - Fractal Design Node 304 -

    3x WD80EMAZ Snapraid / MergerFS-pool via eSATA - 4-Bay ICYCube MB561U3S-4S with fan-mod

    Einmal editiert, zuletzt von cabrio_leo ()

  • Wouldn't it be better to find a solution to the power interruptions you experience in your vehicle? I can't quite imagine what would even cause them unless there's some extremely loose wiring involved. Perhaps a small battery backup or a capacitor-based one for the Pi?

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!