List Info

Thread: Drive asignments for sata drives




Drive asignments for sata drives
country flaguser name
Singapore
2007-03-12 11:39:25
Hi again,

Is there a way to fix the drive assignment for sata drives?

Currently in the fstab the boot and root partitions are set
and working 
great. Once a new sata drive connected, the drive
assignments change. 
Initially the / (root) is /dev/sda2. Once another sata drive
is added 
the / (root) becomes say /dev/sdb2.

Is there any way that this can be fixed even when more
drives are added 
or removed?

P.V.Anthony
-- 
gentoo-amd64gentoo.org mailing list


Re: Drive asignments for sata drives
user name
2007-03-12 12:00:09
P.V.Anthony, mused, then expounded:
> 
> Currently in the fstab the boot and root partitions are
set and working 
> great. Once a new sata drive connected, the drive
assignments change. 
> Initially the / (root) is /dev/sda2. Once another sata
drive is added 
> the / (root) becomes say /dev/sdb2.
> 
> Is there any way that this can be fixed even when more
drives are added 
> or removed?
>

Typically, on the same controller, the lowest numbered port
becomes the
first drive.  The description of the symptom leads me to
believe that
your /dev/sda drive is attached to port 2 instead of being
attached to
port 1.  Have you tried moving your SATA cable to a
different port?

Bob 
-  
-- 
gentoo-amd64gentoo.org mailing list


Re: Drive asignments for sata drives
country flaguser name
United Kingdom
2007-03-12 12:11:03
On Monday 12 March 2007 17:00:09 Bob Sanders wrote:
> P.V.Anthony, mused, then expounded:
> > Currently in the fstab the boot and root
partitions are set and working
> > great. Once a new sata drive connected, the drive
assignments change.
> > Initially the / (root) is /dev/sda2. Once another
sata drive is added
> > the / (root) becomes say /dev/sdb2.
> >
> > Is there any way that this can be fixed even when
more drives are added
> > or removed?
>
> Typically, on the same controller, the lowest numbered
port becomes the
> first drive.  The description of the symptom leads me
to believe that
> your /dev/sda drive is attached to port 2 instead of
being attached to
> port 1.  Have you tried moving your SATA cable to a
different port?
>
I had the same problem and despite my existing drive being
connected to what 
was labelled on the motherboard as SATA1 it in fact was not!
Trial and error 
gave me the correct one... It would be useful if the nodes
were more fixed 
but most systems do not change after initial set up and this
situation can be 
fixed quite easily.
Re: Drive asignments for sata drives
country flaguser name
United States
2007-03-12 12:21:57
On Mon, Mar 12, 2007 at 05:11:03PM +0000, Marcus D. Hanwell
wrote:
> I had the same problem and despite my existing drive
being connected to what 
> was labelled on the motherboard as SATA1 it in fact was
not! Trial and error 
> gave me the correct one... It would be useful if the
nodes were more fixed 
> but most systems do not change after initial set up and
this situation can be 
> fixed quite easily.

It's worth noting that the "correct" way to do
this is now with fs
labels or UUIDs.  Personally, I use LVM for everything but
boot/root/swap, and that uses UUIDs internally, so I don't
have much
issue (it would be sweet if Gentoo could easily boot from
LVM, but that
requires an initrd).

Anyway, I'm not too sure how to indicate a UUID to the
kernel for its
root fs.  There's a RedHat kernel patch that allows you to
specify e.g.,
'root=LABEL=myroot' on the kernel cmdline, but I'm not sure
if that's
available in the stock Gentoo kernel, or if it supports
UUIDs.

You can use 'LABEL=foo' or UUID='fooo-ooo-ooo..' in
/etc/fstab, though.

Dustin
-- 
gentoo-amd64gentoo.org mailing list


Re: Drive asignments for sata drives
country flaguser name
United States
2007-03-12 12:42:08
P.V.Anthony wrote:
> Is there a way to fix the drive assignment for sata
drives?
>
> Currently in the fstab the boot and root partitions are
set and 
> working great. Once a new sata drive connected, the
drive assignments 
> change. Initially the / (root) is /dev/sda2. Once
another sata drive 
> is added the / (root) becomes say /dev/sdb2.
>
> Is there any way that this can be fixed even when more
drives are 
> added or removed?
Use disk labels to symbolically name partitions so that you
don't need 
to use explicit special device names.

