[clug] Debian Jessie file system checking on boot up
George at Clug
Clug at goproject.info
Wed Apr 6 12:39:30 UTC 2016
Scott,
Does the below information help at all ?
I believe the following is stopping the FSCK but do not know why this
statement is used "ConditionPathExists=!/run/initramfs/fsck-root was
not met"
Does the contents of this site mean much to you?
"https://lists.debian.org/debian-user/2015/04/msg01423.html"
nd, if fsck.mode=force has stopped working, I wonder what broke it'
some of my testing for tonight, which still has FSCK not happening at
boot.
# cat /run/initramfs/fsck.log
Log of fsck -C -f -a -V -t ext4 /dev/sda1
Wed Apr 6 12:29:25 2016
fsck from util-linux 2.25.2
[/sbin/fsck.ext4 (1) -- /dev/sda1] fsck.ext4 -f -a -C0 /dev/sda1
/dev/sda1: 106323/6291456 files (2.5% non-contiguous),
12431968/25140992 blocks
Wed Apr 6 12:29:28 2016
----------------
# dpkg -l initramfs-tools|tail -n1;uname -r
ii initramfs-tools 0.120+deb8u1 all generic
modular initramfs generator
3.16.0-4-amd64
# systemctl status systemd-fsck-root.service
● systemd-fsck-root.service - File System Check on Root Device
Loaded: loaded (/lib/systemd/system/systemd-fsck-root.service;
static)
Active: inactive (dead)
start condition failed at Wed 2016-04-06 22:25:20
AEST; 1min 52s ago
ConditionPathExists=!/run/initramfs/fsck-root was
not met
Docs: man:systemd-fsck-root.service(8)
# shutdown -rF now
Code should not be reached 'Unhandled option' at
../src/systemctl/systemctl.c:6316, function shutdown_parse_argv().
Aborting.
Aborted
# nano /etc/default/grub
# update-grub
GRUB_CMDLINE_LINUX_DEFAULT="fsck.mode=force"
# reboot
(login again)
# cat /var/log/fsck/checkfs
(Nothing has been logged yet.)
# systemctl status systemd-fsck-root.service
● systemd-fsck-root.service - File System Check on Root Device
Loaded: loaded (/lib/systemd/system/systemd-fsck-root.service;
static)
Active: inactive (dead)
start condition failed at Wed 2016-04-06 22:29:29
AEST; 1min 6s ago
ConditionPathExists=!/run/initramfs/fsck-root was
not met
Docs: man:systemd-fsck-root.service(8)
Regards,
George.
At Wednesday, 06-04-2016 on 22:04 Scott Ferguson wrote:
On 05/04/16 20:11, George at Clug wrote:
> Does anyone know how to get a Debian Jessie server to check
and
> repair its root file system on boot up ?
>
This 'seems' to work, I'll do a little more testing on the weekend.
Test VM:-
Debian Jessie 32-bit fully-updated
single slice ext4 partition
Changes:-
*Enable full fsck on boot (unattended) - this is a *really* bad thing
to
do, fsck isn't smart enough to look for orphaned system files in
Lost&Found
sed -i "s/^#FSCKFIX=no$/FSCKFIX=yes/" /etc/default/rcS
*Enable GRUB to show boot messages so I can "see" if fsck runs
sed -i
"s/^GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\"$/GRUB_CMDLINE_LINUX_DEFAULT=\"\"/"
/etc/default/grub
*Create a fsck logging rule which will 'hopefully' be used in the
initramfs[*1] Note that this doesn't appear to work :(
cat /etc/e2fsck.conf
[options]
max_count_problems = 16
log_dir = /var/log/e2fsck
log_filename =
e2fsck-%N.%h.INFO.%D-%T
log_dir_wait = true
*Create a custom GRUB menu entry
cp /etc/grub.d/40_custom /etc/grub.d/39_fsck
copy a menu entry out of /boot/grub/grub.cfg and modify (change title
and append "fsck.mode=force" (without the "") to the kernel line)
e.g.
#!/bin/sh
exec tail -n +3 $0
menuentry 'force full fsck' --class debian --class gnu-linux --class
gnu
--class os $menuentry_id_option
'gnulinux-simple-48eed742-c1cc-4652-81ef-220197a031a3' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio;
insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root
--hint-ieee1275='ieee1275//disk at 0,msdos1' --hint-bios=hd0,msdos1
--hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1
48eed742-c1cc-4652-81ef-220197a031a3
else
search --no-floppy --fs-uuid --set=root
48eed742-c1cc-4652-81ef-220197a031a3
fi
echo 'Loading Linux 3.16.0-4-586 ...'
linux /boot/vmlinuz-3.16.0-4-586
root=UUID=48eed742-c1cc-4652-81ef-220197a031a3 ro fsck.mode=force
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.16.0-4-586
}
Lastly - run the update-grub command.
On reboot if I choose the force full fsck menu entry it appears to run
(there's only 900MB of files on the VM) ,but it does not log as I'd
like.
See https://scottferguson.com.au/uploads/files/fsck_test.webm
Kind regards
--
A: Because we read from top to bottom, left to right.
Q: Why should I start my reply below the quoted text?
A: Because it messes up the order in which people normally
read text.
Q: Why is top-posting such a bad thing?
A: The lost context.
Q: What makes top-posted replies harder to read than
bottom-posted?
A: Yes.
Q: Should I trim down the quoted part of an email to which I'm
reply
http://www.idallen.com/topposting.html
--
linux mailing list
linux at lists.samba.org
https://lists.samba.org/mailman/listinfo/linux
More information about the linux
mailing list