rebuilding fstab and bootloader

Questions about the project and the distribution - obviously no support questions here please
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 6 months after creation.
Acithium

rebuilding fstab and bootloader

Post by Acithium »

I love daryna. I think that it's definately one of the best out of the box distro's i've EVER tried. I think one thing that could make this distro even better is if there was a utility to rebuild FSTAB (i know there is some sort of command for it, but a gui might make it more appealing or some) when partition changes are made. One other thing that would be awesome is if there was a way to reinstall the mint bootloader. These are two things that have just here recently caused me a couple of google searches to figure out the proper syntax to correct.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Husse

Re: rebuilding fstab and bootloader

Post by Husse »

This is a very good suggestion.
There are too may caught in UUID hell, and a way to rebuild fstab and menu.lst that are affected by this would be great.
Fred

Re: rebuilding fstab and bootloader

Post by Fred »

I agree, I haven't been on this forum long but that is the best suggestion I have seen here yet!

Acithium, put your brain in gear and come up with a few more that good. :-)

Fred
Husse

Re: rebuilding fstab and bootloader

Post by Husse »

I discovered it's so good that the Ubuntu devs already have a graphical tool for disk handling in Hardy - so we'll get it.....
deadguy
Level 5
Level 5
Posts: 707
Joined: Wed Aug 15, 2007 9:41 pm
Location: Illinois USA

Re: rebuilding fstab and bootloader

Post by deadguy »

Husse wrote:I discovered it's so good that the Ubuntu devs already have a graphical tool for disk handling in Hardy - so we'll get it.....
that will be nice!
User avatar
BakUp
Level 3
Level 3
Posts: 197
Joined: Sun Sep 23, 2007 9:20 am
Location: Minnesota USA

Re: rebuilding fstab and bootloader

Post by BakUp »

Husse wrote:Ubuntu devs already have a graphical tool for disk handling in Hardy - so we'll get it.....
Another giant step for mankind/Mint..........way to go Husse !!!!!!!

HAPPY DAYS
My Linux Distros:
sidux - Parsix - DreamLinux - Mint
User avatar
Acid_1
Level 5
Level 5
Posts: 796
Joined: Thu Nov 01, 2007 11:12 pm
Location: Saskatchewan, Canada

Re: rebuilding fstab and bootloader

Post by Acid_1 »

BakUp wrote:
Husse wrote:Ubuntu devs already have a graphical tool for disk handling in Hardy - so we'll get it.....
Another giant step for mankind/Mint..........way to go Husse !!!!!!!

HAPPY DAYS
and Ubuntu. Now we don't have to do the work :P
User avatar
T J Tulley
Level 5
Level 5
Posts: 558
Joined: Wed Jul 18, 2007 10:18 am
Location: Hull, England

Re: rebuilding fstab and bootloader

Post by T J Tulley »

I've just found my way to this topic (which is really about UUIDs) by searching under that key.

For a long time I've been frustrated by the fact that 3 of my working partitions (all drive images from Windows) have identical UUIDs - so that they are inconsistently mounted in Daryna. I'm therefor stuck using Celena, and have been fearing that Elyssa will suffer similarly and prevent me from using it with my present system structure.

Now I see the contributions above from Husse and my hopes are aroused.

Question - is it possible to edit UUIDs? I've read the Wiki-Mint article (which I suspect was written by Husse) and the OSSP page linked from there.

For me, there is a work-around possible - I shall need to create new working partitions and copy into those the data directories ("My Documents" from the old Windows structures) - these will presumably have newly created truly unique identifiers. However, it would be a lot less trouble if I could edit the UIDs of the existing partitions.
Yours hopefully -

Theo Tulley.
Using a PC with 2GB RAM, 3 hdds and a 1.7 GHz Celeron cpu.
Fred

Re: rebuilding fstab and bootloader

Post by Fred »

T J Tulley,

There are three solutions to your problem that don't require redoing your partitions.