`tune2fs -L <label name>' adds a disk label to a
partition (at least for 
ext2/3 file systems).

Then in /etc/fstab use entries along these lines (assuming
you've 
labeled the boot partition 'BOOT' and the root partition
'ROOT'...) :

#------------------- (example) -----------------

LABEL=BOOT        /boot    ext2    defaults    0 2
LABEL=ROOT        /        ext3    defaults    0 1

LABEL=fortknox    /precious_data   ext3   defaults,ro   0 1

# use LABELs for pluggable media since the special devices
may change
# MS DOS disk labels must be 11 characters and all upper
case
LABEL=Backup            /mnt/Backup             auto    
defaults,users,noauto   0 0

#------------------ (/example) -----------------


I'd guess that there are ways to add labels to non-ext2/3
file systems 
(reiserfs, xfs, ...) but I haven't tried.

As always: read `man tune2fs' and `man mount'.

BobS

PS. This isn't an amd64 issue.


-- 
gentoo-amd64gentoo.org mailing list


Re: Drive asignments for sata drives
user name
2007-03-12 12:50:13
Bob Slawson, mused, then expounded:
> 
> 
> I'd guess that there are ways to add labels to
non-ext2/3 file systems 
> (reiserfs, xfs, ...) but I haven't tried.
>

xfs_admin -L <label>

man xfs_admin

Bob 
-  
-- 
gentoo-amd64gentoo.org mailing list


Re: Drive asignments for sata drives
country flaguser name
Austria
2007-03-12 12:53:09
Am Montag 12 März 2007 schrieb Marcus D. Hanwell:
> On Monday 12 March 2007 17:00:09 Bob Sanders wrote:
> > P.V.Anthony, mused, then expounded:
> > > Currently in the fstab the boot and root
partitions are set and working
> > > great. Once a new sata drive connected, the
drive assignments change.
> > > Initially the / (root) is /dev/sda2. Once
another sata drive is added
> > > the / (root) becomes say /dev/sdb2.
> > >
> > > Is there any way that this can be fixed even
when more drives are added
> > > or removed?
> >
> > Typically, on the same controller, the lowest
numbered port becomes the
> > first drive.  The description of the symptom leads
me to believe that
> > your /dev/sda drive is attached to port 2 instead
of being attached to
> > port 1.  Have you tried moving your SATA cable to
a different port?
>
> I had the same problem and despite my existing drive
being connected to
> what was labelled on the motherboard as SATA1 it in
fact was not! Trial and
> error gave me the correct one... It would be useful if
the nodes were more
> fixed but most systems do not change after initial set
up and this
> situation can be fixed quite easily.

Another way would be to use udev and the partitions uuid to
mount the 
partition.

With

-> udevinfo --query=all --root --name sdb2 | grep uuid

you get the uuid of the partition (in this case sda1). The
output looks like:

-> S: disk/by-uuid/24034503-e89e-4e6d-96b6-5dbc2e9b83cf

Then you can mount the drive by simply typing (with the
output that gives you 
the command above on your machine)

-> mount UUID=24034503-e89e-4e6d-96b6-5dbc2e9b83cf
/mnt_point

or adding a line like

-> UUID=3f465a84-8eac-4207-aeb6-b9178329af4f /mnt_point
your_fs your_opts 0 2

to your fstab

With this solution the drives(partitions) should always be
mounted at the same 
mount point, no matter at which controller it is attached
physically.

rgds
Bernhard
--
gentoo-amd64gentoo.org mailing list


Re: Drive asignments for sata drives
country flaguser name
United Kingdom
2007-03-12 13:16:13
On Monday 12 March 2007 17:21:57 dustinv.igoro.us wrote:
> On Mon, Mar 12, 2007 at 05:11:03PM +0000, Marcus D.
Hanwell wrote:
> > I had the same problem and despite my existing
drive being connected to
> > what was labelled on the motherboard as SATA1 it
in fact was not! Trial
> > and error gave me the correct one... It would be
useful if the nodes were
> > more fixed but most systems do not change after
initial set up and this
> > situation can be fixed quite easily.
>
> It's worth noting that the "correct" way to
do this is now with fs
> labels or UUIDs.  Personally, I use LVM for everything
but
> boot/root/swap, and that uses UUIDs internally, so I
don't have much
> issue (it would be sweet if Gentoo could easily boot
from LVM, but that
> requires an initrd).
>
> Anyway, I'm not too sure how to indicate a UUID to the
kernel for its
> root fs.  There's a RedHat kernel patch that allows you
to specify e.g.,
> 'root=LABEL=myroot' on the kernel cmdline, but I'm not
sure if that's
> available in the stock Gentoo kernel, or if it supports
UUIDs.
>
> You can use 'LABEL=foo' or UUID='fooo-ooo-ooo..' in
/etc/fstab, though.
>
I haven't encountered this before, but I thought the labels
must have some 
use! That is certainly useful although I am now using
RAID0/1/5 (depending up 
on partition) along with LVM2 and so they take care of most
of this.

