patchutil-vserver - Patches: patch #6213, fstab filesystem fsck before mount

 
 

You are not allowed to post comments on this tracker with your current authentification level.

patch #6213: fstab filesystem fsck before mount

Submitted by:  Jon Bendtsen <jonb>
Submitted on:  Thu 20 Sep 2007 11:54:59 AM UTC  
 
Category: Vserver startup/stopPriority: 4
Status: Ready For TestPrivacy: Public
Assigned to: Daniel Hokka Zakrisson <daniel_hozac>Open/Closed: Open
Release: stable

(Jump to the original submission Jump to the original submission)

Fri 12 Oct 2007 12:10:56 AM UTC, comment #10:

A variant of these patches has been merged into trunk. If you could give that a spin, I'd appreciate it.

http://svn.linux-vserver.org/projects/util-vserver/changeset/2617?format=diff&new=2617

Daniel Hokka Zakrisson <daniel_hozac>
Project MemberIn charge of this item.
Thu 20 Sep 2007 01:38:50 PM UTC, comment #9:

3 tests are missing:

Testing with a somewhat foobar fs that is fixed during repair
Testing with a somewhat foobar fs that is not fixed during repair

Testing with automated vserver start up

Jon Bendtsen <jonb>
Thu 20 Sep 2007 01:36:54 PM UTC, comment #8:

Testing with an existing fsck.xfs file gives:

dkserver:/etc/vservers/lars# vserver lars start
fsck 1.40-WIP (14-Nov-2006)
If you wish to check the consistency of an XFS filesystem or
repair a damaged filesystem, see xfs_check(8) and xfs_repair(8).
mount: wrong fs type, bad option, bad superblock on /dev/VG/lars,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

/etc/vservers/lars/fstab:1:1: failed to mount fstab-entry
chroot-sh: open("/etc/mtab"): No such file or directory
secure-mount: chdir("/proc"): No such file or directory
/etc/vservers/lars/fstab:2:1: failed to mount fstab-entry
secure-mount: chdir("/tmp"): No such file or directory
/etc/vservers/lars/fstab:3:1: failed to mount fstab-entry
secure-mount: chdir("/dev/pts"): No such file or directory
/etc/vservers/lars/fstab:4:1: failed to mount fstab-entry
find: var: Ingen sådan fil eller filkatalog
fakerunlevel: open("/var/run/utmp"): No such file or directory

Failed to start vserver 'lars'
dkserver:/etc/vservers/lars#

Jon Bendtsen <jonb>
Thu 20 Sep 2007 01:36:29 PM UTC, comment #7:

testing with a wrong filesystem type in fstab file gives:

dkserver:/etc/vservers/lars# vserver lars start
fsck 1.40-WIP (14-Nov-2006)
fsck: cannot check /dev/VG/lars: fsck.xfs not found
fsck: cannot check /dev/VG/lars: fsck.xfs not found
mount: wrong fs type, bad option, bad superblock on /dev/VG/lars,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

/etc/vservers/lars/fstab:1:1: failed to mount fstab-entry
chroot-sh: open("/etc/mtab"): No such file or directory
secure-mount: chdir("/proc"): No such file or directory
/etc/vservers/lars/fstab:2:1: failed to mount fstab-entry
secure-mount: chdir("/tmp"): No such file or directory
/etc/vservers/lars/fstab:3:1: failed to mount fstab-entry
secure-mount: chdir("/dev/pts"): No such file or directory
/etc/vservers/lars/fstab:4:1: failed to mount fstab-entry
find: var: Ingen sådan fil eller filkatalog
fakerunlevel: open("/var/run/utmp"): No such file or directory

Failed to start vserver 'lars'
dkserver:/etc/vservers/lars#

Jon Bendtsen <jonb>
Thu 20 Sep 2007 01:30:30 PM UTC, comment #6:

forcing the lars check time to really old gives:

dkserver:/etc/vservers/lars# tune2fs -T 20000101000000 /dev/VG/lars
tune2fs 1.40-WIP (14-Nov-2006)
Setting time filesystem last checked to Sat Jan 1 00:00:00 2000

dkserver:/etc/vservers/lars# vserver lars start
fsck 1.40-WIP (14-Nov-2006)
e2fsck 1.40-WIP (14-Nov-2006)
/dev/VG/lars has gone 2819 days without being checked, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/VG/lars: 7829/131072 files (0.1% non-contiguous), 54977/262144 blocks
Starting system log daemon: syslogd.
Starting kernel log daemon: klogd.
Not starting internet superserver: no services enabled.
Starting periodic command scheduler: crond.
dkserver:/etc/vservers/lars#

Jon Bendtsen <jonb>
Thu 20 Sep 2007 01:27:20 PM UTC, comment #5:

Forcing the #number of mounts to far above the normal ammount gives:

