Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #231380

Re: "Run fsck manually"..?

From David Wright <deblis@lionunicorn.co.uk>
Newsgroups linux.debian.user
Subject Re: "Run fsck manually"..?
Date 2021-02-03 21:10 +0100
Message-ID <BEwDn-4Sd-1@gated-at.bofh.it> (permalink)
References (1 earlier) <BEfsR-2Ix-7@gated-at.bofh.it> <BEhEm-4ho-1@gated-at.bofh.it> <BEpBU-w8-17@gated-at.bofh.it> <BEsT7-2Aw-3@gated-at.bofh.it> <BEtcu-2GJ-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed 03 Feb 2021 at 11:24:38 (-0500), Greg Wooledge wrote:
> On Wed, Feb 03, 2021 at 10:02:42AM -0600, David Wright wrote:
> > T'other way, I think, but no matter. For the record, there are
> > two different "strengths" for fsck:
> > 
> >   fastboot|fsck.mode=skip)
> >     fastboot=y
> >     ;;
> >   forcefsck|fsck.mode=force)
> >     forcefsck=y
> >     ;;
> >   fsckfix|fsck.repair=yes)
> >     fsckfix=y
> >     ;;
> >   fsck.repair=no)
> >     fsckfix=n
> >     ;;
> 
> Where is this coming from?

>From foo/main/init where foo is
$ unmkinitramfs /boot/initrd.img foo/

> > If you have a separate /boot that is not on a filesystem needing
> > fscking, then you can use the normal mechanism supported by grub¹.
> 
> > ¹ It writes to the file /boot/grub/grubenv, hence the caution.
> 
> What is the "normal mechanism"?  Where is it documented?

https://www.gnu.org/software/grub/manual/grub/grub.html

> There are no man pages for "grub" or for "grubenv" on my system.
> There is a /boot/grub/grubenv file but it consists of one comment line,
> ending in a newline, and then enough # characters to make the file size
> exactly 1024 bytes.  Incomprehensible.

I'm guessing the comment is a signature. §15.2 outlines the grubenv
method. As Stefan mentioned, grubenv is designed to remain static,
and grub-editenv carefully alters its contents. Configuring Grub
uses /etc/grub.d/00_header and the variables in /etc/default/grub to
write the code at the top of /boot/grub/grub.cfg for juggling the
boot selection.

You start all this off by editing /etc/default/grub: GRUB_DEFAULT=0 →
GRUB_DEFAULT=saved    and running   grub-set-default 0. Then:

$ head -c 72 /boot/grub/grubenv ; echo
# GRUB Environment Block
saved_entry=0
#################################
$ 

# grub-reboot 'fsck>fsck'
# 

$ head -c 72 /boot/grub/grubenv ; echo
# GRUB Environment Block
saved_entry=0
next_entry=fsck>fsck
############
$ 

I'm doing the next bit now to restore normality, but this would also
be done automatically if you boot with a next_entry set, so that
the altered boot is a one-off.

# grub-set-default 0
# 

$ head -c 72 /boot/grub/grubenv ; echo
# GRUB Environment Block
saved_entry=0
#################################
$ 

Cheers,
David.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

"Run fsck manually"..? "hobie of RMN" <hobie@rumormillnews.com> - 2021-02-03 01:20 +0100
  Re: "Run fsck manually"..? Jessica Litwin <jessica@litw.in> - 2021-02-03 01:20 +0100
    Re: "Run fsck manually"..? Stefan Monnier <monnier@iro.umontreal.ca> - 2021-02-03 01:30 +0100
      Re: "Run fsck manually"..? Jeremy Andrews <thejeremy.net@gmail.com> - 2021-02-03 02:20 +0100
        Re: "Run fsck manually"..? "hobie of RMN" <hobie@rumormillnews.com> - 2021-02-03 02:50 +0100
  Re: "Run fsck manually"..? Andy Smith <andy@strugglers.net> - 2021-02-03 02:50 +0100
    Re: "Run fsck manually"..? Andy Smith <andy@strugglers.net> - 2021-02-03 03:40 +0100
      [SOLVED} Re: "Run fsck manually"..? "hobie of RMN" <hobie@rumormillnews.com> - 2021-02-03 05:50 +0100
    Re: "Run fsck manually"..? David Wright <deblis@lionunicorn.co.uk> - 2021-02-03 05:10 +0100
      Re: "Run fsck manually"..? Darac Marjal <mailinglist@darac.org.uk> - 2021-02-03 09:40 +0100
      Re: "Run fsck manually"..? Greg Wooledge <wooledg@eeg.ccf.org> - 2021-02-03 13:40 +0100
        Re: "Run fsck manually"..? David Wright <deblis@lionunicorn.co.uk> - 2021-02-03 17:10 +0100
          Re: "Run fsck manually"..? Greg Wooledge <wooledg@eeg.ccf.org> - 2021-02-03 17:30 +0100
            Re: "Run fsck manually"..? Stefan Monnier <monnier@iro.umontreal.ca> - 2021-02-03 17:40 +0100
            Re: "Run fsck manually"..? David Wright <deblis@lionunicorn.co.uk> - 2021-02-03 21:10 +0100
              Re: "Run fsck manually"..? Greg Wooledge <wooledg@eeg.ccf.org> - 2021-02-03 22:00 +0100
                Re: "Run fsck manually"..? David Wright <deblis@lionunicorn.co.uk> - 2021-02-04 02:10 +0100

csiph-web