The main issue I see is the root= line in grub (or whatever
you use) as I am 
guessing from other posts this doesn't work. I don't think
it matters too 
much for me now as that is a RAID5 partition too.

In this age of SATA drives using labels, uuids etc is
probably the way to go 
as my system fell flat on its face when I put a new drive
in. Anyone know if 
the Gentoo kernel can boot using a label? Back to work
anyway... Busy, busy, 
busy...
Re: Re: Drive asignments for sata drives
country flaguser name
Singapore
2007-03-13 04:08:02
Bernhard Auzinger wrote:
> Am Montag 12 März 2007 schrieb Marcus D. Hanwell:
>> On Monday 12 March 2007 17:00:09 Bob Sanders
wrote:
>>> P.V.Anthony, mused, then expounded:
>>>> Currently in the fstab the boot and root
partitions are set and working
>>>> great. Once a new sata drive connected, the
drive assignments change.
>>>> Initially the / (root) is /dev/sda2. Once
another sata drive is added
>>>> the / (root) becomes say /dev/sdb2.
>>>>
>>>> Is there any way that this can be fixed
even when more drives are added
>>>> or removed?
>>> Typically, on the same controller, the lowest
numbered port becomes the
>>> first drive.  The description of the symptom
leads me to believe that
>>> your /dev/sda drive is attached to port 2
instead of being attached to
>>> port 1.  Have you tried moving your SATA cable
to a different port?
>> I had the same problem and despite my existing
drive being connected to
>> what was labelled on the motherboard as SATA1 it in
fact was not! Trial and
>> error gave me the correct one... It would be useful
if the nodes were more
>> fixed but most systems do not change after initial
set up and this
>> situation can be fixed quite easily.
> 
> Another way would be to use udev and the partitions
uuid to mount the 
> partition.
> 
> With
> 
> -> udevinfo --query=all --root --name sdb2 | grep
uuid
> 
> you get the uuid of the partition (in this case sda1).
The output looks like:
> 
> -> S:
disk/by-uuid/24034503-e89e-4e6d-96b6-5dbc2e9b83cf
> 
> Then you can mount the drive by simply typing (with the
output that gives you 
> the command above on your machine)
> 
> -> mount UUID=24034503-e89e-4e6d-96b6-5dbc2e9b83cf
/mnt_point
> 
> or adding a line like
> 
> -> UUID=3f465a84-8eac-4207-aeb6-b9178329af4f
/mnt_point your_fs your_opts 0 2
> 
> to your fstab
> 
> With this solution the drives(partitions) should always
be mounted at the same 
> mount point, no matter at which controller it is
attached physically.
> 
> rgds
> Bernhard

Thanks to all who have responded to this email. The
information sent 
have solved my problems with the sata drives. I am very
happy.

For the record, I have used the above solution and it is
working great.

I hope one day grub will allow
"root=UUID=something" then the problem is 
completely solved.

I am very happy. Thank you all very much for helping.

P.V.Anthony

-- 
gentoo-amd64gentoo.org mailing list


Re: Re: Drive asignments for sata drives
country flaguser name
United Kingdom
2007-03-13 12:31:44
On Tuesday 13 March 2007 14:06:22 dustinv.igoro.us wrote:
> On Tue, Mar 13, 2007 at 05:08:02PM +0800, P.V.Anthony
wrote:
> > I hope one day grub will allow
"root=UUID=something" then the problem
> > is completely solved.
>
> Not to be picky, but it's the kernel that parses that
command line --
> grub just supplies it to the kernel.

Are you sure? It seems to me that the "root="
parameter is to grub, to tell 
it where to find the kernel to which to pass the remaining
arguments.

-- 
Rgds
Peter Humphrey
Linux Counter 5290, Aug 93
-- 
gentoo-amd64gentoo.org mailing list


[1-10] [11-16]

about | contact  Other archives ( Real Estate discussion Medical topics )