FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 07-21-2011, 05:41 PM
Daniele Guerrieri
 
Default Ubuntu - disk management behaviour

Hi people,

have you ever noticed strange behaviours with grub2 and usb key?

I've got an acer ao5320h netbook, and
If, for example, the scsi disk is on /dev/sda, and root partition in
/dev/sda7, when i plug in a usb key the key is under /dev/sdb.

But if i boot from usb, the usb key becomes /dev/sda, and the first
disk becomes /dev/sdb.

So grub2, in which disk references are made of /dev/sd[xn] ,behaves weirdly.

So, does ubuntu rely on UUID or /dev/sdxn?


Thanks,
Daniele

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-21-2011, 05:50 PM
Tom H
 
Default Ubuntu - disk management behaviour

On Thu, Jul 21, 2011 at 1:41 PM, Daniele Guerrieri
<d.guerrieri@gmail.com> wrote:
>
> have you ever noticed strange behaviours with grub2 and usb key?
>
> I've got an acer ao5320h netbook, and
> If, for example, the scsi disk is on /dev/sda, and root partition in
> /dev/sda7, when i plug in a usb key the key is under /dev/sdb.
>
> But if i boot from usb, the usb key becomes /dev/sda, and the first
> disk becomes /dev/sdb.
>
> So grub2, in which disk references are made of /dev/sd[xn] ,behaves weirdly.
>
> So, does ubuntu rely on UUID or /dev/sdxn?

Which release of Ubuntu are you using?

In recent releases, grub's used "/dev/disk/by-id/" rather than "/dev/"
to define grub devices.

The fact that you can boot from your HD or from your USB even though
they're named differently shows that Ubuntu doesn't care about the
"/dev/" names, doesn't it?

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-21-2011, 05:57 PM
"Goh Lip"
 
Default Ubuntu - disk management behaviour

On Fri, 22 Jul 2011 01:41:21 +0800, Daniele Guerrieri
<d.guerrieri@gmail.com> wrote:



Hi people,

have you ever noticed strange behaviours with grub2 and usb key?

I've got an acer ao5320h netbook, and
If, for example, the scsi disk is on /dev/sda, and root partition in
/dev/sda7, when i plug in a usb key the key is under /dev/sdb.

But if i boot from usb, the usb key becomes /dev/sda, and the first
disk becomes /dev/sdb.

So grub2, in which disk references are made of /dev/sd[xn] ,behaves
weirdly.


So, does ubuntu rely on UUID or /dev/sdxn?


Thanks,
Daniele



Yes, that's how it is, but that is due to the bios rather than grub and
that's why the grub2 menu entries always use uuid so the boot is always
correct (unless you manually modify it to /dev/sdxy and (hdx,y), which you
shouldn't). But if want to manually modify, use uuid or label.


And by the way, it has always been like that way before grub2, which
necessitates the need to manually modify to boot correctly (before grub2).


Regards - Goh Lip

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-22-2011, 04:58 AM
Daniele Guerrieri
 
Default Ubuntu - disk management behaviour

@Tom
> Which release of Ubuntu are you using?
11.04

> In recent releases, grub's used "/dev/disk/by-id/" rather than "/dev/"
> to define grub devices.
ok

> The fact that you can boot from your HD or from your USB even though
> they're named differently shows that Ubuntu doesn't care about the
> "/dev/" names, doesn't it?

yes, my bad
in fact i was confused, but also an usb live key needs to be bootable
when the drive letter changes (once sda, another time sdb), probably
in the boot loader installed onto usb key there's uuid too;

But if i look in grub.cfg i see:
. set root='(/dev/sdb, msdos1)'
. search --no-floppy --fs-uuid --set=root a47791f4-e9e2-47be-9f64-348573fe2796

Why does set root before searching with uuid?

@Goh
>Yes, that's how it is, but that is due to the bios rather than grub and that's why the grub2 >menu entries always use uuid so the boot is always correct (unless you manually modify it >to /dev/sdxy and (hdx,y), which you shouldn't). But if want to manually modify, use uuid or >label.
Ok, The uuid does not change if external changes occur, isn't it?

For example, if i had boot partition on sda7, then i decided to remove
sda2 (should i do it from a "live" usb system or may i do it from the
"installed" system itself? i think it's better not to reorder
partitions while running, or at least partprobe won't return 0, am i
correct?), and subsequently i fixed partition order, the boot
partition would become sda6; in this case, the uuid will remain the
same so that i wouldn't have boot issues?

>Regards - Goh Lip

Thank you both for the answers!

Daniele

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 07-22-2011, 05:25 AM
"Goh Lip"
 
Default Ubuntu - disk management behaviour

On Fri, 22 Jul 2011 12:58:34 +0800, Daniele Guerrieri
<d.guerrieri@gmail.com> wrote:



yes, my bad
in fact i was confused, but also an usb live key needs to be bootable
when the drive letter changes (once sda, another time sdb), probably
in the boot loader installed onto usb key there's uuid too;
But if i look in grub.cfg i see:
. set root='(/dev/sdb, msdos1)'
. search --no-floppy --fs-uuid --set=root
a47791f4-e9e2-47be-9f64-348573fe2796

Why does set root before searching with uuid?


Good question! To help with this, let me start by saying you can remove
this line "set root='(/dev/sdb, msdos1)'" and it will boot okay. In fact
you can even use the wrong partition number, say in this example,
'(/dev/sdb, msdos2)' or '(/dev/sdb, msdos3)' and it will still boot okay
*as long* as the "search --no-floppy --fs-uuid --set=root xxxxxxx" line is
below it. So if your bios gives it the wrong (/dev/sdx, msdosy), it will
still boot okay. I hope this explains why you will still boot okay with
grub2 as long as the search line uses uuid or label.


By the way I uses my own grub (grub2) and it never contains the "set
root='(/dev/sdx, msdosy)" line.





@Goh
Yes, that's how it is, but that is due to the bios rather than grub and
that's why the grub2 >menu entries always use uuid so the boot is
always correct (unless you manually modify it >to /dev/sdxy and
(hdx,y), which you shouldn't). But if want to manually modify, use uuid
or >label.

Ok, The uuid does not change if external changes occur, isn't it?
For example, if i had boot partition on sda7, then i decided to remove
sda2 (should i do it from a "live" usb system or may i do it from the
"installed" system itself? i think it's better not to reorder
partitions while running, or at least partprobe won't return 0, am i
correct?), and subsequently i fixed partition order, the boot
partition would become sda6; in this case, the uuid will remain the
same so that i wouldn't have boot issues?


Doing the above (removing sda2) will not change the uuid for sda7, so it
will boot alright. Furthermore, (but I don't think that's relevent for
this discussion of grub/booting), sda7 will remain sda7 (not sda6) even if
you remove sda2, you'll just have a missing sda2! UUID will not change
even with resizing the partition (though I think it not wise as the first
sector may be corrupted and it takes a long time); UUID only changes with
deleting/creating a new partition.


Hope this helps.
Regards - Goh Lip



Thank you both for the answers!


You're welcome.


--
I used to have an open mind,
but my brains kept falling out.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 09:32 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org