bug in Commands.pm related to ntfsresize command

Iordan Iordanov iordan at cdf.toronto.edu
Tue Feb 12 19:00:05 CET 2013


Hello fellow FAI users and developers,

I was setting up an automatic (FAI) dual-boot installation, and set up 
disk_config with a config file (in case it's useful for anyone) like this:

disk_config sda bootable:1 resize:1,2

primary  -             100M:resize      -   -
primary  -             200G:resize      -   -
primary  /             30G      ext4   rw,errors=remount-ro
logical  swap          8G       swap   rw
logical  /var          10G      ext4   rw         createopts="-m 5" 
tuneopts="-c 0 -i 0"
logical  /tmp          15G      ext4   rw         createopts="-m 0" 
tuneopts="-c 0 -i 0"
logical  /data         0-       ext4   rw,nosuid  createopts="-m 0" 
tuneopts="-c 0 -i 0"

This worked to the point where FAI attempted to resize /dev/sda2, and in 
the log, I saw that the command looked like this:

Executing: yes | ntfsresize -s 214746632704/dev/sda2

I.e. there was no space between the size and the device. I poked around, 
and found where the command was being built (Commands.pm) in the 
fai-setup-storage package.

So, I fixed it by changing /usr/share/fai/setup-storage/Commands.pm from:
=================================================
&FAI::push_command( "yes | ntfsresize -s " . $part->{size}->{eff_size} .
&FAI::make_device_name($disk, $p), "rebuilt_" .
&FAI::make_device_name($disk, $p) . $deps, "ntfs_ready_for_rm_" .
&FAI::make_device_name($disk, $p) );
=================================================

to:
=================================================
&FAI::push_command( "yes | ntfsresize -s " . $part->{size}->{eff_size} .
" " .
&FAI::make_device_name($disk, $p), "rebuilt_" .
&FAI::make_device_name($disk, $p) . $deps, "ntfs_ready_for_rm_" .
&FAI::make_device_name($disk, $p) );
=================================================

I.e. added a space after the size. Now it works.

I hope this helps everyone!

Cheers,
Iordan Iordanov



More information about the linux-fai mailing list