GRUB2 for debianers

GNU GRUB2 setup and management seem to be more complex than those of the old (Legacy) GNU GRUB (GRand Unified Bootloader).

The GRUB Legacy to GRUB 2 transition is a part of the lenny (stable) to squeeze (testing) Debian release upgrade. The transition is not automatic, but it is quite easy to carry out: During the release upgrade (apt-get dist-upgrade) I was presented with the following menu


Configuring grub-pc

GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub.

In order to replace the Legacy version of GRUB in your system, it is recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from your existing GRUB Legacy setup. This step may be automaticaly performed now.

It's recommended that you accept chainloading GRUB 2 from menu.lst, and verify that your new GRUB 2 setup is functional for you, before you install it directly to your MBR (Master Boot Record).

In either case, whenever you want GRUB 2 to be loaded directly from MBR, you can do so by issuing (as root) the following command:

upgrade-from-grub-legacy

Chainload from menu.lst? [YES/no]

Obviously I answered the default (yes, why not?), and I also answered yes to the other GRUB-related question that I was presented [just keep the Spanish keyboard and the video mode I like for the data terminals (tty)]:


Configuring grub-pc

The following Linux command line was extracted from /etc/default/grub or the `kopt' parameter in GRUB Legacy's menu.lst. Please verify that it is correct, and modify it if necessary.

Linux command line:

lang=es vga=792

[Ok]

Once the dist-upgrade finished, I rebooted the system and the chainload proved to work correctly, the new GRUB2 menu was completely operational. Then I ran the upgrade-from-grub-legacy command, and the difficult question showed up:


Configuring grub-pc

The grub-pc package is being upgraded. This menu allows you to select which devices you'd like grub-install to be automatically run for, if any.

It is recommended that you do this in most situations, to prevent the installed GRUB from getting out of sync with other components such as grub.cfg or with newer Linux images it will have to load.

If you're unsure which drive is designated as boot drive by your BIOS, it is often a good idea to install GRUB to all of them.

Note: It is possible to install GRUB to partition boot records as well, and some appropriate partitions are offered here. However this forces GRUB to use the blocklist mechanism, which makes it less reliable, and therefore is not recommended.

GRUB install devices:

[ ] /dev/sda (500107 MB, MAXTOR_STM3500320AS)
[ ] - /dev/sda1 (5000 MB, /)
[ ] /dev/sdb (1500301 MB, ST31500341AS)

[Ok]

Then it came to my mind that a computer-savvy colleague messed up his MBR’s a couple of months ago. Why the hell I didn’t think about that until then? What was wrong with GRUB Legacy at the moment (I mean, it is still `stable’!)? After those first seconds of panic, I calmed myself down: I knew the answer, in my computer there is a single MBR, and it is at the beginning of the first hard disk, so the right answer is to only select the first option. Ok, done. I reboot, there is no chainloader and everything goes ok, great.

Ok, now let’s do something with the new GRUB. The dist-upgrade installed a new kernel (2.6.32), it seems to be working flawlessly, and the oldest one is no longer compatible with the new nvidia module, so I can safely remove it. First I remove the packages (apt-get --purge remove linux-image-2.24-amd64 and some other related ones), and now I should update the GRUB menu. The old command for this was update-grub, the new one is… the same, great! The remaining kernels are correctly found, so I reboot the system and everything goes ok again. Great.[*]

Before I upgrade the system I usually increase the seconds that the computer stops at the GRUB menu before booting the default option. It takes a few seconds to change this setting, and when I have run into problems with the upgrade it has proven useful. In these situations you may try different kernels, or run in single-user (safety) mode, usually in console mode. You may spend quite a lot of time discovering new technicalities (aka wasting your time) and using different approaches to try to solve some problem. So when you reboot, you cannot type, and I have a tendency to stretch then my legs a little, stretch my arms, don’t look to the screen for some seconds… and oh damn, I forgot to run the non-default GRUB entry that I wanted to test, I’ll have to reboot again! Increasing the time that GRUB pauses in the menu makes it more probable that you notice that you must type something (or if not you’ll have to reboot again). Once I check that everything is ok with the new system, I reduce that time to a couple of seconds, so that the load is fast but I may still have enough time to choose a non-default option in case it is necessary.