dkserver:/etc/vservers/lars# tune2fs -C 100 /dev/VG/lars
tune2fs 1.40-WIP (14-Nov-2006)
Setting current mount count to 100
dkserver:/etc/vservers/lars# vserver lars start
fsck 1.40-WIP (14-Nov-2006)
e2fsck 1.40-WIP (14-Nov-2006)
/dev/VG/lars has been mounted 100 times without being checked, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/VG/lars: 7829/131072 files (0.1% non-contiguous), 54977/262144 blocks
Starting system log daemon: syslogd.
Starting kernel log daemon: klogd.
Not starting internet superserver: no services enabled.
Starting periodic command scheduler: crond.
dkserver:/etc/vservers/lars#

Jon Bendtsen <jonb>
Thu 20 Sep 2007 01:23:52 PM UTC, comment #4:

testing with an already mounted filesystem gives:

dkserver:/etc/vservers/lars# mount /dev/VG/lars /mnt/
dkserver:/etc/vservers/lars# vserver lars start
fsck 1.40-WIP (14-Nov-2006)
e2fsck 1.40-WIP (14-Nov-2006)
/dev/VG/lars is mounted.

WARNING!!! Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.

Do you really want to continue (y/n)?

Typing yes gives:
/dev/VG/lars: recovering journal
/dev/VG/lars: clean, 7829/131072 files, 54977/262144 blocks
Starting system log daemon: syslogd.
Starting kernel log daemon: klogd.
Not starting internet superserver: no services enabled.
Starting periodic command scheduler: crond.
dkserver:/etc/vservers/lars#

Typing no gives:
check aborted.
Starting system log daemon: syslogd.
Starting kernel log daemon: klogd.
Not starting internet superserver: no services enabled.
Starting periodic command scheduler: crond.
dkserver:/etc/vservers/lars#

Jon Bendtsen <jonb>
Thu 20 Sep 2007 01:21:19 PM UTC, comment #3:

testing with a clean fs gives:

dkserver:/etc/vservers/lars# vserver lars start
fsck 1.40-WIP (14-Nov-2006)
e2fsck 1.40-WIP (14-Nov-2006)
/dev/VG/lars: clean, 7809/131072 files, 54971/262144 blocks
Starting system log daemon: syslogd.
Starting kernel log daemon: klogd.
Not starting internet superserver: no services enabled.
Starting periodic command scheduler: crond.
dkserver:/etc/vservers/lars#

Jon Bendtsen <jonb>
Thu 20 Sep 2007 01:16:17 PM UTC, comment #2:

Testing with a non existing partition gives this output:

dkserver:/etc/vservers/lars# vserver lars start
fsck 1.40-WIP (14-Nov-2006)
e2fsck 1.40-WIP (14-Nov-2006)
fsck.ext3: Ingen sådan fil eller filkatalog while trying to open /dev/VG/laars

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

Failed to start vserver 'lars'
dkserver:/etc/vservers/lars# echo $?
8

man fsck says "exitcode 8 - Operational error"

Jon Bendtsen <jonb>
Thu 20 Sep 2007 01:14:41 PM UTC, comment #1:

testing with a existing partition without a filesystem gives this output:

dkserver:/etc/vservers/lars# vserver lars start
fsck 1.40-WIP (14-Nov-2006)
e2fsck 1.40-WIP (14-Nov-2006)
Couldn't find ext2 superblock, trying backup blocks...
fsck.ext3: Bad magic number in super-block while trying to open /dev/VG/lars

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

Failed to start vserver 'lars'
dkserver:/etc/vservers/lars# echo $?
8

man fsck says "exitcode 8 - Operational error"

Jon Bendtsen <jonb>
Thu 20 Sep 2007 11:54:59 AM UTC, original submission:

This patch will fsck the entries in the fstab file for the vserver guest that is in the process of being started. If any fsck fail, it will exit hard and most likely unclean - because I only want to run with a clean filesystem.

This works by telling the normal linux fsck that it should use the fstab file for this particular vserver guest. This means that the normal man fsck and man fstab will apply.

I have tested with 3 clean ext3 filesystems by running the vserver $name start. This gave the normal fsck output for the 3 clean filesystems.

I have not tested with an unclean fs, because i do not have one.
I have not tested with a non existing partition.
I have not tested with a non existing fs on an existing partition.
I have not tested with automated vserver start up.

Jon Bendtsen <jonb>

 

Attached Files
file #13998:  fsck_functions_util-vserver.patch added by jonb (1kB - application/octet-stream)
file #13999:  fsck_start_util-vserver.patch added by jonb (417B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by daniel_hozac (Posted a comment)
  • -unavailable- added by jonb
  • -unavailable- added by jonb (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 12 Oct 2007 12:10:56 AM UTCdaniel_hozacStatusNone=>Ready For Test
      Assigned toNone=>daniel_hozac
    Thu 20 Sep 2007 11:54:59 AM UTCjonbAttached File-=>Added fsck_functions_util-vserver.patch, #13998
      Attached File-=>Added fsck_start_util-vserver.patch, #13999
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup