Re: The order of my SATA and PATA are switching all the time

2013-06-03 Thread Stefan Monnier
> As I've said several times, it's UUID or LABEL.  Period.

And then there's LVM.  I recommend LVM as the solution to this problem
because contrary to the UUID the name can be meaningful, and contrary to
the LABEL, the LVM volume names don't depend on the kind of file-system
you use.  Also those labels are a lot more "in your face" than
filesystem labels, so they're much easier to find, and they all have
a name.


Stefan


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/jwv61xvyr8j.fsf-monnier+gmane.linux.debian.u...@gnu.org



Re: The order of my SATA and PATA are switching all the time

2013-05-07 Thread Jonathan Dowland
Use either partition labels or UUIDs when specifying block devices
in e.g. /etc/fstab.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130507091507.GA20902@debian



Re: The order of my SATA and PATA are switching all the time

2013-05-07 Thread Stephen Powell
On Mon, 06 May 2013 23:28:01 -0400 (EDT), Tong wrote:
> 
> Recently I added an old PATA HD to my system, which previously consist of 
> two SATA HDs. Ever since then, the order of my SATA and PATA are keep 
> switching. 

This problem, and its solution, are discussed at length on my LILO web
page, starting with the discussion of the "boot" configuration file record.

   http://users.wowway.com/~zlinuxman/lilo.htm

Basically, use udev-created symbolic links in /etc/fstab,
/etc/initramfs/conf.d/resume, and your boot loader.

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/1030437225.1052412.1367927724168.javamail.r...@md01.wow.synacor.com



Re: The order of my SATA and PATA are switching all the time

2013-05-07 Thread Stephen Powell
On Tue, 07 May 2013 07:55:24 -0400 (EDT), Stephen Powell wrote:
> 
> Basically, use udev-created symbolic links in /etc/fstab,
> /etc/initramfs/conf.d/resume, and your boot loader.

Oops!  I meant to say /etc/initramfs-tools/conf.d/resume,
not /etc/initramfs/conf.d/resume.

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/72450583.1065595.1367968238094.javamail.r...@md01.wow.synacor.com



Re: The order of my SATA and PATA are switching all the time

2013-05-07 Thread T o n g
On Tue, 07 May 2013 07:55:24 -0400, Stephen Powell wrote:

>> Recently I added an old PATA HD to my system, which previously consist
>> of two SATA HDs. Ever since then, the order of my SATA and PATA are
>> keep switching.
> 
> This problem, and its solution, are discussed at length on my LILO web
> page, starting with the discussion of the "boot" configuration file
> record.
> 
>http://users.wowway.com/~zlinuxman/lilo.htm

Indeed!

> Basically, use udev-created symbolic links in /etc/fstab,
> /etc/initramfs-tools/conf.d/resume, and your boot loader.

"The solution to this problem is to use a udev-created symbolic link.  In 
the example configuration file above, /dev/disk/by-id/ata-IBM-
DBCA-203240_HP0HPL43952 is a udev-created symbolic link to the MBR of the 
(normal) boot drive, regardless of which driver is used for IDE hard disks 
and regardless of how many disk drives are in the system, the order in 
which they are discovered, or what the boot device is.  "

That's a good suggestion, but I noticed that the example you gave has:

boot=/dev/disk/by-id/ata-IBM-DBCA-203240_HP0HPL43952
root="UUID=04db5929-51e6-424a-ac5b-a592b96b9d04"

I.e., they are not using the same thing. As said before, it is not that I 
can't boot, I can always boot just fine, but half of the time the boot 
process will drop to "(initramfs)" PANIC mode. I.e., it is always the 
"root=" boot option that give me the trouble, yet, I don't like using UUID, 
because, just as you said: 

"Warning: reformatting a partition normally changes the uuid, unless the 
existing uuid is explicitly specified as an option when formatting.  Thus, 
commands such as mkfs (and its derivatives) and mkswap will normally 
change the uuid, which in turn will change the udev-created symbolic link 
in /dev/disk/by-uuid, which in turn may necessitate changes to /etc/
lilo.conf. "