In GRUB Legacy this timeout change was implemented by just editing one of the lines of the /boot/grub/menu.lst file


## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 5

However, this file, which also contains all the GRUB menu entries and options, is invisible to the new GRUB 2, and has only been kept back for safety and as a backup of old settings. There’s a new file in the /boot/grub folder, grub.cfg, but its first lines are very clear:


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

The timeout option can be set in the /etc/default/grub file:


# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

GRUB_DEFAULT=0
GRUB_TIMEOUT=2
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="lang=es vga=792"

The file is quite self-explanatory (although the non-technical user still won’t have a clue of what the GRUB_DEFAULT is), and, as it clearly states, now you have to run update-grub after you change any of its settings so that they have any effect in the booting.

This change is to some extent an improvement. The old menu.lst file was a little strange, since it had uncommented lines, commented lines (lines starting with a #) and doubly-commented lines (##). Some options like the timeout were set in an uncommented line, but some others (like the default kernel options kopt) were set in commented lines, and were applied to the menu entries by running update-grub. Other commented lines were just comments, as were all doubly-commented lines (pseudo-titles of file sub-sections as well as explanations and examples of settings to be defined in commented lines).

However, with the new GRUB version you have to run the update-grub command after you change anything. This makes the process longer, and you may forget to run the update, but at least you know that you must always run the update, not only sometimes.

This particular detail is just showing what reportedly is a global change in GRUB (from Legacy to 2): the new system is truly better structured, but it is also much more complex (some may even say cumbersome) than the old one.

[*] You may update-grub before the upgrade-from-grub-legacy, but then you will only be updating the chainloaded GRUB (2) menu, not the chainloader GRUB (Legacy) entries.

debian-multimedia

It only has taken me 190 days to notice that Christian Marillat created a non-free section in his debian-multimedia repository.

After adding it to my sources.list, apt-get update; apt-get upgrade has updated all my acroread-related packages. This seems to have finally solved my acroread-iceweasel problems (frequent crashes) in the amd64 arch.

OMG…

/.

You know you are a nerd when…

  • You read a news post about a Vim version that you know that was released half a year ago, just to enjoy the umpteenth battle of the editor war. Then you remember old times, when people from the Church worked harder. You think their arguments against Vim, although completely false, used to seem better than now. Then you go back to edit your code, and press i.

  • You read that Scientists Harvest Nano-Power From Hamsters, and you think that posting about it in your blog is the best way to remember to tell it to your nanoscience colleagues tomorrow morning.

  • You read that False Fact in Wikipedia Proves Itself, and you are not surprised at all. You expected it. Since causality concerns information, there’s no problem with Wikipedia not being causal. Although you hate it being like this, because you enjoy reading and editing it. But there are too many editors that don’t really understand what primary sources (like you) are.

  • You read that Intel Moves Up 32nm Production, Cuts 45nm, you know what this means and the benefits of the change without reading anything but the title, hope Intel’s bet is successful, and enjoy reading comments like Do you know how much CPU it took to fucking land someone on the moon? Why does it take 200 times that just to browse the web? or —Why would even watching a video on youtube need a 16-core processor?—You clearly underestimate how much Flash sucks. And you think you should not begin criticising Flash now if you want to sleep before tomorrow morning.

  • You read that Microsoft is being accused of squandering billions on R&D (and follow a couple of links), you learn how the R&D investments of Microsoft + Big Blue compare to the (already known) totals of your (supposed-to-be-developed) country, and ask yourself why things cannot change at home, at once.

Slashdot. News for nerds. Stuff that matters.

Hello world!

Welcome to WordPress.com. This is your first a post. Edit or delete it and start blogging!

Old profile

It’s been more than 9 months since I last edited this blog. Many things have changed since then, and even more since I wrote my first profile, which I will now almost completely rewrite:

Occupation: Senior Physics undergraduate student

About me: I am a 20 years old boy from Barcelona, Spain. I am in the last year of the Physics degree in the ‘Universitat de Barcelona’. I hope to begin doctoral studies next year (if you can offer me a fellowship, please, contact me xD). I have also applied for being a Summer Student in CERN (Geneva, Switzerland) in Summer 2005 (what a great summer it would be!!). Concerning my non-academic interests, I enjoy listening to music a lot. I also play the piano and the violin. My other two great hobbies are books and go. I enjoy reading almost all kinds of books, although these last years I’ve had little time to read non-Physics related literature due to the difficulty of the degree courses. On the other hand, go is a thrilling intellectually-demanding two-player oriental board game. On personal grounds I am actually living with my parents, but I’d like to stop relying on them next year. What more can I say?… Well, I also have fun going out with my friends (who doesn’t? :$). Ah, and these days I am not dating anyone: I am single and half looking :P . If you want to know more about me, just read my blog :D (don’t be shy and post or e-mail anything you want to!).

There was not CERN at all. I managed to graduate in September. After that I began my graduate studies in the Advanced Physics programme at University of Barcelona, and I also began participating in the research of the Quantum Information and Computation group. I had a teaching assistant contract during the first semester, and since 1st April I am a FPU fellow.

During the Holy Week I had a little relax and reading, but I haven’t still finished the Two Towers!! :’(

I also didn’t play go with human opponents for many months. Some weeks ago I tried a comeback, but it won’t last too much, I think.

On the other hand, I love music even more than I did a year ago. I think I have improved quite a lot my piano abilities… A month ago I began playing `Études’ by Frédéric Chopin!! I have also begun assisting to some live classical music concerts, and I enjoy them a lot!

After summer my relationship with my parents recovered from all the stresses of the previous two years, so I still live with them, and I think this will go on at least until I doctorate. Maybe a stable enough girlfriend would make me change this belief, but since I haven’t dated anyone since I wrote last year profile I seriously doubt about that. xD

Well, what more can I say? Now I have some more friends, some friends now are even better friends, the sun shines everyday (it’s been a dry spring in Barcelona xD), life is good, and I am happy :) See you soon!!

P.S.: A week ago I began a photoblog, you may visit it at www.fotolog.com/ripero1984.

My Google Searches

As you may suppose, my favourite browser is Mozilla Firefox. You may think it reflects lack of personality, but I use as start page the default start page, which is just a firefox-adapted Google search page.

Today I happened to press the ArrowDown key when the cursor was in the search bar, and a menu with the first alphabetically ordered search queries was displayed. I was quite shocked by them:

  • Erik van der Werf: Well, it seems that I wrote a space before Erik, so that’s why this is the first of the list. He is a researcher in Computer Go, and you may visit his homepage at the University of Maastricht.

  • Gradshteyn: The same as before applies. When Mathematica can’t solve an integral, and you don’t know any Russian matematician, you can only try something: look for a Russian book. Gradshteyn & Ryzhik’s Table of Integrals, Series and Products has a spectacular review at amazon.

  • “I am Richard Stallman” GNU emacs: If you don’t know who Richard Stallman is, I may pardon you someday, but not today. You probably have heard about an operating system called Linux… Well, some people argue that Linux is not an OS, that it is just the kernel. Stricto sensu, they say the OS is GNU (for Gnu’s Not Unix). Anyway, Richard Stallman is the creator of GNU, the idea of free software. Feeling lucky with the words above you directly find the initial announcement of GNU (dated 27-Sep-1983), which is a must read for everybody.

    Saint IGNUcius

    “Free software” is a matter of liberty, not price. To understand the concept, you should think of “free speech”, not “free beer”.

  • “I would like to be Lorentz invariant”: When you spend your summer studying Classical and Quantum Theory of Fields, you are susceptible of having such desires.

  • “I would like to be Poincaré invariant”: The same as before applies, with d additional translational conditions.

My conclusion: I need a girlfriend.

Still alive

Good evening

I just wanted to say that I am still alive. Things didn’t go too well last year, so I am taking 6 exams on September. I’ve been studying all summer, so I hope I’ll pass all of them. I really must pass the exams, since I already have a position in a research group as a graduate student, and I should begin all the graduate stuff before October.

I suppose I’ll begin writing on a regular basis some day. When that day will come, nobody knows, but considering I feel busier everyday… it may take some 40 or 50 years . Meanwhile, in case you feel bored, you may consider trying (do ( ) (( ))) (also known as Ruben Berenguel’s blog) or goproblems.com.

Amazon order

Today I didn’t go to class. I’ve been having a sore throat for some days, and today it was specially painful when I woke up, so I stayed in bed for all the morning.

In the afternoon I felt some kind of guilty, since during the last two weeks I couldn’t go to even half of the classes I should. I hope this gets balanced somehow by spending some time ordering the books for the semester from Amazon. Here goes the list:

Yes, they are a lot of books, and some of them are quite expensive… So I must show my deepest gratitude to my parents, who made this possible!

I spent the rest of the day relaxing and playing the piano.

P.S.: Today I somehow faced the two main cons of stopping relying on my parents next year: the money for the things I enjoy and my piano.

February holidays

Sorry for not posting in 3 weeks. There were a lot of things to do, and didn’t have time to write.

The Swedish trip was nothing more than a dream. I would have had to sleep one or two nights in airports or bus stations, and I found this not too much enjoyable – the other option was paying ~490€ with Spanair, and I couldn’t afford this -.

To avoid the disappointment, I tryied many other activities. Car driving by Catalonia was quite entertaining, and I seized the opportunity to visit some familiars and friends :D . Going shopping was also fun, and now I have some kind of renewed dressing style and I feel more comfortable with the clothes I wear.

I also attended to the Albert Einstein Day at the Facultat de Matemàtiques i Estadística of the Universitat Politècnica de Catalunya. There were up to five conferences related to Einstein’s life and research (2 exciting, 1 good, 1 acceptable and 1 boring scheduled at nap time). During the meal time I even played go with another member of the public! In fact these days I’ve played go a lot, not only at KGS but also with classmates and at IGS.

Finally, my last semester as an undergraduate began on 14th February. I am taking 5 new subjects, so I have a lot of classwork. This was in fact a study break, so… see you soon :-) .

Why English?

Mahler – Symphony No. 5 in C sharp minor

When I decided to run a blog, one of the most difficult choices was the language (by the way, were there any other choices?).

My mother tongue is Spanish. The main reason is that my father is from Huesca and my mother’s parents were from Burgos, and Spanish is the only language spoken in these regions. However, I live in Catalonia (aka Catalunya), where Spanish coexists with another language, called Catalan. I have also acquired proficiency in Catalan, since part of my education has been taught in this language, and many of my mates and friends usually speak this tongue. Finally, I began learning English when I was five, and I have some certificates from Cambridge which say that I am also proficient in English as a non-native speaker. (I won’t make any comments about my French abilities… French is to English for me more or less like my violin is to my piano).

It would be easier for me to write in Spanish, or even Catalan. Then… why the hell am I writing in English? I thought more people would read the blog this way, but maybe more people around me would read it if it was in Spanish. Here I say Spanish because there is very few people that can read Catalan and not Spanish, whilst the opposite is false.

Well, I hope this answers the question. In any case, I may write in Spanish or Catalan if I feel like it. It is some kind of Thermodynamics of the human beings: laziness exists, and the arrow of time makes us tend to a state in which it is a maximum. If you didn’t understand this last sentence don’t panic: it’s some kind of mad physicist’s stuff.

I wish next post will be about a trip to Uppsala, Sweden. There’s a good friend of mine who deserves a visit, but Swedish bus and train companies are making it difficult.

Seguir

Get every new post delivered to your Inbox.