Sponsored Content
Top Forums Shell Programming and Scripting Help with UUID replacement in fstab and menu.lst Post 302511923 by arunj on Friday 8th of April 2011 01:41:27 AM
Old 04-08-2011
Help with UUID replacement in fstab and menu.lst

I am trying to write a small backup application for Linux systems file by file if partitions are created by the user using fdisk. I am facing a problem when I am done with restoring the files. The problem is with UUID mismatch in restored fstab and menu.lst.

Using C I could create a partlist.txt file where I have 3 entries:
device_name, "UUID" mountpoint

Need to restore the following:

1. UUID in menu.lst by matching UUID of "/" from partlist.txt
2. Replace correct UUIDs from partlist.txt for all mountpoints in fstab

Also cannot depend on the ordering of lines anywhere.

Attached the sample generated partlist.txt and fstab + menu.lst from Red Hat 6.
I am not an expert in using sed and awk. So any help is really appreciated.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

menu.lst, boot options?

Hi all, I would like to have some details on menu.lst!! the reason is ,if i am trying to add my own boot option where do i need to add it? is it in menu.lst only or elsewere(am referring to unix os) because i tried adding a unique boot option and it was not reflected when the system booted?... (8 Replies)
Discussion started by: wrapster
8 Replies

2. Shell Programming and Scripting

shell script to alter grub menu.lst

Hi folks, I have a dual-boot Ubuntu/Windows machine and I wanted to create a script to change the menu.lst file so it will change the default boot partition (this is so I can reload the machine remotely and allow it to boot to the Windows partition). Today I have to sudo cp a template file I... (1 Reply)
Discussion started by: ppucci
1 Replies

3. UNIX for Advanced & Expert Users

Generate UUID for a host

Hello Experts, Is there a way to generate Universally Unique identifiers on all Unix flavours such as Solaris, RHELinux,Suse Linux, MacOS,HP UX etc? If i can get a system command or a system call or an algorithm/script/program to generate a unique identifier, it will be helpful. Thanks in... (1 Reply)
Discussion started by: GajendraSharma
1 Replies

4. SuSE

Need to edit the menu.lst so it can work

I am trying to install three OS (Windows VISTA, OpenSUSE 11.3 & Solaris 11 Express) on a single drive of a laptop. However when I go to edit the /rpool/boot/grub/menu.lst to put the entry so it can boot the OpenSUSE 11.3 I get errors some of which result into starting all over again. I have also... (0 Replies)
Discussion started by: Tenyhwa
0 Replies

5. Solaris

Need to create a menu.lst for Solaris 11 Express, OpenSUSE 11.3 & Windows Vista

I have partitioned and installed Windows Vista, OpenSUSE and Solaris 11 Express on a LapTop hardDrive. However I am not able to boot OpenSUSE 11.3 although I have it in menu.lst which I put in a Solaris partition directory /rpool/boot/grub. Could someone tell me how to go about it. See what I did... (2 Replies)
Discussion started by: Tenyhwa
2 Replies

6. Boot Loaders

Help Me edit the menu.lst !

I am trying to install three OS (Windows VISTA, OpenSUSE 11.3 & Solaris 11 Express) on a single drive of a laptop. However when I go to edit the /rpool/boot/grub/menu.lst to put the entry so it can boot the OpenSUSE 11.3 I get errors some of which result into starting all over again. I have also... (3 Replies)
Discussion started by: Tenyhwa
3 Replies

7. UNIX for Dummies Questions & Answers

Missing menu.lst file in Ubuntu

I am not able to find menu.lst in /boot. During the Linux Kernel Compilation I installed the kernel using make install. Next I created an initrd image. I had to modify the Grub configuration file - /boot/grub/menu.lst which I am not able to find. Any resolution for the issue? (3 Replies)
Discussion started by: rupeshkp728
3 Replies

8. Shell Programming and Scripting

Script to unmount and mount by UUID

Hi, Need a bit of help on this one as I am a scripting noob. I have a linux based NAS that mounts USB hard drives in an inconsistent location and to make matters worse, seems to lose the mount for an unknown reason and doesn't remount automatically unless the drive is removed and re-inserted.... (4 Replies)
Discussion started by: gtr33m
4 Replies

9. BSD

Find Partition/Slice UUID

I thought I had figured this out at one point, but I can't remember. Is there a way/command to get the UUIDs of a disk's partitions/slices in FreeBSD? Linux has the blkid command, which doesn't seem to be available. (2 Replies)
Discussion started by: AntumDeluge
2 Replies
CRM_UUID(8)							  [FIXME: manual]						       CRM_UUID(8)

NAME
crm_uuid - get a node's UUID SYNOPSIS
crm_uuid [-w|-r] DESCRIPTION
UUIDs are used to identify cluster nodes to ensure that they can always be uniquely identified. The crm_uuid command displays and modifies the UUID of the node on which it is run. When Heartbeat is first started on a node, it creates a UUID (in binary form) in /var/lib/heartbeat/hb_uuid. This file can be read and written by means of crm_uuid. Note There are very rare circumstances when crm_uuid should be used to modify the UUID file. The most common is when it is necessary to set a node's UUID to a known value when creating a new cluster. OPTIONS
--write, -w Write a UUID value to the /var/lib/heartbeat/hb_uuid file. Warning Use the -w option with care, because it creates a new UUID value for the node on which it is run. Various scripts across the cluster might still use the old value, causing the cluster to fail because the node is no longer associated with the old UUID value. Do not change the UUID unless you changed all references to it as well. --read, -r Read the UUID value and print it to stdout. SEE ALSO
/var/lib/heartbeat/hb_uuid AUTHOR
crm_uuid was written by Andrew Beekhof. [FIXME: source] 07/05/2010 CRM_UUID(8)
All times are GMT -4. The time now is 08:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy