Премини към съдържанието
  • Добре дошли!

    Добре дошли в нашите форуми, пълни с полезна информация. Имате проблем с компютъра или телефона си? Публикувайте нова тема и ще намерите решение на всичките си проблеми. Общувайте свободно и открийте безброй нови приятели.

    Моля, регистрирайте се за да публикувате тема и да получите пълен достъп до всички функции.

     

Архивирана тема

Темата е твърде стара и е архивирана. Не можете да добавяте нови отговори в нея, но винаги можете да публикувате нова тема, в която да продължи дискусията. Регистрирайте се или влезте във вашия профил за да публикувате нова тема.

rostislaf

Помощ за малко по-особена инсталация

Препоръчан отговор


Та ситуацията е следната, имам един Nokia booklet с прецакан харддиск. Прецакан е дотолкова че като позагрее малко престава да работи. Самия нетбук може да буутва от харда и от usb флашка. Има слот за SD карта от който не може да буут-не. Идеята е следната - да се инсталира лека дистрибуция на SD-картата и само буутването (GRUB предполагам) да е на харддиска. Буутването от USB флаш не е опция.

Благодаря предварително за всякаква помощ.

 

P.S. Охлаждаща подложка е изключително тъпа идея при положение че съм задал конкретен въпрос. Сега е момента да ми дадете и линкове откъде да си купя харддиск... Или направо нов нетбуук?

Сподели този отговор


Линк към този отговор
Сподели в други сайтове

Някаква подложка за охлаждане може и да ти свърши работа ако ти се намира  :)

Сподели този отговор


Линк към този отговор
Сподели в други сайтове

Хето ти едно решение а ако ти се стори скъпо просто слагаш под лаптопа си един картон и трябва да ти свърши работа от опит знам ,че става ,но не го оставяй на маса със постелка която е мъхеста или със някакви влакна :)

Сподели този отговор


Линк към този отговор
Сподели в други сайтове

Ето това намерих за твоя проблем...Пробвай и кажи дали работи :) Успех.

 

The Problem

PC does not accept a SD-card as boot device. But I want to have my alternative OS being located on a SD-card partition.


Assumptions
 

  • [*]The PC has a bootable device
    I have installed a previous version of Ubuntu on it. Ubuntu is not necessary, but like this I can refer on it and only you have to deal with your variations. [*]GRUB 2 is propperly installed on that bootable device (that's
not the GRUB of the SD-card installation) [*]The PC cannot boot using the SD-card as boot device (the initial problem) [*]You already have installed your new Linux with GRUB 2 on your SD-card (and are frustrated because it does not boot...)

Notes

Only you yourself are responsible for any lost data or any other inconveniances that might result from your actions by following these words. So don't forget to make the necessary backups of your data and update your emergency disks for the worst case.
Please read and understand the whole thing, before you start!
Be aware, that this is only a step-by-step guide for a proof of concept. The result of this solution is not suitable for production use, as it requires manual updates after each kernel-update the Linux on the SD-card.



Method to solve the problem

  1. [*]We extend the "initrd" to support the sd-card hardware. [*]Then we place the files, required to boot Linux, on a device that is accessable for GRUB. [*]Finally we patch the configuration of the GRUB 2 residing on the bootable device to have the correct menu entry for our OS.

For those guys, that are proficient in configuring GRUB and Linux in the terminal, just jump to the bottom of the guide (end of III.) to see the sample and the pointing out of the essential trick.




Step by Step


I. Add the modules for SD-card support to the "initrd"-file of your SD-card Linux.

As the SD-card linux does not boot, we have to do that with an other Linux and use the "chroot" feature.

  1. [*]Boot to a Linux [*]Insert the SD-card with the not-bootable Linux [*]Mount the SD-card partition with the Linux, if the automounter does not do the job.
    I assume the mount at "/media/sdcard". Substitute this by your real mount path. [*]Open a terminal and issue the following commands. They will prepare and start the chroot environment.
Code:
$ cd /media/sdcard
$ sudo mount -o bind /dev ./dev
$ sudo mount -o bind /proc ./proc
$ sudo mount -o bind /sys ./sys
$ sudo mount -o bind /tmp ./tmp
$ sudo chroot .
#
Now we are in the environment of the SD-card Linux as user root. [*]Add the required modules to support the SD-card at the start of Linux (after GRUB 2 passes over the control)
Edit the file
Code:
/etc/initramfs-tools/modules
by adding these module names:
(On other hardware/Linux the required modules might differ For my system with Ubuntu 12.04 these modules have done the job.)
Code:
mmc_block
sdmod
[*]Back on the command line execute the following command to repackage the "initrd"-file:
Code:
# update-initramfs -u
[*]To leave the "chroot" environment execute
Code:
# exit

II. Copy the Linux boot files to the bootable device