1) You could not use a unique identifier at all. This is an alternative talked about in the wiki. I would not recommend this alternative to you, knowing the complexity of your system; multiple drives, partitions, systems, etc. Your possibilities for name collisions are higher than most users.

2) You can edit the /etc/fstab files and correct the UUIDs. To edit the fstab file if you are using kde, you would use "kdesu kate /etc/fstab" on the run line from the menu. If you are using Gnome the command would be "sudo gedit /etc/fstab" To find the correct UUID the command is "sudo vol_id -u /dev/sdxx" Substitute the correct drive/partition designator for sdxx. This will return the correct UUID for that partition. Again, I don't think this is the best solution to your problem. Every time you make a change you will have to go through the same exercise.

3) I saved the best for last. If I were in your shoes, In fact this is what I do, I would use labels as unique identifiers. This has the advantage of not changing if you tamper with the partition, ie reformat, install, etc.

When assigning labels I suggest you use descriptive names, no spaces, no more than 16 characters. Some examples from my set-up:

Root-1
Root-2
Root-3
Home-1
gBoot
swap
Fred-Data
Denise-Pic
Denise-Data
Back-Up

I think you can get the idea.

To assign a label to a partition type in a terminal:

sudo e2label /dev/sdxx NewName

If NewName is left off, the command displays the current label. Substitute the correct drive/partition designator for sdxx.

Below is part of one of my fstab files as an example of how you would set it up. Notice that I just commented out the UUIDs.

#
# /dev/sda2
# UUID=be843971-9479-45a2-92f6-13b4ba08d6d6
LABEL=Root-1 / ext3 defaults,errors=remount-ro 0 1
#
# /dev/sdb1
# UUID=ae641f54-e431-4313-9dcd-e22d08a7ed59
LABEL=gBoot /gboot ext2 defaults 0 2
#
# /dev/sdb3
# UUID=2d42d6cb-3e2b-4386-9991-2f1d88c27979
LABEL=Fred-Data /home/fred/My_Data ext3 defaults 0 2
#
# /dev/sda3
# UUID=ef909b66-06ba-4509-93fd-3e5c4a875a30
LABEL=Root-2 /media/sda3 ext3 defaults 0 2
#
# /dev/sda5
# UUID=ac141f9d-1f57-4be3-a6a4-7ec2a61aae38
LABEL=Denise-Data /home/fred/Nisey ext3 defaults 0 2
#
# /dev/sda6
# UUID=179531d8-4df6-494c-91f2-e0295be69b04
LABEL=Back-Up /home/fred/Backup ext3 defaults 0 2
#

Note that LABEL is in all caps.

You will need to fix your "/boot/grub/menu.lst" file also. Open it for editing. Same procedure you used for fstab. Fix your boot stanzas like I have in the partial "menu.lst" file below:

## ## End Default Options ##

title Linux Mint 4.0 KDE CE, kernel 2.6.22-14-generic
root (hd0,1)
kernel /boot/vmlinuz-2.6.22-14-generic root=LABEL=Root-1 ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic
boot

title
root

title Linux Mint 4.0 KDE CE, kernel View Boot
root (hd0,1)
kernel /boot/vmlinuz-2.6.22-14-generic root=LABEL=Root-1 ro
initrd /boot/initrd.img-2.6.22-14-generic
boot

title Linux Mint 4.0 KDE CE, kernel 2.6.22-14-generic (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.22-14-generic root=LABEL=Root-1 ro single
initrd /boot/initrd.img-2.6.22-14-generic
boot

Note the way I put the "root=LABEL=Root-1" phrase in. Label is all caps. "Root-1" is the label I had assigned and defined in fstab. Don't confuse word wrap with returns in the above stanzas.

More things for you to have fun with. When you get bored, let me know, I have one or two more things up my sleeve you can play with and learn from. :-)

