GRUB2 Scripts To Use Labels For Friendly Names

I am using linux mint and the grub menu gets configured automatically using scripts in /etc/grub.d. The menuentry that gets created is something like Code:
"linux mint (on /dev/sda1)"

. I use external drives sometimes and also have linux on my harddrive which I also switch between computers. It gets confusing when it says /dev/sda2 when it means something else. It boots fine because that actual boot command uses uuid. How can I change the text of the (script generated) description to also use partition labels or uuid (or the first few chars) just so I know which install will actually boot. like this: Code:
"Linux Mint (OFFICESSD)"
"Linux Mint (HOMEHDD)"
"Ubuntu (SANDISK)"
"Ubuntu (IMATION)"

I realise (maybe its the best way) I can change the "GRUB_TITLE=Linux Mint 17 Cinnamon 64-bit" in /etc/linuxmint/info but would rather a smoother way.


Similar Content



Linux Mint 17 Cinnamon Not Detecting Windows 7 During Boot Up

Hello everyone,
Recently, I installed Linux Mint 17 (Cinnamon) on my HP dv6 Laptop. During installation Linux was not detecting my original Windows 7 and was attempting to occupy the entire hard disk. So I used the "Something Else" option to manually create separate partitions for Linux (Previously I had allocated around 120 GB free space for Linux using Windows Disk Management). This installed the Linux but after booting it does not detect Windows 7 and directly boots to Mint. I have tried installing and updating the grub but it did not help either.
Please Help...

Linux Mint 16 Will Not Finish Booting From My Usb

I am trying to boot Linux Mint from an 8gb Sandisk USB. I changed my boot settings and it boots into what I believe is called grub? I am given two options, Boot Linux Mint, Boot Linux Mint (compatibility mode). When I select either of them all I get is a black screen. I've tried many things to get around this, messing with my graphics card settings (within grub), different USB's (another 8gb and a 32gb), I tried Ubuntu and that just doesn't boot at all I go straight back to my UEFI settings. I'm very new to Linux and I don't just want to hop in, I just want to boot from my USB whenever I want to play around with it. Thank You

Note: I'm running windows 8.1 currently on a ASUS N550JV laptop. I've been using the UUI from Pen Drive Linux.

"Invalid Magic Number" When Loading Initrd Into GRUB Prompt Bootloader

Hi, I'm pretty new to Linux.

I'm currently working on a project in my Linux Administration class, but have run into a bit of a bump.

I'm tasked with booting Linux (currently using CentOS 7) through the GRUB prompt. I've loaded the kernel, but I'm having an issue with the initrd.

I've tried both of these commands:
"linux /boot/initrd-plymouth.img"
"linux /boot/initramfs-3.10.0-123.el7.x86_64.img"

Neither of these commands have worked. It only returns the message "invalid magic number" for both of the commands. Any ideas on how I can fix this?

Thanks for any help in advance. It should help me understand Linux better!

Dual Boot Windows7 With With Centos7

hiiii all

I had installed Windows 7 on /dev/sda1 and /dev/sda2 and then I installed Centos 7.
Since then I cant find Windows entry in the Grub.
And i had tried to use all kind of solution found on the net I still cant see any entry.
I had edited 40_custom script adding:

cat <<EOF
menuentry "windows 7" {
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
search --no-floppy --fs-uuid --set=root FCDAE998DAE95006
chainloader +1
}
EOF

then this command grub2-mkconfig -o /boot/grub2/grub2.cfg

[root@localhost]# grub2-mkconfig -o /boot/grub2/grub2.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-93890f189dec4b309c004fdce969ca5a
Found initrd image: /boot/initramfs-0-rescue-93890f189dec4b309c004fdce969ca5a.img

then this
[root@localhost]# tail -10 /boot/grub2/grub.cfg
# 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 ###
[root@localhost]#


Still cant find windows in grub
please help me with this guys
thanks

Flashing Screen On Dual-boot Config.

Hi Guys, I installed a dual boot config. on a 160 gb hdd. The first choice in grub menu is Linux Lite (latest distro) and the second boot choice is Mint 17.1 Rebecca. I'm encountering a situation that when I boot into LL the system boots OK. Then when I try a restart and boot into Mint it seems to be doing OK until the end of the boot process at which time the screen flashes the Mint logo and then goes dark-then flashes then goes dark every second or so-endlessly. After a while I'm sometimes able to get Mint to finish booting by hitting the esc key. Any ideas how to make this screen flashing situation stop and do a normal boot?

Update: Solved the problem by changing the resolution settings to coincide with those of LL....flashing stopped!

LL and Mint IMHO are two of the best distros for a Newbie to "get their feet wet." - I know, I am that Newbie.