Can I use something like root="ID=ata-IBM-DBCA-203240_HP0HPL43952"? I 
remember nothing worked well, so I reverted to the (now troublesome) 
"safe" /dev/sdXn.

Thanks



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/kmcgpe$737$2...@ger.gmane.org



Re: The order of my SATA and PATA are switching all the time

2013-05-08 Thread Tom Furie
On Wed, May 08, 2013 at 03:28:47AM +, T o n g wrote:

> Can I use something like root="ID=ata-IBM-DBCA-203240_HP0HPL43952"? I 
> remember nothing worked well, so I reverted to the (now troublesome) 
> "safe" /dev/sdXn.
 
I think the idea is to replace /dev/sdXn with e.g.
/dev/disk/by-id/ata-IBM-DBCA-203240_HP0HPL43952-part1

Cheers,
Tom

-- 
I find this corpse guilty of carrying a concealed weapon and I fine it $40.
-- Judge Roy Bean, finding a pistol and $40 on a man he'd
   just shot.


signature.asc
Description: Digital signature


Re: The order of my SATA and PATA are switching all the time

2013-05-08 Thread Stephen Powell
On Tue, 07 May 2013 23:28:47 -0400 (EDT), Tong wrote:
> 
> On Tue, 07 May 2013 07:55:24 -0400, Stephen Powell wrote:
>> 
>> This problem, and its solution, are discussed at length on my LILO web
>> page, starting with the discussion of the "boot" configuration file
>> record.
>> 
>>http://users.wowway.com/~zlinuxman/lilo.htm
> 
> Indeed!
> 
> "The solution to this problem is to use a udev-created symbolic link.  In 
> the example configuration file above, /dev/disk/by-id/ata-IBM-
> DBCA-203240_HP0HPL43952 is a udev-created symbolic link to the MBR of the 
> (normal) boot drive, regardless of which driver is used for IDE hard disks 
> and regardless of how many disk drives are in the system, the order in 
> which they are discovered, or what the boot device is.  "
> 
> That's a good suggestion, but I noticed that the example you gave has:
> 
>boot=/dev/disk/by-id/ata-IBM-DBCA-203240_HP0HPL43952
>root="UUID=04db5929-51e6-424a-ac5b-a592b96b9d04"
> 
> I.e., they are not using the same thing.

Of course not!  The "boot" configuration file record points to the Master
Boot Record in the above example.  The "root" configuration file record
points to a particular partition on the hard disk which has an ext2/ext3
file system on it.  They are not the same.  They are not supposed to be
the same.  I think you have some conceptual errors in your mind that you
need to resolve.
> 
> As said before, it is not that I 
> can't boot, I can always boot just fine, but half of the time the boot 
> process will drop to "(initramfs)" PANIC mode. I.e., it is always the 
> "root=" boot option that give me the trouble, yet, I don't like using UUID, 
> because, just as you said: 
> 
> "Warning: reformatting a partition normally changes the uuid, unless the 
> existing uuid is explicitly specified as an option when formatting.  Thus, 
> commands such as mkfs (and its derivatives) and mkswap will normally 
> change the uuid, which in turn will change the udev-created symbolic link 
> in /dev/disk/by-uuid, which in turn may necessitate changes to /etc/
> lilo.conf. "
> 
> Can I use something like root="ID=ata-IBM-DBCA-203240_HP0HPL43952"? I 
> remember nothing worked well, so I reverted to the (now troublesome) 
> "safe" /dev/sdXn.

/dev/sdXn is *not* safe.  That's the whole point.  If your boot loader is LILO,
the only "safe" root file system specifications are one of these two forms:

   root="UUID=..."
   root="LABEL=..."