Fred
Last edited by Fred on Tue Apr 22, 2008 10:42 pm, edited 1 time in total.
User avatar
T J Tulley
Level 5
Level 5
Posts: 558
Joined: Wed Jul 18, 2007 10:18 am
Location: Hull, England

Re: rebuilding fstab and bootloader

Post by T J Tulley »

Thanks a lot, Fred: this has been quite a day so far!

Your option 3 using labels looks fairly straightforward - I shall print your post for digestion.

Re names for partitions - these ex-Windows partitions already have names which I can use - at least, i shall try them. They are names which I assigned to them while they were still running under Windows, and I am therefor familiar with them.

I had understood from background reading in the forums that Daryna and subsequent Mint versions would be dependent on UUIDs, but Husse's comments which I found today made me more hopeful.

At this particular moment I'm finding out how to use Wine, and have also just installed the help package for The Gimp. I have also downloaded Irfanview and its plugins, hoping to use it with Wine - but for the time being I have just used it in my laptop under Windows to batch-rename my latest 2 lots of pictures. It has been a very busy day.

BTW, the latest Wine in the Mint repository is 0.9.33, but Wine HQ has just announced 0.9.60. I believe we are warned to wait for new versions of applications to be screened for compatibility issues before using them in Mint. Wine offers binaries for Ubuntu Hardy in their own repository but don't say just how far they have progressed - new versions are coming out almost weekly. Any advice?
Yours hopefully -

Theo Tulley.
Using a PC with 2GB RAM, 3 hdds and a 1.7 GHz Celeron cpu.
Fred

Re: rebuilding fstab and bootloader

Post by Fred »

T J Tulley,

The warning about waiting for programs to be vetted and added to the repos is just that.... A warning. If you are willing to risk breaking something, you can use a latter version, but if you want to work with a stable system it is best to wait. There is just no way of forecasting whether you will get lucky or not.

I especially wouldn't take a risk with Wine. It tends to be a work in progress anyway.

I don't think that much of Wine, but I might be convinced to run it in a sand box if it will run "Irfanview." That is the only program I really missed after leaving Windows. I don't know what it is like now, but in Win95 days it was, in my opinion, the best picture handling program around, bar none.

Fred
Fred

Re: rebuilding fstab and bootloader

Post by Fred »

T J Tulley,

One thing I forgot to ask. Would you please post back your results when trying to run "Irfanview" in Wine, when you get around to doing that.

Like I said in an earlier post that used to be the best photo app. around. I could never really replaced it in Linux. Krita works ok but compares very poorly with the 8 - 10 year old version of "Irfanview."

Thanks,

Fred
User avatar
T J Tulley
Level 5
Level 5
Posts: 558
Joined: Wed Jul 18, 2007 10:18 am
Location: Hull, England

Re: rebuilding fstab and bootloader

Post by T J Tulley »

Thanks Fred - I only use Irfanview for bulk renaming - Photoshop 5 (which came with a camera) for other editing. Currently I'm investigating The Gimp which is highly commended for Linux. (I have posted in the Software & Apps forum).

Too late for more now - I've been out for the evening, and generally have too many irons in the fire! I'll let you know of progress with IrfanView under Wine.
Yours hopefully -

Theo Tulley.
Using a PC with 2GB RAM, 3 hdds and a 1.7 GHz Celeron cpu.
User avatar
T J Tulley
Level 5
Level 5
Posts: 558
Joined: Wed Jul 18, 2007 10:18 am
Location: Hull, England

Re: rebuilding fstab and bootloader

Post by T J Tulley »

Note to Fred again:
I've just tried to edit my fstab as you advised. It opens in Gedit saying (Read-only) - so I closed it and entered 3 commands:

theo@TJT4Celena:/$ ls -l /etc/fstab
-rw-r--r-- 1 root root 1491 2008-03-10 11:40 /etc/fstab
theo@TJT4Celena:/$ sudo chmod 664 /etc/fstab
theo@TJT4Celena:/$ ls -l /etc/fstab
-rw-rw-r-- 1 root root 1491 2008-03-10 11:40 /etc/fstab

