Error updating grub2: tail: cannot open ‘(copy)’ for reading: No such file or directory

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
badams_ios
Level 2
Level 2
Posts: 71
Joined: Tue Jun 18, 2013 7:55 pm

Error updating grub2: tail: cannot open ‘(copy)’ for reading: No such file or directory

Post by badams_ios »

Hello, Running mint mate 17.3 everything up to date.

A company called terabyteinc.com makes an app that will automatically make a backup image of Linux. Their app modifies grub. Below are the commands it performs and the content of the relevant files. I'm getting the error: tail: cannot open ‘(copy)’ for reading: No such file or directory when updating grub. I also get the error when trying to run grub-customizer

They can find no reason for it. There should be a new line in the grub menu called grub test but it's not there. I CAN update-grub as you'll see from the configs of grub

Their script is called ./makeGRUB

1st is does this:

grubcfgpath = /boot/grub/grub.cfg
biosuefi = BIOS, efipart =
grubpart = /dev/sda5
iflgrubpath = /boot/grub/grub.cfg, iflgrubnormalpath = /boot/ifl/grub.cfg-normal
Checking for required files, directories
Using included version of cpio
All required files and directories found

then:

The makeGRUB script to create GRUB boot files - TeraByte, Inc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

OPTION 1: Settings menu

OPTION 2: Do you want a console login to be required (default is No)?
Enter y and press <Enter> for Yes
Just press <Enter> for No
Console login will not be required (default)

OPTION 3: Change root password from the default of 'ifl'?
Enter y and press <Enter> for Yes
Just press <Enter> for No
The default root password will be used

Building custom full version with network support
Copying ifl-custom.ini to the root filesystem as ifl.ini
Copying config.txt to the root filesystem
Copying wireless/firmware directory to the root filesystem
Copying iscsi directory to the root filesystem
Copying tbosdtfiles directory to the root filesystem
Copying BOOTITBM-CUSTOM.INI to the root filesystem as BOOTITBM.INI
Boot Media language version is English (default)
Restore Disc language version is English (default)
Recompressing the root filesystem...please wait
184704 blocks
Copying required files to the grub directory

The build of the Grub boot files is now complete. The files created by
the makeGRUB script can be found in the grub directory.

Note: The files in the grub directory will not be in use until they are
INSTALLED by selecting 'Install Grub2 boot files for IFL' from the menu.
Doing that will add the IFL Boot Disk to the Grub menu.

Then:

Attempting to install Grub2 boot files for IFL menu item

Active copy of grub.cfg file found at /boot/grub/grub.cfg
grub-mkconfig file found at /usr/sbin/grub-mkconfig
Creating /boot/ifl directory (if not already there)
Backing up original grub.cfg file to /boot/ifl/orig_files directory
Backing up original 40_custom file to /boot/ifl/orig_files directory
Copying IFL files from grub directory to /boot/ifl directory
Installing IFL version of 40_custom in /etc/grub.d directory
Running '/usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg
This will add IFL to the Grub2 boot menu
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.13.0-37-generic
Found initrd image: /boot/initrd.img-3.13.0-37-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
No volume groups found
tail: cannot open ‘(copy)’ for reading: No such file or directory
Setting up /boot/ifl directory to process reboots to IFL
Creating iflreboot reboot script at /usr/local/bin/iflreboot
Creating iflupdate script at /usr/local/bin/iflupdate
Grub menu title for IFL boot item is 'IFL TEST'

Press <Enter> to continue

When I try to run grub-customizer I get:

grub-mkconfig couldn't be executed successfully. error message:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.13.0-37-generic
Found initrd image: /boot/initrd.img-3.13.0-37-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
File descriptor 11 (/proc/5096/mounts) leaked on lvs invocation. Parent PID 5592: /bin/sh
File descriptor 17 (/usr/share/icons/Mint-X-Teal/places/16/user-home.svg) leaked on lvs invocation. Parent PID 5592: /bin/sh
No volume groups found
tail: cannot open ‘(copy)’ for reading: No such file or directory

Here are my current grub files:

etc/grub.d/41_custom

#!/bin/sh
cat <<EOF
if [ -f \${config_directory}/custom.cfg ]; then
source \${config_directory}/custom.cfg
elif [ -z "\${config_directory}" -a -f \$prefix/custom.cfg ]; then
source \$prefix/custom.cfg;
fi
EOF

/etc/grub.d/40_custom

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.

