RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 669655 - mkdumprd failed to build initrd in read-only root
Summary: mkdumprd failed to build initrd in read-only root
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kexec-tools
Version: 6.3
Hardware: Unspecified
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Cong Wang
QA Contact: Chao Ye
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-14 10:29 UTC by Chao Ye
Modified: 2013-09-30 02:22 UTC (History)
3 users (show)

Fixed In Version: kexec-tools-2_0_0-162_el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-19 14:15:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Test patch (8.42 KB, patch)
2011-01-21 10:34 UTC, Cong Wang
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0736 0 normal SHIPPED_LIVE kexec-tools bug fix update 2011-05-18 18:09:18 UTC

Description Chao Ye 2011-01-14 10:29:20 UTC
Description of problem:
In read only root, mkdumprd failed to create tmnt to mount the DUMP_TARGET. In this condition the code should use the readable dir to make the tmnt dir, such as /boot, instead of /tmp.

Version-Release number of selected component (if applicable):
kexec-tools-2.0.0-160.el6

How reproducible:
100%

Steps to Reproduce:
1.Setup read-only root
2./sbin/mkdumprd -d -f /boot/initrd-in-read-only-root.img $(uname -r | sed 's/smp//g')
3.
  
Actual results:
mkdumprd failed

Expected results:
mkdumprd use /boot to create tmnt dir

Additional info:

Comment 2 Cong Wang 2011-01-21 09:22:31 UTC
But you can still 'cd /boot;' before running mkdumprd.

Comment 3 Chao Ye 2011-01-21 10:27:12 UTC
(In reply to comment #2)
> But you can still 'cd /boot;' before running mkdumprd.

Yes, I did that.
==================================================
    # Switch to a readable fs
    cd /boot
    
    # Mount root as read only
    mount -o remount,ro /
    touch /testmountrootasreadonly
    if [ -f /testmountrootasreadonly ]; then
        echo "Failed to mount / as read only" | tee -a /boot/test.result
        return
    fi
    
    # Test mkdumprd
    /sbin/mkdumprd -d -f /boot/initrd-in-read-only-root.img $(uname -r | sed 's/smp//g')

Comment 4 Cong Wang 2011-01-21 10:34:10 UTC
Created attachment 474609 [details]
Test patch

Please try this patch.

Comment 5 Chao Ye 2011-01-24 02:37:56 UTC
Patch don't works:
=====================================================================

[root@ibm-x3550m3-02 /]# mount -o remount,ro /
[root@ibm-x3550m3-02 /]# cd /boot/
[root@ibm-x3550m3-02 boot]# /sbin/mkdumprd -d -f /boot/initrd-in-read-only-rooimg $(uname -r | sed 's/smp//g')
WARNING: using /boot for temporary files
tac: cannot create temporary file in `/tmp': Read-only file system
++ mktemp -dq
+ tmnt=
+ kdump_chk 'mount -t ext4 /dev/mapper/vg_ibmx3550m302-lv_root ' 'Bad mount point /dev/mapper/vg_ibmx3550m302-lv_root'
++ eval mount -t ext4 /dev/mapper/vg_ibmx3550m302-lv_root
+++ mount -t ext4 /dev/mapper/vg_ibmx3550m302-lv_root
Usage: mount -V                 : print version
       mount -h                 : print this help
       mount                    : list mounted filesystems
       mount -l                 : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
       mount -a [-t|-O] ...     : mount all stuff from /etc/fstab
       mount device             : mount device at the known place
       mount directory          : mount known device here
       mount -t type dev dir    : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
       mount --bind olddir newdir
or move a subtree:
       mount --move olddir newdir
One can change the type of mount containing the directory dir:
       mount --make-shared dir
       mount --make-slave dir
       mount --make-private dir
       mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
       mount --make-rshared dir
       mount --make-rslave dir
       mount --make-rprivate dir
       mount --make-runbindable dir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using  -L label  or by uuid, using  -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say  man 8 mount .
+ rc=
+ echo '/etc/kdump.conf: Bad mount point /dev/mapper/vg_ibmx3550m302-lv_root'
/etc/kdump.conf: Bad mount point /dev/mapper/vg_ibmx3550m302-lv_root
+ cleanup_and_exit 1
+ rm -rf /boot/initrd.go7ZSD
+ rm -f /boot/initrd.img.15wdnb
+ rm -f /boot/disklist.eccJTl
+ exit 1

Comment 7 Chao Ye 2011-02-28 07:53:54 UTC
Tested with latest build:
=================================================================
[root@storageqe-01 boot]# mount -o remount,ro /
[root@storageqe-01 boot]# rpm -q kernel kexec-tools
kernel-2.6.32-118.el6.x86_64
kexec-tools-2.0.0-166.el6.x86_64
[root@storageqe-01 boot]# /sbin/mkdumprd -d -f /boot/initrd-in-read-only-root.img $(uname -r)
WARNING: using /boot for temporary files
mount: /dev/cciss/c0d0p2 already mounted or /boot/tmp.2SpKyF0uWe busy
mount: according to mtab, /dev/cciss/c0d0p2 is mounted on /
/etc/kdump.conf: Bad mount point /dev/cciss/c0d0p2
[root@storageqe-01 boot]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/cciss/c0d0p2    273887600   2459420 257515504   1% /
tmpfs                  2930052         0   2930052   0% /dev/shm
/dev/cciss/c0d0p1       198337     30829    157268  17% /boot

Comment 8 Chao Ye 2011-03-14 02:19:38 UTC
Tested with latest build:
===============================================================
[root@ibm-hs21-01 boot]# mount -o remount,ro /
[root@ibm-hs21-01 boot]# cat /etc/kdump.conf 
ext4 /dev/sda1
[root@ibm-hs21-01 boot]# rpm -q kernel kexec-tools
kernel-2.6.32-122.el6.x86_64
kexec-tools-2.0.0-169.el6.x86_64
[root@ibm-hs21-01 boot]# /etc/init.d/kdump restart
Stopping kdump:[  OK  ]
Detected change(s) the following file(s):
  
  /etc/kdump.conf
Rebuilding /boot/initrd-2.6.32-122.el6.x86_64kdump.img
WARNING: using /boot for temporary files
Warning: There is not enough space to save a vmcore.
         The size of /dev/sda1 should be much greater than 16333940 kilo bytes.
Your running kernel is using more than 70% of the amount of space you reserved for kdump, you should consider increasing your crashkernel reservation[WARNING]
Starting kdump:[  OK  ]

Change status to VERIFIED.

Comment 9 errata-xmlrpc 2011-05-19 14:15:55 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0736.html


Note You need to log in before you can comment on or make changes to this bug.