CD to the root directory of your bootable device.
In case of the internal hdd its "/", for an USB-Stick something like "/media/usb"
Typically you will find there the "boot" directory of the GRUB installed on your bootable device.
Code:
$ sudo mkdir boot.guest
$ ls -l /boot # to find out the real kernel version
$ sudo cp /boot/*3.2.0-23* boot.guest/ # substitute the kernel version by yours.
NOTE: After a kernel update of the SD-card's Linux this step has to be repeated.

III. Add the menu entries to the GRUB 2 configuration on the bootable device

Depending on your Linux distribution, there might be some differences of the GRUB integration in the distribution. As the GRUB on the bootable device is the code executing version, it is preferable to let that GRUB generate some menu entries, but not just copy/paste the relevant entries from the SD-card's GRUB:
  1. [*] 
    1. [*]If not already up 'n running, start the OS that hosts and manages the GRUB 2 installation of the bootable device. [*]Insert your SD-card with the not-booting Linux installation. [*]Execute:
Code:
$ sudo update-grub
This should generate probably 2 additional entries for your not booting SD-card installation. These entries will not work, but they are the base for our further patch. [*]Might be that errors occure (something like "no device"). Then the script could not find any GRUB device entry for your SD-card in the file
Code:
/boot/grub/device.map
  • [*]Check the device filename of your SD-card (This example: "/dev/sdc") [*]Edit (with root priviledges) "device.map" manually and add a new entry for your SD-card. Example:

Code:
(hd0) /dev/sda
(hd1) /dev/sdb
(hd2) /dev/sdc
Then repeat step 3.

Typically the updated GRUB 2 configuration is stored in
Code:
/boot/grub/grub.cfg
  • [*]Open it for later copy/paste (read-only is enough)

We will add a custom script to provide our custom entries directly after our linux distribution on the bootable device (Details her fit to Ubuntu). The position is defined by the number the script-name will start.

  1. [*]
Code:
$ cd /etc/grub.d
$ sudo cp 40_custom 15_custom_sdcard
[*]Open with root priviledges the new file "15_custom_sdcard" for further editing. [*]Change to the previously opened "grub.cfg".
Search and copy the two menu entries for the SD-card Linux boot. [*]Paste the copied text to the end of the "15_custom_sdcard". [*]Find the correct GRUB device name "(hd?,?)" for your boot device. You will find it in the the already opened "grub.cfg" at the menu entry for the Linux on your boot device.
Patch the following line in both menu entries of "15_custom_sdcard" to the values you've found.
Code:
set root=(hd?,?)
[*]Now we patch the "search" line of both menu entries. Typically a UUID is set as search string. Substitute the given UUID (very log hex-number) by the UUID of your boot device.
Besides many other ways you typically can find it at the already opened "grub.cfg" within the menu entry for your Linux on the boot device. [*]As the next we correct the path to kernel and initrd files. Currently they are stated to be in "/boot". This we correct to the new path
Code:
/boot.guest/.....
[*]Optionally you can change the first line of the menu entries to get a more conveniant description. (Watch out to edit only within the quotation marks.) [*]Save and close "15_custom_sdcard".
Close "grub.cfg". [*]Execute
Code:
$ sudo update-grub
[*]Everything done. - Verify the content of your newly generated "grub.cfg" for the presence of your new menu entries.

NOTE: After a kernel-update of the SD-card Linux, the statements "linux" and "initrd" have to be updated to the new filenames.




To get a visual imagination of how the "15_custom_sdcard" should look like, here an example. Note: The detailed values will not fit to your system.


Code:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.



menuentry 'Ubuntu 12.04 LTS (sd-card)' --class ubuntu --class gnu-linux --class gnu --class os {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set=root 12345678-222d-333e-444f-123456789abc
linux /boot.guest/vmlinuz-3.2.0-24-generic root=UUID=1abcdef1-a1a1-b2b2-c3c3-1abcdef12345 ro quiet splash $vt_handoff
initrd /boot.guest/initrd.img-3.2.0-24-generic
}
menuentry 'Ubuntu 12.04 LTS (sd-card) (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set=root 12345678-222d-333e-444f-123456789abc
echo 'Loading Linux 3.2.0-24-generic …'
linux /boot.guest/vmlinuz-3.2.0-24-generic root=UUID=1abcdef1-a1a1-b2b2-c3c3-1abcdef12345 ro recovery nomodeset
echo 'Loading initial ramdisk …'
initrd /boot.guest/initrd.img-3.2.0-24-generic
}
To point out the essential trick:

  • [*]The "set root" statment points to the bootable disk, where the "outsourced" kernel and initrd reside. [*]Also the "search" statment points to that bootable disk. [*]But the "linux" statement has to point to the SD-card !!!

 

IV. Reboot your system and in the GRUB menu choose the SD-card Linux


V. What's next to do?

  • [*]To get all this to production quality, some should extend the GRUB script "15_custom_sdcard" to make an autodetect for the newest filenames of linux and initrd in "/boot.guest/". Then replacing these names with apropriate variables in the script will make editing obsolete.
    (Should be a 5-minute job for a GRUB experienced coder.) [*]Write a script that automatically will copy new versions of the kernel files to the outsourced directory. (dito effort as above.)

VI. Alternative solution:Surely it is possible to install GRUB 2 of the SD-card Linux to the bootable device directly by something like

Code:
$ sudo grub-install --boot-directory=/mnt/boot /dev/sdb

A manual copy action after a kernel update would be obsolete.



This alternative might be especially usefull if "/dev/sdb" represents your bootable USB-device.
For "/dev/sdb" being your internal harddrive with your primary OS, you should first think about the consequences concerning your primary OS.


Mentioning my personal taste, I prefer to have the complete OS on the SD-card and make a copy to the outsourced boot folder. So the grade of portability between other computers is higher. As a consequence, I would also keep an up-to-date copy of the file "15_custom_sdcard" on the SD-card.

Сподели този отговор


Линк към този отговор
Сподели в други сайтове

Ето това намерих за твоя проблем...Пробвай и кажи дали работи :) Успех.

 

The Problem

PC does not accept a SD-card as boot device. But I want to have my alternative OS being located on a SD-card partition.

......

 

 

Благодаря, ще пробвам тия дни и ще драсна дали е станало


Сподели този отговор


Линк към този отговор
Сподели в други сайтове

×
×
  • Добави ново...