LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Hardware (http://www.linuxquestions.org/questions/forumdisplay.php?f=18)
-   -   added a couple of new disks and now /dev/sd* disks are all messed up (http://www.linuxquestions.org/questions/showthread.php?t=4175434734)

nass 10-30-2012 06:17 AM

added a couple of new disks and now /dev/sd* disks are all messed up
 
hello everyone,
I added a couple of SATA disks in a pc that already has 11 disks.

However, since the sata ports I started using, are "presented" to the kernel earlier than some of the other SATA ports (and all the IDE ports),these new disks get the mount point names of other disks.

Instead I want to give mount point names after the existing disks. in which file of the udev should I provide the necessary rules to do that??

or is there a better way to assing alphabetical order for the /dev/sd* mount points??

thank you!

onebuck 10-30-2012 09:04 AM

Member Response
 
Hi,

You could consider 'UUID';
Quote:

NAME
uuid - DCE compatible Universally Unique Identifier library

SYNOPSIS
#include <uuid.h>

DESCRIPTION
The UUID library is used to generate unique identifiers for objects that may be accessible beyond the local system. This
library generates UUIDs compatible with those created by the Open Software Foundation (OSF) Distributed Computing Environ-
ment (DCE) utility uuidgen.

The UUIDs generated by this library can be reasonably expected to be unique within a system, and unique across all sys-
tems. They could be used, for instance, to generate unique HTTP cookies across multiple web servers without communication
between the servers, and without fear of a name clash.

CONFORMING TO
OSF DCE 1.1

AUTHOR
Theodore Y. Ts'o

AVAILABILITY
libuuid is part of the util-linux package since version 2.15.1 and is available from ftp://ftp.ker-
nel.org/pub/linux/utils/util-linux/.

SEE ALSO
uuid_clear(3), uuid_compare(3), uuid_copy(3), uuid_generate(3), uuid_is_null(3), uuid_parse(3), uuid_time(3),
uuid_unparse(3)

util-linux May 2009 UUID(3)
This way you will have a 'UUID' for each. Try: 'ls -l /dev/disk/by-uuid' to get identifiers. Then change your '/etc/fstab' to reflect the disk identification;
Quote:

ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Oct 26 07:47 02a8fbd0-77f9-4145-94e7-e3ec947f47a4 -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 26 07:47 15d48839-1a84-4534-98ad-166749141843 -> ../../sda5
lrwxrwxrwx 1 root root 10 Oct 26 07:47 56075048-6587-420d-8b85-d487004abb6b -> ../../sda6
lrwxrwxrwx 1 root root 10 Oct 26 07:47 62383ed9-0b44-4f0a-8442-d8b577d10aea -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 26 07:47 7511198c-4ec4-41eb-b5fa-0476c8ae85f1 -> ../../sda3
lrwxrwxrwx 1 root root 10 Oct 26 07:47 791d3662-dccb-4872-959b-72933368ba2e -> ../../sda8
lrwxrwxrwx 1 root root 10 Oct 26 08:18 7de50eba-660e-4538-ae54-5bac260d7947 -> ../../sdc2
lrwxrwxrwx 1 root root 10 Oct 26 07:47 803CABC83CABB814 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Oct 26 07:47 8442AA3F42AA3638 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Oct 26 08:18 9C64D17064D14DA0 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Oct 26 07:47 bcd302c6-fa2c-44dd-9a60-10e90610048f -> ../../sda9
lrwxrwxrwx 1 root root 10 Oct 26 07:47 d97d882e-aa2b-4431-a80e-42ae6a136a7a -> ../../sda7
lrwxrwxrwx 1 root root 10 Oct 26 07:47 ef08a3c2-ec35-4752-b6b3-d11fbbf321c5 -> ../../sdd1

nass 10-30-2012 09:38 AM

interesting indeed,
my uuid is a little empty

Quote:

root@stargaze:~# ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Oct 30 12:01 10EC0ADBEC0ABACC -> ../../sdl1
lrwxrwxrwx 1 root root 10 Oct 30 12:01 16cada04-1785-4692-86d3-010ffe674a34 -> ../../dm-0
lrwxrwxrwx 1 root root 9 Oct 30 12:01 3c446b8d-6c92-4cfb-b78b-130b2f6778e6 -> ../../md0
lrwxrwxrwx 1 root root 10 Oct 30 12:01 885b4e2b-7d6c-4e2f-9e86-d7410af8d40d -> ../../sdm2
lrwxrwxrwx 1 root root 9 Oct 30 14:10 9D81-D1C2 -> ../../sdn
lrwxrwxrwx 1 root root 9 Oct 30 10:08 a22a4023-8d70-4508-b9f5-4d4332e7b66b -> ../../md2
lrwxrwxrwx 1 root root 10 Oct 30 12:01 f5f201c6-32b3-45b6-a737-14880aaec8aa -> ../../sdm1
lrwxrwxrwx 1 root root 9 Oct 30 12:01 fbb28b63-4879-4dee-a435-5b99d684527b -> ../../md1
but you gave me the idea to use the /dev/disk/by-id/
which will be pretty stable. no?

onebuck 10-30-2012 10:12 AM

Member Response
 
Hi,

Yes, 'by-id' is useful.

nass 10-30-2012 10:16 AM

thanks!


All times are GMT -5. The time now is 01:54 AM.