You are not logged in.

#1 2013-05-10 14:41:24

Galerote
Member
Registered: 2010-04-22
Posts: 11

fsck on root partition without live CD

Hi,

For some unknown reason, I have to manually repair the root filesystem, but obviously every time I try, fsck tells me that the partition is mounted.

I know I could use some live CD, or pendrive, but turns out my live CD is VERY scratched, and my BIOS can't boot from a pendrive. Of course I could go and buy another cd, but there must be another way, so here I am.

Back in the old days, with sysv init, the only thing I had to do was enter the single-user-mode, and do the repair. Now, it is impossible, because "/" is always mounted. I've tried "systemd.unit=rescue.target" from grub, and "mount -o remount,ro /", I also prayed to my computer, but none of these things worked.

So, is there any way to fsck the root partition without using a pendrive or live cd?

Thank you.

Offline

#2 2013-05-10 15:38:24

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 13,156

Re: fsck on root partition without live CD

You may not be able to directly boot from a pendrive, but you can boot to your bootloader.  From the bootloader, it should be possible to start Arch from the pendrive.  I am not at my Arch machine right now, and ssh'ing into it won't let me play in Grub, but I think Grub should be able to handle USB drives out-of-the-box.  If not, I know the correct drivers can be installed to the boot partition.

https://wiki.archlinux.org/index.php/Gr … _From_GRUB talks of how to modify the Grub menu to do this, but you should be able to hand-fly Grub by adapting this.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
You assume people are rational and influenced by evidence.  You must not work with the public much. -- Trilby
----
How to Ask Questions the Smart Way

Online

#3 2013-05-10 17:19:54

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,010

Re: fsck on root partition without live CD

Why don't you try the kernel command line for setting the breakpoint so that it gives you the kernel shell (the one before it actually mounts the root filesystem)?  Then you can run fsck from there, given you have fsck hook in /etc/mkinitcpio.conf when you made the image.  Or you could change the root= option to point to some non-existent mount point, which will do the same thing.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#4 2013-05-11 16:47:18

Galerote
Member
Registered: 2010-04-22
Posts: 11

Re: fsck on root partition without live CD

Thank you.

ewaller, I'll try that if there's no other option, but first let's see if it's possible without pendrives or CDs.

nomorewindows, I've entered the kernel command line, first trying "init=/bin/sh rw" as kernel parameter, but my keyboard didn't work, even after recreating the initram image enabling the keyboard hook. Then I tried your method of changing root, and yes, it worked, but there wasn't any fsck bin, so I couldn't execute the command.

So, any clues at this point? :-)

Offline

Board footer

Powered by FluxBB