menuentry 'IFL TEST' { (THIS is what should be in the grub menu but it's not showing up when I press shift to see the menu)
insmod gzio
linux /boot/ifl/vmlinuz vga=773 iflkmap=us ktl=qwerty iflbflag=0 ProductKey=7C49-91D9-2533
initrd /boot/ifl/initrmfs.gz

/etc/default/grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
# GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=FALSE
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

/boot/grub/grub.cfg

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
if [ "${next_entry}" ] ; then
set default='IFL TEST'
set next_entry=
save_env next_entry
set boot_once=true
else
set default='IFL TEST'
fi

if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}

if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 cdf4af54-5ee9-4921-b8a3-3bc0db6be5e0
else
search --no-floppy --fs-uuid --set=root cdf4af54-5ee9-4921-b8a3-3bc0db6be5e0
fi
font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=-1
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=hidden
set timeout=10
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep --interruptible 0 ; then
set timeout=0
fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/06_mint_theme ###
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
### END /etc/grub.d/06_mint_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="$1"
if [ "$1" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ ${recordfail} != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Linux Mint 17.1 MATE 64-bit, 3.13.0-37-generic (/dev/sda5)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 cdf4af54-5ee9-4921-b8a3-3bc0db6be5e0
else
search --no-floppy --fs-uuid --set=root cdf4af54-5ee9-4921-b8a3-3bc0db6be5e0
fi
linux /boot/vmlinuz-3.13.0-37-generic root=UUID=cdf4af54-5ee9-4921-b8a3-3bc0db6be5e0 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.13.0-37-generic
}
menuentry 'Linux Mint 17.1 MATE 64-bit, 3.13.0-37-generic (/dev/sda5) -- recovery mode' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 cdf4af54-5ee9-4921-b8a3-3bc0db6be5e0
else
search --no-floppy --fs-uuid --set=root cdf4af54-5ee9-4921-b8a3-3bc0db6be5e0
fi
echo 'Loading Linux 3.13.0-37-generic ...'
linux /boot/vmlinuz-3.13.0-37-generic root=UUID=cdf4af54-5ee9-4921-b8a3-3bc0db6be5e0 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.13.0-37-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_lupin ###
### END /etc/grub.d/10_lupin ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry 'Memory test (memtest86+)' {
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 cdf4af54-5ee9-4921-b8a3-3bc0db6be5e0
else
search --no-floppy --fs-uuid --set=root cdf4af54-5ee9-4921-b8a3-3bc0db6be5e0
fi
knetbsd /boot/memtest86+.elf
}
menuentry 'Memory test (memtest86+, serial console 115200)' {
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 cdf4af54-5ee9-4921-b8a3-3bc0db6be5e0
else
search --no-floppy --fs-uuid --set=root cdf4af54-5ee9-4921-b8a3-3bc0db6be5e0
fi
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
Clewless

Lenovo ThinkServer
Intel(R) Core(TM) i3-4130 CPU @ 3.40GHz
20 GB RAM
3 TB WD Black, hardware raid 5 - /home
Nvidia GeForce GT 220
32" TV
In the Man Cave :)


Mint Mate 17.1

Media Center, image and video editing

lostfarmer
Level 3
Level 3
Posts: 197
Joined: Mon Feb 10, 2014 11:59 pm
Location: Idaho

Re: Error updating grub2: tail: cannot open ‘(copy)’ for reading: No such file or directory

Post by lostfarmer »

/etc/grub.d/40_custom
snippet, am not posting the first part of file
menuentry 'IFL TEST' {
insmod gzio
linux /boot/ifl/vmlinuz vga=773 iflkmap=us ktl=qwerty iflbflag=0 ProductKey=7C49-91D9-2533
initrd /boot/ifl/initrmfs.gz
is incorrect, it is missing at the end '}' , do not know if you might have missed coped the data or not. But with out it , the entry will not be in the MENU.

Code: Select all

menuentry 'IFL TEST' {
insmod gzio
linux /boot/ifl/vmlinuz vga=773 iflkmap=us ktl=qwerty iflbflag=0 ProductKey=7C49-91D9-2533
initrd /boot/ifl/initrmfs.gz 
} 

badams_ios
Level 2
Level 2
Posts: 71
Joined: Tue Jun 18, 2013 7:55 pm

[SOLVED] Error updating grub2: tail: cannot open ‘(copy)’ for reading: No such file or directory

Post by badams_ios »

Actually, I figured it out myself. My clue was cannot open "(copy)"

In /etc/grub.d was a file named 40_custom (copy)

I deleted it and all is well.

Thanks, all!
Clewless

Lenovo ThinkServer
Intel(R) Core(TM) i3-4130 CPU @ 3.40GHz
20 GB RAM
3 TB WD Black, hardware raid 5 - /home
Nvidia GeForce GT 220
32" TV
In the Man Cave :)


Mint Mate 17.1

Media Center, image and video editing

Post Reply

Return to “Installation & Boot”