You must refer to the root file system by its uuid or by its disk label, if
there is one.  Yes, reformatting a partition will normally change the uuid
and label, unless the old uuid and label are explicitly specified when
formatting.  But that's under your control.  And this is something that does
not change from one boot to the next.  Device assignments can.  Make sure
that you use this technique in your boot loader configuration file, /etc/fstab,
and /etc/initramfs-tools/conf.d/resume.  (/etc/initramfs-tools/conf.d/resume
is going to point to a swap partition.)  If you have to change
/etc/initramfs-tools/conf.d/resume, you must rebuild your initial RAM file
system afterwards, since this file is included in the initial RAM file system.

   update-initramfs -uk $(uname -r)

And obviously, if you change your boot loader configuration file, such as
/etc/lilo.conf, you must rerun your boot loader installer afterwards.

   lilo
 
-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/824048839.1073721.1368016857669.javamail.r...@md01.wow.synacor.com



Re: The order of my SATA and PATA are switching all the time

2013-05-08 Thread T o n g
On Wed, 08 May 2013 08:40:57 -0400, Stephen Powell wrote:

>> Can I use something like root="ID=ata-IBM-DBCA-203240_HP0HPL43952"? I
>> remember nothing worked well, so I reverted to the (now troublesome)
>> "safe" /dev/sdXn.
> 
> /dev/sdXn is *not* safe.  That's the whole point.

If you read my message again, you will realize that /dev/sdXn was not my 
first choice but a settled down one, because I tried root="ID=ata-IBM-
DBCA-203240_HP0HPL43952" etc, but nothing worked. 

All I was asking is what the working *syntax* for the root="ID=ata-IBM-
DBCA-203240_HP0HPL43952" part. 



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/kmetm9$88h$1...@ger.gmane.org



Re: The order of my SATA and PATA are switching all the time

2013-05-08 Thread Bob Proulx
T o n g wrote:
> I don't like using UUID, because, just as you said: 
> 
> "Warning: reformatting a partition normally changes the uuid, unless the 
> existing uuid is explicitly specified as an option when formatting.  Thus, 
> commands such as mkfs (and its derivatives) and mkswap will normally 
> change the uuid, which in turn will change the udev-created symbolic link 
> in /dev/disk/by-uuid, which in turn may necessitate changes to /etc/
> lilo.conf. "

If the system is reformatted then the uuid usually changes, true.  But
if the system is reformatted then you don't usually care because the
entire world has changed.

> Can I use something like root="ID=ata-IBM-DBCA-203240_HP0HPL43952"? I 
> remember nothing worked well, so I reverted to the (now troublesome) 
> "safe" /dev/sdXn.

The ugliness of UUIDs is one of the things that makes using LVM look
better.  LVM uses UUIDs but keeps them internal so the user doesn't
see them.

  $ cat /proc/cmdline
  root=/dev/mapper/vg0-root ro 

And in case your question wasn't answered here is an example using
UUIDs for reference.

  $ cat /proc/cmdline
  root=UUID=aa136237-007c-94b1-a35e-080c409a800e ro 

Bob


signature.asc
Description: Digital signature


Re: The order of my SATA and PATA are switching all the time

2013-05-08 Thread Stefan Monnier
> Anyone know the cure? 

I see many people suggested UUIDs and other funny long names.
What I use instead: LVM.  This way you get to name the "disks" and
"partitions" with meaningful names which only change when you decide to
change them.


Stefan


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/jwv61ysbvyw.fsf-monnier+gmane.linux.debian.u...@gnu.org



Re: The order of my SATA and PATA are switching all the time

2013-05-08 Thread st

Stefan Monnier wrote:


I see many people suggested UUIDs and other funny long names.
What I use instead: LVM.  This way you get to name the "disks" and
"partitions" with meaningful names which only change when you decide to
change them.


One simple question, though: if you have 2 similar HDDs and one
of them starts to fail, how do you know which one it is?

It's turned into quite an issue for me since Debian stopped
assigning disk names in a predictable way.

--
Best nightdreams.
Serge Tiunov,   "Do you really think you think
http://e-head.net   when you do think you do?"


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/518b2fae.3010...@kem.ru



Re: The order of my SATA and PATA are switching all the time

