When loopfiles are used mkfs has to target the file and not the containing device

Bug #177868 reported by Agostino Russo
6
Affects Status Importance Assigned to Milestone
Wubi
Fix Released
Low
Unassigned
partman-ext3 (Ubuntu)
Fix Released
Undecided
Evan

Bug Description

Binary package hint: partman-ext3

When loopfiles are used, mkfs has to target the file and not the containing device. Preliminary patch is provided. Similar patches should also be applied to other commit.d/*format_* scripts.

loopfile=$(losetup $device 2>/dev/null|cut -f 3 -d ' ')
loopfile=${loopfile#\(}
loopfile=${loopfile%\)}
if [ -n "$loopfile" ]; then
   if log-output -t partman --pass-stdout mkfs.ext3 -F "$loopfile" >/dev/null; then
       sync
       status=OK
   else
       status=failed
   fi
else
    #run mkfs as usual
fi

Tags: wubi
Agostino Russo (ago)
description: updated
Revision history for this message
Agostino Russo (ago) wrote :

To make it even safer one might also check for the existance of /var/lib/partman/devices/$dev/loop

loopfile=$(losetup $device 2>/dev/null|cut -f 3 -d ' ')
loopfile=${loopfile#\(}
loopfile=${loopfile%\)}
[ -z "$loopfile" ] && [ -f loop ] && loopfile=$(cat loop)
if [ -n "$loopfile" ]; then
   if log-output -t partman --pass-stdout mkfs.ext3 -F "$loopfile" >/dev/null; then
       sync
       status=OK
   else
       status=failed
   fi
else
    #run mkfs as usual
fi

Agostino Russo (ago)
Changed in wubi:
importance: Undecided → Low
status: New → Fix Committed
Revision history for this message
Evan (ev) wrote :

This will need to be done to the individual filesystem support udebs for any filesystems we care about in this situation. Maintaining separate copies of the format scripts will create too much of a headache. Published for ext3:

 partman-ext3 (49ubuntu1) hardy; urgency=low

   * Special case loopmounted filesystems as it's safer to format the
     underlying file, not the device.

Changed in partman-ext3:
assignee: nobody → evand
status: New → Fix Released
Agostino Russo (ago)
Changed in wubi:
status: Fix Committed → Fix Released
Revision history for this message
Agostino Russo (ago) wrote :

Evan,

Since the packages affected are a bit scattered, Colin suggest to submit one patch for a single package to be extended to the others. As far as I am concerned I need ext3 and swap

Changed in wubi:
status: Fix Released → Fix Committed
Agostino Russo (ago)
Changed in wubi:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.