The 1st shows its initial permissions, the second changes them, the 3rd shows that the changes have been made.

Then I re-opened it - it still shows (read-only), and if I look at its Properties in / - File Browser, it still shows read-only for Group: root. So I entered:

theo@TJT4Celena:/$ sudo chgrp theo /etc/fstab
Password:
theo@TJT4Celena:/$ ls -l /etc/fstab
-rw-rw-r-- 1 root theo 1491 2008-03-10 11:40 /etc/fstab

where the 2nd command shows that the group has been changed. Again, this change doesn't appear in Properties.

I suppose these changes might happen if I shut down and re-boot.
I'll save this Reply to a Tomboy Note and try! - Right - that came out of Tomboy - I've re-booted and find the changed permissions and group. Now I have tried to edit - apparently OK - and also to set the label for sda1 in a command line, as follows:
theo@TJT4Celena:~$ cd /
theo@TJT4Celena:/$ sudo e2label /dev/sda1 (E)DI8:H7R [where (E)DI8:H7R is the label I want to apply to sda1]
bash: syntax error near unexpected token `('
theo@TJT4Celena:/$ sudo e2label /dev/sda1 /"("E/")"DI8:H7R
Password:
e2label: Bad magic number in super-block while trying to open /dev/sda1
Couldn't find valid filesystem superblock.
theo@TJT4Celena:/$
You see that I tried to bypass the 2 brackets with slashes & quotes, but that hasn't worked. Perhaps I'm being too ambitious?
Yours hopefully -

Theo Tulley.
Using a PC with 2GB RAM, 3 hdds and a 1.7 GHz Celeron cpu.
Fred

Re: rebuilding fstab and bootloader

Post by Fred »

T J Tulley,

You are making things hard on yourself.

gksudo gedit /etc/fstab

should open the fstab file in a text editor.

If that doesn't work there is something wrong.... post back.

Fred
Last edited by Fred on Thu Apr 24, 2008 8:20 pm, edited 1 time in total.
User avatar
T J Tulley
Level 5
Level 5
Posts: 558
Joined: Wed Jul 18, 2007 10:18 am
Location: Hull, England

Re: rebuilding fstab and bootloader

Post by T J Tulley »

Hi Fred:

OK - I closed fstab and it opened with the command:
/$ gedit /etc/fstab - showing the label I had inserted for sda1.

sudo is not required because I had changed the permissions.

But: the command method of changing the label of sda1 didn't work, as shown in my last post. Presumably this is required to change the label of the partition itself, so that it will correspond with the calls in fstab - and in /boot/grub/menu.lst - except that I only want to apply labels to my NTFS partitions, and your example 2 days ago doesn't show how these are inserted in menu.lst for non-Linux partitions.

BTW, while browsing, I have just looked at Device Manager, and see that a LABEL which I applied to one of my Linux partitions this morning using a command line, as an exercise, does appear there - it's quite new and unmistakeable. The label is theoDaryna and is applied to my home/theo folder in Daryna. This is partition sdc10. The original Windows names of the NTFS partitions have always appeared in Device Manager. The label which I tried to apply to sda1 is one of these. They have also always appeared in "Computer", which is an icon on the desktop, when it is opened. "theoDaryna" now appears there too! But they don't appear in fstab.
Yours hopefully -

Theo Tulley.
Using a PC with 2GB RAM, 3 hdds and a 1.7 GHz Celeron cpu.
Fred

Re: rebuilding fstab and bootloader

Post by Fred »

T J Tulley,
I only want to apply labels to my NTFS partitions, and your example 2 days ago doesn't show how these are inserted in menu.lst for non-Linux partitions.
You don't need to modify the menu.lst file to recognize the NTFS partitions. All you need to do to automatically mount the NTFS partitions is put the LABEL= entry in the place of the UUID= entry and comment out the UUID= entry, all in /etc/fstab. The folders used for mounting should be auto generated in /mnt/media.

Do a:

sudo e2label /dev/sdxx

to see what the correct label is. Change it if you wish with:

sudo e2label /dev/sdxx NewName

Fred
User avatar
T J Tulley
Level 5
Level 5
Posts: 558
Joined: Wed Jul 18, 2007 10:18 am
Location: Hull, England

Re: rebuilding fstab and bootloader

Post by T J Tulley »

Thanks - but frustration. I entered ~$ e2label /dev/sdxx (sequentially) for sda1, sdb2, and sdb3 which are my 3 NTFS partitions - they all produced the response: e2label: Bad magic number in super-block while trying to open /dev/sda1 (or sddb2, sdb3) - this is while working in Celena.

If I open (in Celena) sdc8 which is the /root directory of Daryna, and go to /etc/fstab, they all appear with IDENTICAL short (16-character) UUIds thus: UUID=06E4035FE403507B

In sda5, the /root directory of Celena, sda1 appears in fstab as edited yesterday:
# /dev/sda1
LABEL=(E)DI8:H7R /media/sda1 NTFS defaults 0 2

and sdb2, sdb3 are just commented out - though they are mounted and accessible via icons on the desktop. I use them regularly. I could LABEL them as I did sda1 yesterday, but doubt whether this will produce any change.

I suppose I can edit new LABELs into fstab for Daryna, and then open Daryna - might be worth trying. (Later - I have to attend a funeral now).

So I'm stumped!
Yours hopefully -

Theo Tulley.
Using a PC with 2GB RAM, 3 hdds and a 1.7 GHz Celeron cpu.
User avatar
T J Tulley
Level 5
Level 5
Posts: 558
Joined: Wed Jul 18, 2007 10:18 am
Location: Hull, England

Re: rebuilding fstab and bootloader

Post by T J Tulley »

Hi again Fred:

Now I have edited LABELS for sda1, sdb2 and sdb3 into Daryna's fstab, and also inserted lines into its /boot/grub/menu.lst for the 3 Windows system - after root hd0,0 I have inserted a line: root=LABEL=(E)DI8:H7R, and similarly after root hd1,1 and after root hd1,2

I did that in Celena, then booted Daryna which is now running - it came up with an error message about power management, and with the 3 Windows partitions unmounted. I have checked menu.lst and it appears as I edited it - apparently more is required to make these partitions mount. I have now mounted them manually (and checked with df -h) but this is not satisfactory for using this system - I shall return to Celena.

Here is my edited entry for sda1 in fstab:
#/dev/sda1
#UUID=06E4035FE403507B /media/sda1 ntfs defaults,umask=007,gid=46 0 1
LABEL=(E)DI8:H7R /media/sda1 NTFS defaults 0 2

Here is my edited entry for the same Windows partition in /menu.lst:
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root (hd0,0)
root=LABEL=(E)DI8:H7R
savedefault
makeactive
chainloader +1

After mounting them I tried:
theo@TJT5Daryna:/$ sudo e2label /dev/sda1

with the response: (same as reported yesterday, in Celena)
e2label: Bad magic number in super-block while trying to open /dev/sda1
Couldn't find valid filesystem superblock.

Apologies for a long story - i shall be most grateful if you have the patience to read it and advise.
Yours hopefully -

Theo Tulley.
Using a PC with 2GB RAM, 3 hdds and a 1.7 GHz Celeron cpu.
Fred

Re: rebuilding fstab and bootloader

Post by Fred »

T J Tulley,

You fstab entries should look like this:

#/dev/sda1
#UUID=06E4035FE403507B
LABEL=(E)DI8:H7R /media/sda1 ntfs defaults,umask=007,gid=46 0 1

Don't confuse returns with word wrap.

Don't change your Windows boot stanza, leave it as it was.

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1

Fred
Locked

Return to “Non-technical Questions”