2013-05-08 Thread Bob Proulx
st wrote:
> Stefan Monnier wrote:
> > I see many people suggested UUIDs and other funny long names.  What I
> > use instead: LVM.  This way you get to name the "disks" and
> > "partitions" with meaningful names which only change when you decide
> > to change them.
>
> One simple question, though: if you have 2 similar HDDs and one
> of them starts to fail, how do you know which one it is?

I assume you mean which physical disk is which?

There are useful tools hdparm, smartctl, blkid, lsblk and probably
others too.

  # hdparm -I /dev/sda
  ...
Model Number:   ST340014A   
Serial Number:  5JXC6GK4

  # smartctl -i /dev/sda
  Model Family: Seagate Barracuda 7200.7 and 7200.7 Plus family
  Device Model: ST340014A
  Serial Number:5JXC6GK4

  # smartctl -l error /dev/sda
  ...
  No Errors Logged

Or it might say that is has logged errors.  In either case you can now
write down the model and serial number of the disk drives both working
and giving errors.  Then when you open the box up to replace it you
will be able to know which one is good and which one is bad.

If you were asking how do you map from lvm names to physical names
then that is through the pvs and pvdisplay commands.

  # pvs
PV VG   Fmt  Attr PSize  PFree
/dev/sda5  vg0  lvm2 a-   36.77g0 

So for that example vg0 has a single /dev/sda5 partition.  If you are
using raid it will look like this:

  # pvs
PV VG   Fmt  Attr PSize   PFree  
/dev/md1   v1   lvm2 a--  232.83g   8.90g
/dev/md2   v1   lvm2 a--  298.02g  16.26g
/dev/md3   v1   lvm2 a--  400.18g 168.89g

Then to map from /dev/mdX devices use mdadm --detail.

  # mdadm --detail /dev/md1
Number   Major   Minor   RaidDevice State
   0   850  active sync   /dev/sda5
   1   8   211  active sync   /dev/sdb5

Bob


signature.asc
Description: Digital signature


Re: The order of my SATA and PATA are switching all the time

2013-05-09 Thread st

Bob Proulx wrote:


One simple question, though: if you have 2 similar HDDs and one
of them starts to fail, how do you know which one it is?


I assume you mean which physical disk is which?

There are useful tools hdparm, smartctl, blkid, lsblk and probably
others too.

   # hdparm -I /dev/sda
   ...
 Model Number:   ST340014A
 Serial Number:  5JXC6GK4


Thanks, Bob. Still have to extract and disassemble the HDD caddy
to check serial numbers, but knowing which drive to look for
should seriously reduce downtimes.

--
Best nightdreams.
Serge Tiunov,   "Do you really think you think
http://e-head.net   when you do think you do?"


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/518b5c19.8080...@kem.ru



Re: The order of my SATA and PATA are switching all the time

2013-05-09 Thread State Angel
 fdisk also gives some disk id. 

You can also use boot script like this to static numerize your drives:

rm /dev/myhdd-0 /dev/myhdd-1
m=`cat /sys/block/sda/device/model`
if test "$m" = "HDD0MODEL"; then
    ln -s sda /dev/myhdd-0
    ln -s sdb /dev/myhdd-1
else
    ln -s sdb /dev/myhdd-0
    ln -s sda /dev/myhdd-1
fi

Then enter /dev/myhdd-0 /dev/myhdd-1 in your fstab.
-- 
Get literate, get enlighted - read Orwell's very exciting, interesting, 
beautiful novel "1984" and Fromm's anti-fascist book "Escape from Freedom".

Re: The order of my SATA and PATA are switching all the time

2013-05-09 Thread Linux-Fan
On 05/09/2013 07:10 AM, st wrote:
> Stefan Monnier wrote:
> 
>> I see many people suggested UUIDs and other funny long names.
>> What I use instead: LVM.  This way you get to name the "disks" and
>> "partitions" with meaningful names which only change when you decide to
>> change them.
> 
> One simple question, though: if you have 2 similar HDDs and one
> of them starts to fail, how do you know which one it is?

