Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Grub

Ask for help with issues regarding the Installations of the Debian O/S.
Message
Author
babak
Posts: 19
Joined: 2011-05-23 09:31

Grub

#1 Post by babak »

Hi everyone
I have debian installed on an external HD on dualboot with XP on my PC. Is there a way to access debian on another PC ? please.

peer
Posts: 449
Joined: 2017-03-26 10:14
Has thanked: 8 times
Been thanked: 22 times

Re: Grub

#2 Post by peer »

yes, you should install grub also to the external hard disk.

start debian and go to the terminal
then give the command: sudo grub-install /dev/sdX
/dev/sdX is your external disk: probably: /dev/sdb

Now grub is installed on your external disk and you can start it from another pc (if it can boot from usb)

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Grub

#3 Post by debiman »

it MIGHT just work, but during installation debian makes some choices according to the hardware you're currently using, so if the hardwares differ significantly it might not work.

ruffwoof
Posts: 298
Joined: 2016-08-20 21:00

Re: Grub

#4 Post by ruffwoof »

For a more generic version of a 'portable' Debian, try removing

/etc/fstab
/etc/udev/rules.d/*
/etc/X11/xorg.conf

as that will have the boot look for HDD's, CD's/Network and video display respectively, rather than using prior boot copies from the previously booted PC

In some cases it might boot to a black screen in which case adding a nomodeset parameter to the kernel boot can get around that (i.e. if boots to black screen then boot again and use the boot edit to add nomodeset to the kernel line/parameters).

Using synaptic to add firmware (i.e. non-free stuff), gives you a better chance that another PC will boot as well.

babak
Posts: 19
Joined: 2011-05-23 09:31

Re: Grub

#5 Post by babak »

Thanks Peer for the answer but I could not install it :

grub-install : attention : Le système de fichiers « ext2 » ne prend pas en charge l'embarquage.
grub-install : attention : L'embarquage est impossible. GRUB ne peut être installé sur cette configuration qu'en utilisant les listes de blocs. Cependant, les listes de blocs ne sont PAS fiables et leur utilisation est déconseillée..
grub-install : erreur : refus de continuer avec les listes de blocs.

which means refuses to continue beacause ext2 does not accept the installation. Well as far as I remember the fs is ext4 and not ext2

any idea ?

babak
Posts: 19
Joined: 2011-05-23 09:31

Re: Grub

#6 Post by babak »

uffwoof thanks for the answer

but it seems to be too risky and complicated. I am not an expert in this field man.

babak
Posts: 19
Joined: 2011-05-23 09:31

Re: Grub

#7 Post by babak »

debiman I think you are right. Unfortunately :)

Dai_trying
Posts: 1101
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Grub

#8 Post by Dai_trying »

could you post the output of

Code: Select all

sudo blkid
That will help determine the hdd structure for better advice.

babak
Posts: 19
Joined: 2011-05-23 09:31

Re: Grub

#9 Post by babak »

Dai_trying wrote:could you post the output of

Code: Select all

sudo blkid
That will help determine the hdd structure for better advice.


Here you are

/dev/sda1: LABEL="Zeynab" UUID="B8D49107D490C8D0" TYPE="ntfs" PARTUUID="0f7e1a2b-01"
/dev/sda2: LABEL="HP_RECOVERY" UUID="FA6872346871F02D" TYPE="ntfs" PARTUUID="0f7e1a2b-02"
/dev/sdc1: UUID="b8e1c52d-b1f2-47f1-a48e-afd8f5f71016" TYPE="ext4" PARTUUID="820f8270-01"
/dev/sdc5: LABEL="Kobra" UUID="01D2CC99D042FF80" TYPE="ntfs" PARTUUID="820f8270-05"
/dev/sdc6: UUID="78bbfedf-8498-40ae-b6c0-735a2fcb43a7" TYPE="ext4" PARTUUID="820f8270-06"
/dev/sdc7: UUID="6f7bd56f-78e7-491f-80ab-2b4b35b75572" TYPE="swap" PARTUUID="820f8270-07"

Thaks

Dai_trying
Posts: 1101
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Grub

#10 Post by Dai_trying »

Your debian installation must be on either sdc1 or sdc6, so, if you are already booted into the debian installation you could install grub to /dev/sdc (without a number) this should put it in the mbr to allow it to load in any machine, BUT you must check how the disks are labelled immediately before you do this in case it reads a different structure for the disks (which can happen sometimes).

To check the current disk structure when in debian type df which will give you some mounted file system info, look for the root partition (the one mounted on "/" and take note of the /dev/sd?? at the beginning of that line,
if it is /dev/sda? then issue the install grub command to /dev/sda, (sudo grub-install /dev/sda)
if it is /dev/sdb? then issue the install grub command to /dev/sdb, (sudo grub-install /dev/sdb)
etc...

babak
Posts: 19
Joined: 2011-05-23 09:31

Re: Grub

#11 Post by babak »

Hi again

The system is installed on sdc1 and the /home on sdc6.
Installing grub on sdc1 does not work as I mentioned before.
Installing grub on sdc (without any number ) worked. it says "installed with no error" but when I boot on usb nothing happens.

thanks again

Dai_trying
Posts: 1101
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Grub

#12 Post by Dai_trying »

babak wrote:Installing grub on sdc (without any number ) worked. it says "installed with no error" but when I boot on usb nothing happens.
Does that mean the machine doesn't switch on? Or it boots to the normal OS? Or does it say it cannot find grub? Or does it boot into grub recovery mode? Or does it boot grub and fail to find the debian installation? Or .....

There are many possible failures and we would need to know how it failed to be able to help.

babak
Posts: 19
Joined: 2011-05-23 09:31

Re: Grub

#13 Post by babak »

Dai_trying

The machine boots normally on Windows - internal disque - as if no system is installed on usb disque.

Dai_trying
Posts: 1101
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Grub

#14 Post by Dai_trying »

Have you enabled booting from usb? usually in the bios settings, and also you might need to adjust the boot order putting the usb device higher than your Hdd.
You might be able to select usb at boot time by pressing F12 (bios boot menu), but that does not always work as expected, but if you can select it from there it should boot ok.

babak
Posts: 19
Joined: 2011-05-23 09:31

Re: Grub

#15 Post by babak »

That is the first thing I did. :D

Dai_trying
Posts: 1101
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Grub

#16 Post by Dai_trying »

Can you select the usb from the F12 prompt?

babak
Posts: 19
Joined: 2011-05-23 09:31

Re: Grub

#17 Post by babak »

I can.

Usb is the first choice of the boot, but the pc simply ignores it.

Thanks

Dai_trying
Posts: 1101
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Grub

#18 Post by Dai_trying »

The only thing I can think of is that your external usb device is not bootable, I have used the methods I posted for my own external drive and it works as expected, although I gave up using it as a "portable system" as I did not manage to get it set up for both uefi and mbr booting.

babak
Posts: 19
Joined: 2011-05-23 09:31

Re: Grub

#19 Post by babak »

Thank you anyway.

peer
Posts: 449
Joined: 2017-03-26 10:14
Has thanked: 8 times
Been thanked: 22 times

Re: Grub

#20 Post by peer »

You can check with qparted if you usb device has bootflag

Post Reply