Got a burn­ing ques­tion about open source or the ker­nel? What­ever your level, email it to­swers@fu­

Linux Format - - CONTENTS - Dr. Jonni Bid­well At­tempts to fix your Tuxbased faults.

A He-Man ref­er­ence, a Philip K Dick ref­er­ence, a Mar­cel Proust ref­er­ence, but you’ll have to work out the last one your­self.

Q I’ve (not) got the power

Ex­cited by the re­lease of the Pi 3 B+, I fi­nally got around to get­ting its pre­de­ces­sor. Man­aged to snag a bar­gain on eBay, com­plete with a case.

I was im­pressed at how quickly it boots and how much bet­ter it does nor­mal desk­top things (web brows­ing, in par­tic­u­lar YouTube, and Li­breOf­fice). How­ever, I no­ticed a small light­ning graphic ap­pear­ing in the top right-hand cor­ner pe­ri­od­i­cally.

Af­ter some in­ves­ti­ga­tions I found some log mes­sages say­ing un­der­volt­age

de­tected . If I switch to the ex­per­i­men­tal vc4 driver, then the light­ning bolt dis­ap­pears, but the mes­sages are still in the log. I’m con­fused by this, be­cause the same power sup­ply works fine for my phone and older Rasp­berry Pis. Wil­liamBurn­side A A few peo­ple have run into this prob­lem. Hav­ing Blue­tooth and wire­less on­board, as well as all that ex­tra pro­cess­ing power, bumps up the Pi 3’s power re­quire­ments sig­nif­i­cantly. As such it’s fit­ted with a warn­ing sen­sor that emits alerts when the 5V in­put drops be­low 4.63V. The SoC it­self can cope with oc­ca­sional volt­age drops (it can throt­tle the CPU or drop ra­dio power), but other pe­riph­er­als may not be so for­giv­ing.

The prob­lem is of­ten cheap USB power sup­plies or poor-qual­ity USB ca­bles. Our at­tempts to com­pile FFM­PEG (which is a bru­tal process) kept re­set­ting the Pi be­cause of this. Power sup­plies may claim to be able to dish out 5V at 2A, but they of­ten do so un­re­li­ably.

We rec­om­mend us­ing a sep­a­rate pow­ered hub, es­pe­cially if you’re work­ing with power-hun­gry USB de­vices such as hard drives. If you’re se­ri­ous you can even pur­chase a six-port hub where each port has an in­de­pen­dent 3A sup­ply, so if one de­vice be­comes busy it won’t af­fect the oth­ers. The vc4 driver is great, but it doesn’t mag­i­cally solve power prob­lems, it’s just that the firmware can no longer ac­cess the frame­buffer di­rectly to draw all over it, so you have to make do with the text warn­ings.

Q Dial LVM for Mur­der

Not con­tent with a dual boot setup, I con­fig­ured an LVM ar­ray on my 2TB hard drive with the idea that it would make adding new dis­tros eas­ier. I’m now five dis­tros in (Ubuntu, Mint, openSUSE, Fe­dora and Arch Linux) and use the rest of the LVM ar­ray as a large stor­age par­ti­tion. Only once did I for­get to shrink the filesys­tem first and have to re­store a lot of things from backup, but we don’t talk about that. When­ever I need to add a new dis­tro, I shrink the stor­age filesys­tem and par­ti­tion by 40GB and add a new log­i­cal vol­ume. Be­sides the LVM par­ti­tion, I have a 512MB EFI par­ti­tion and a 512MB boot par­ti­tion.

But I’m slightly con­fused as to whether or not I still need this /boot

par­ti­tion. Based on what I’ve read from multi­boot tu­to­ri­als, it’s good prac­tice to let one dis­tro take care of GRUB, so this par­ti­tion is only mounted from Ubuntu, and when­ever I run grub-up­date there it picks up any new ker­nels from the oth­ers. This has al­ways seemed a bit like magic to me.

How­ever, I thought I un­der­stood that we also needed this boot par­ti­tion be­cause the GRUB EFI image wasn’t able to pen­e­trate LVM par­ti­tions. In fact, I seem to re­call that in the past even Stage 2 GRUB couldn’t ac­cess these vol­umes. Nowa­days I see in­s­mod lvm in my grub. cfg, which pre­sum­ably is a GRUB mod­ule for do­ing just that. And since my nonUbuntu dis­tros store their ker­nels on their own par­ti­tions, this lends even more weight to this pre­sump­tion.

Fur­ther­more, I can boot some dis­tri­bu­tions (Arch and Fe­dora) straight from the UEFI menu, which takes me to a dif­fer­ent GRUB menu, one which ap­pears to live in­side those dis­tros’ log­i­cal vol­umes. This seems to con­tra­dict my pre­vi­ous think­ing about GRUB not be­ing able to ac­cess LVMs. ArthurCay­ley,vi­ae­mail A Be­fore GRUB 2 came along, a boot par­ti­tion (with the GRUB stages 1.5 and 2 files and ker­nels) had to ex­ist out­side the LVM. Once loaded the ker­nel (or more likely the ini­trd) could un­ravel the LVM magic and pivot to the root filesys­tem there. With GRUB 2, as long as the LVM mod­ule is in­cluded in the GRUB_

PRELOAD_MODULES vari­able in the file /etc/de­fault/grub, then it can hap­pily read LVM vol­umes di­rectly (with the ex­cep­tion of thin log­i­cal vol­umes), so the /boot par­ti­tion is no longer re­quired.

For UEFI boot­ing, GRUB images are in­stalled to the EFI par­ti­tion with a path to a con­fig­u­ra­tion file hard­coded in­side them. On Fe­dora, for ex­am­ple, this is EFI/ fe­dora/grub.cfg and this file is up­dated by the Grubby tool when­ever a new ker­nel is in­stalled. This is a lot dif­fer­ent to the file gen­er­ated by grub-mk­con­fig , which uses os-prober (or magic if you like) to ex­am­ine other par­ti­tions. Since stock Arch ker­nels are all named vm­linuz-linux there’s no need for any menu up­dates once you’ve gen­er­ated it (more likely painfully con­structed it by hand) the first time. Ubuntu and de­riv­a­tives all use grub

mk­con­fig to re­gen­er­ate the menu on ker­nel up­dates, so you see all OSes when you boot those images.

From one Arch user to an­other – if you find that os-prober takes a while to de­tect Arch, try in­stalling the lsb-re­lease pack­age to help it fig­ure out what’s what.

This baby can de­liver up to 3A per USB port, with a max­i­mum of 12A for the de­vice.

Once you get locked into a se­ri­ous LVM col­lec­tion, the ten­dency is to push it as far as you can

Newspapers in English

Newspapers from Australia

© PressReader. All rights reserved.