It might help to look at the disk's "path" which is mapped to the
physical ports:

~$ ls /dev/disk/by-path -l | cut -c 40-
pci-:00:1d.7-usb-0:5:1.0-scsi-0:0:0:0 -> ../../sde
pci-:00:1d.7-usb-0:5:1.0-scsi-0:0:0:1 -> ../../sdf
pci-:00:1d.7-usb-0:5:1.0-scsi-0:0:0:2 -> ../../sdg
pci-:00:1d.7-usb-0:5:1.0-scsi-0:0:0:3 -> ../../sdh
pci-:00:1d.7-usb-0:6.4:1.0-scsi-0:0:0:0 -> ../../sdi
pci-:00:1f.2-scsi-0:0:0:0 -> ../../sda
pci-:00:1f.2-scsi-0:0:0:0-part1 -> ../../sda1
pci-:00:1f.2-scsi-0:0:0:0-part2 -> ../../sda2
pci-:00:1f.2-scsi-1:0:0:0 -> ../../sdb
pci-:00:1f.2-scsi-1:0:0:0-part1 -> ../../sdb1
pci-:00:1f.2-scsi-1:0:0:0-part2 -> ../../sdb2
pci-:00:1f.2-scsi-2:0:0:0 -> ../../sdc
pci-:00:1f.2-scsi-2:0:0:0-part1 -> ../../sdc1
pci-:00:1f.2-scsi-3:0:0:0 -> ../../sdd
pci-:00:1f.2-scsi-3:0:0:0-part1 -> ../../sdd1
pci-:00:1f.2-scsi-5:0:0:0 -> ../../sr0

> It's turned into quite an issue for me since Debian stopped
> assigning disk names in a predictable way.

HTH
Linux-Fan

-- 
http://masysma.ohost.de/


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/518b8e64.8010...@web.de



Re: The order of my SATA and PATA are switching all the time

2013-05-09 Thread Tixy
On Thu, 2013-05-09 at 01:21 +, T o n g wrote:
> On Wed, 08 May 2013 08:40:57 -0400, Stephen Powell wrote:
> 
> >> Can I use something like root="ID=ata-IBM-DBCA-203240_HP0HPL43952"? I
> >> remember nothing worked well, so I reverted to the (now troublesome)
> >> "safe" /dev/sdXn.
> > 
> > /dev/sdXn is *not* safe.  That's the whole point.
> 
> If you read my message again, you will realize that /dev/sdXn was not my 
> first choice but a settled down one, because I tried root="ID=ata-IBM-
> DBCA-203240_HP0HPL43952" etc, but nothing worked. 
> 
> All I was asking is what the working *syntax* for the root="ID=ata-IBM-
> DBCA-203240_HP0HPL43952" part. 

I believe you can specify the root file system by it's UUID or label
using

  root="UUID=foo"

and 

  root="LABEL=bar"

but then you can also do that in /etc/fstab (and I also thought that's
what the Debian installer does), e.g. I have

UUID=f0d625bb-e0bf-45c0-9c11-1a697271b960 / ext4  noatime,errors=remount-ro 0

so /dev/sdX shouldn't appear anywhere. I guess this means I must have
misunderstood what the original problem was?

-- 
Tixy


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1368163479.3439.10.ca...@computer5.home



Re: The order of my SATA and PATA are switching all the time

2013-05-10 Thread Stephen Powell
On Wed, 08 May 2013 21:21:13 -0400 (EDT), Tong wrote:
> 
> All I was asking is what the working *syntax* for the
> root="ID=ata-IBM-DBCA-203240_HP0HPL43952" part.

You can't use ID with root.  With boot, you can, but not
with root.  Not if you want a driver-independent and
discover-order-independent root file system specification.
As I've said several times, it's UUID or LABEL.  Period.
It's all in the web page I referenced in my original post
on this thread.  Read the web page.  It's all there.

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/192274445.1121014.1368212220742.javamail.r...@md01.wow.synacor.com