Mutt Does Not Show Full Subject

I use following shell script to send email. But the subject of email always shows "This" instead of "This is L_1.R is finished". You may refer http://www.linuxquestions.org/questions/linux-newbie-8/how-to-define-variable-in-%60ssh%60-4175540566/
Code:
host_list=("c15-0330-01.ad.mtu.edu" "c15-0330-02.ad.mtu.edu" "c15-0330-03.ad.mtu.edu" "c15-0330-04.ad.mtu.edu")
program=("L_1" "L_2" "L_3" "L_4")
subject="The job is finished"
ssh -f c15-0330-01.ad.mtu.edu 'echo' "the job ${program[0]} is finished" '|' 'mutt "zwang10@mtu.edu" -s' "This is "${program[0]}".R is finished";

Failed To Load Session Cinnamon (Linux Mint)

Hello everyone,

I just tried upgrading to Linux Mint 17 from version 16, and I obviously did something wrong since when I'm prompted for my password, I get an error message saying "failed to load session cinnamon."

Then there are some error logs which say failed to connect to virtual box kernel service for several lines, then below that "unable to find cinnamon-fullback-mount-helper."

I tried doing ctrl alt f2, but I get a whole bunch of gobbledy gook which I'm unable to copy and paste.

I also tried burning a new DVD-R with Mint 17, but my computer doesn't even read it when I power it on. Otherwise, I would have tried reinstalling the OS.

So any suggestions you have will be greatly appreciated.

Thanks.

Best Way To Run Two Interdependent Scripts

Hi All,

I have two scripts, the aim of these two scripts is, to check whether a particular script is running or not, if it wont runs, then throw a mail.

How i Achieved this output is, I wrote first script.

I created an infinite while loop which performs below steps

1. It creates a touch file
2. Triggers the script which needs to be monitored if its working or not.
3. Removes the touch file.

If the second step fails, then the remove file command will not happen and the script will stuck there itself.

I created an another script which checks the creation time of the touch file and if it is more than ten minutes, it means the second step in the first script is hanged, which also means that particular script is not working.

So if the creation time is more than 2 minutes the second script will throw a mail.

Below are the two scripts.

Code:
#!/bin/ksh



userid="chansd"

filename="/apps/log/check.txt"

while true ;do
touch $filename
pass=`/apps/eDMZ/call_st.ksh $userid`
sleep 20
rm $filename
done

Below script checks the file creation time and throws email if it is older than 2 minutes
Code:
#!/bin/ksh


filename="/apps/log/check.txt"

if [ -f "${filename}" ]
then
if test "`find $filename -mmin +2`"
then
echo "script is not working ! Please act on it" | mail -s "Script  is not working" Example@mail.com
fi


else

        exit 1

fi


What im going to do is

1. I am going to run the first script in background so it runs forever.
2. I am going to run the second script in cron forevry 5 mins to check the file creation time.

3. So if the first script hangs . I will kill the process using process id and after the issue resolves with the inner script, I will run the main script again.

I am new to Linux, Please let me know if this approach will work as expected.

I Am Trying To Install Mukulu Linux On A Desktop That Has XP On It .

I have followed all the instructions I have got from the net and made boot-able DVD's and USB sticks several different ways as people advise. I have done the same with Mint 17. I have created a partition (26G) and follow the install instructions 1: English 2:Has at least 7.4G available drive space. 4: Is connected to the internet. 5: Here it shows a page where I think it should display the drive options (but does not) If I push the "install now" button it comes up with an error "No root file system is defined --Please correct this from the partitioning menu" I close the installer and look at the drives in GParted and they are all there and the one I created for Linux is PARTITION - /dev/sda4 FILE SYSTEM - ext4
MOUNT POINT - /media/makulu/0C43086E0C43086E LABEL - Lin
SIZE - 26.02 GB USED - 590.07 Mb UNUSED - 24.44 GB FLAG - (blank)
No indication on how to fix the "No root file system" problem. I have tried so many bits of advise that I am beginning to think that I may be better of sticking to windows (perish the thought)
Can anyone help?
Col

Python FTP Send Command

hello Experts!
need some help here with python FTP. so what i'm trying to do is, from a linux machine, ill be sending over a python script to a windows machine via python ftp. that works fine with no problem. now, i want to execute that python script i sent remotely. im having trouble with that. here's my code to just execute the script:

p.s : please dont suggest other options such as python paramiko due to many network security reasons

Code:
ftp = ftplib.FTP("windows machine name")
ftp.login("username", "password")
ftp.cwd("where\\python\\script\\is kept\\")

ftp.sendcmd("python myscript.py")

but looks like it doesn't recognize that command. how do i accomplish this please?