[opensuse] HDD mount question
I have a question people might be able to help me with. openSUSE 11.3 I have two USB 750 GB external HDD attached to a LINUX server. At the moment, I have mounted /dev/sdb1 as /data1 /dev/sdc1 as /data2 If I reboot, what are the chance the drives will line up again ? How does LINUX "know" which USB port corresponds to what external HDD. I had x2 SATA Internal HDD before, where there was no doubt about mounts. It is important because I want data1 to mirror to data2. Will I have to just plug in /dev/sdb1 first then mount, and then add /dev/sdc1 next just to keep the sequence ? Andrew -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 31 of July 2010 11:58:37 Andrew Rich wrote:
I have a question people might be able to help me with.
openSUSE 11.3
I have two USB 750 GB external HDD attached to a LINUX server.
At the moment, I have mounted
/dev/sdb1 as /data1 /dev/sdc1 as /data2
If I reboot, what are the chance the drives will line up again ?
How does LINUX "know" which USB port corresponds to what external HDD.
I had x2 SATA Internal HDD before, where there was no doubt about mounts.
It is important because I want data1 to mirror to data2.
Will I have to just plug in /dev/sdb1 first then mount, and then add /dev/sdc1 next just to keep the sequence ?
Use UUIDs in /etc/fstab instead of device files, such as: UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx /data1 ext3 defaults 0 0 Use blkid to get the UUID of the filesystem you need. Alternatively, use Yast partitioner. UUIDs are a property of the filesystem, therefore don't change when the device file changes.
Andrew
Regards, Peter -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Does this mean LINUX has it already sorted for me ? /dev/disk/by-id/usb-WD_My_Passport_070A_575836314331304132333530-0:0-part1 /data1 ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0 /dev/disk/by-id/usb-WD_My_Passport_070A_575843304341394436353438-0:0-part1 /data2 ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0 Seems disk 1 and disk 2 have different ID's I looked in YAST / partioner and it is set to Mount by "Device ID" Device: /dev/sdb1 Device Path: pci-0000:00:04.1-usb-0:4:1.0-scsi-0:0:0:0-part1 Device ID 1: usb-WD_My_Passport_070A_575836314331304132333530-0:0-part1 Device: /dev/sdc1 Device Path: pci-0000:00:06.1-usb-0:2:1.0-scsi-0:0:0:0-part1 Device ID 1: usb-WD_My_Passport_070A_575843304341394436353438-0:0-part1 So I should be ok ? Will try it my marking each disk with a little text file in the root and see if I can fool LINUX ;-) Cheers Andrew ----- Original Message ----- From: <auxsvr@gmail.com> To: <opensuse@opensuse.org> Sent: Saturday, July 31, 2010 7:19 PM Subject: Re: [opensuse] HDD mount question
On Saturday 31 of July 2010 11:58:37 Andrew Rich wrote:
I have a question people might be able to help me with.
openSUSE 11.3
I have two USB 750 GB external HDD attached to a LINUX server.
At the moment, I have mounted
/dev/sdb1 as /data1 /dev/sdc1 as /data2
If I reboot, what are the chance the drives will line up again ?
How does LINUX "know" which USB port corresponds to what external HDD.
I had x2 SATA Internal HDD before, where there was no doubt about mounts.
It is important because I want data1 to mirror to data2.
Will I have to just plug in /dev/sdb1 first then mount, and then add /dev/sdc1 next just to keep the sequence ?
Use UUIDs in /etc/fstab instead of device files, such as:
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx /data1 ext3 defaults 0 0
Use blkid to get the UUID of the filesystem you need. Alternatively, use Yast partitioner.
UUIDs are a property of the filesystem, therefore don't change when the device file changes.
Andrew
Regards, Peter -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 31 of July 2010 12:31:33 Andrew Rich wrote:
Does this mean LINUX has it already sorted for me ?
/dev/disk/by-id/usb-WD_My_Passport_070A_575836314331304132333530-0:0-part1 /data1 ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/usb-WD_My_Passport_070A_575843304341394436353438-0:0-part1 /data2 ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
Seems disk 1 and disk 2 have different ID's
I looked in YAST / partioner and it is set to Mount by "Device ID"
Device: /dev/sdb1 Device Path: pci-0000:00:04.1-usb-0:4:1.0-scsi-0:0:0:0-part1 Device ID 1: usb-WD_My_Passport_070A_575836314331304132333530-0:0-part1
Device: /dev/sdc1 Device Path: pci-0000:00:06.1-usb-0:2:1.0-scsi-0:0:0:0-part1 Device ID 1: usb-WD_My_Passport_070A_575843304341394436353438-0:0-part1
So I should be ok ?
Device IDs are different from UUIDs; device IDs depend on the hard disk serial number, while a UUID is stored in the filesystem. In your case, fstab is using device IDs, which remain constant across reboots, reconnections etc. So you should be ok.
Will try it my marking each disk with a little text file in the root and see if I can fool LINUX ;-)
Cheers
Andrew
Regards, Peter -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Thank you Learnt a bit more tonight ;-) ----- Original Message ----- From: <auxsvr@gmail.com> To: <opensuse@opensuse.org> Sent: Saturday, July 31, 2010 7:58 PM Subject: Re: [opensuse] HDD mount question
On Saturday 31 of July 2010 12:31:33 Andrew Rich wrote:
Does this mean LINUX has it already sorted for me ?
/dev/disk/by-id/usb-WD_My_Passport_070A_575836314331304132333530-0:0-part1 /data1 ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/usb-WD_My_Passport_070A_575843304341394436353438-0:0-part1 /data2 ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
Seems disk 1 and disk 2 have different ID's
I looked in YAST / partioner and it is set to Mount by "Device ID"
Device: /dev/sdb1 Device Path: pci-0000:00:04.1-usb-0:4:1.0-scsi-0:0:0:0-part1 Device ID 1: usb-WD_My_Passport_070A_575836314331304132333530-0:0-part1
Device: /dev/sdc1 Device Path: pci-0000:00:06.1-usb-0:2:1.0-scsi-0:0:0:0-part1 Device ID 1: usb-WD_My_Passport_070A_575843304341394436353438-0:0-part1
So I should be ok ?
Device IDs are different from UUIDs; device IDs depend on the hard disk serial number, while a UUID is stored in the filesystem. In your case, fstab is using device IDs, which remain constant across reboots, reconnections etc. So you should be ok.
Will try it my marking each disk with a little text file in the root and see if I can fool LINUX ;-)
Cheers
Andrew
Regards, Peter -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Ah - the UUID field was turned off in the YAST partoioner display Disk 1 UUID: F00CC4480CC40C12 Disk 2 UUID: F0F22F0DF22ED79C So that is another way of doing it ;-) Cheers ----- Original Message ----- From: "Andrew Rich" <vk4tec@tech-software.net> To: <auxsvr@gmail.com>; <opensuse@opensuse.org> Sent: Saturday, July 31, 2010 7:59 PM Subject: Re: [opensuse] HDD mount question
Thank you
Learnt a bit more tonight ;-)
----- Original Message ----- From: <auxsvr@gmail.com> To: <opensuse@opensuse.org> Sent: Saturday, July 31, 2010 7:58 PM Subject: Re: [opensuse] HDD mount question
On Saturday 31 of July 2010 12:31:33 Andrew Rich wrote:
Does this mean LINUX has it already sorted for me ?
/dev/disk/by-id/usb-WD_My_Passport_070A_575836314331304132333530-0:0-part1 /data1 ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/usb-WD_My_Passport_070A_575843304341394436353438-0:0-part1 /data2 ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
Seems disk 1 and disk 2 have different ID's
I looked in YAST / partioner and it is set to Mount by "Device ID"
Device: /dev/sdb1 Device Path: pci-0000:00:04.1-usb-0:4:1.0-scsi-0:0:0:0-part1 Device ID 1: usb-WD_My_Passport_070A_575836314331304132333530-0:0-part1
Device: /dev/sdc1 Device Path: pci-0000:00:06.1-usb-0:2:1.0-scsi-0:0:0:0-part1 Device ID 1: usb-WD_My_Passport_070A_575843304341394436353438-0:0-part1
So I should be ok ?
Device IDs are different from UUIDs; device IDs depend on the hard disk serial number, while a UUID is stored in the filesystem. In your case, fstab is using device IDs, which remain constant across reboots, reconnections etc. So you should be ok.
Will try it my marking each disk with a little text file in the root and see if I can fool LINUX ;-)
Cheers
Andrew
Regards, Peter -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
In addition to device-ID and UUID, a common practice is to use your own Volume Label.
Thank you
Learnt a bit more tonight ;-)
----- Original Message ----- From: <auxsvr@gmail.com> To: <opensuse@opensuse.org> Sent: Saturday, July 31, 2010 7:58 PM Subject: Re: [opensuse] HDD mount question
On Saturday 31 of July 2010 12:31:33 Andrew Rich wrote:
Does this mean LINUX has it already sorted for me ?
/dev/disk/by-id/usb-WD_My_Passport_070A_575836314331304132333530-0:0-part1 /data1 ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/usb-WD_My_Passport_070A_575843304341394436353438-0:0-part1 /data2 ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
Seems disk 1 and disk 2 have different ID's
I looked in YAST / partioner and it is set to Mount by "Device ID"
Device: /dev/sdb1 Device Path: pci-0000:00:04.1-usb-0:4:1.0-scsi-0:0:0:0-part1 Device ID 1: usb-WD_My_Passport_070A_575836314331304132333530-0:0-part1
Device: /dev/sdc1 Device Path: pci-0000:00:06.1-usb-0:2:1.0-scsi-0:0:0:0-part1 Device ID 1: usb-WD_My_Passport_070A_575843304341394436353438-0:0-part1
So I should be ok ?
Device IDs are different from UUIDs; device IDs depend on the hard disk serial number, while a UUID is stored in the filesystem. In your case, fstab is using device IDs, which remain constant across reboots, reconnections etc. So you should be ok.
Will try it my marking each disk with a little text file in the root and see if I can fool LINUX ;-)
Cheers
Andrew
Regards, Peter
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2010-07-31 11:58, auxsvr@gmail.com wrote:
On Saturday 31 of July 2010 12:31:33 Andrew Rich wrote:
I looked in YAST / partioner and it is set to Mount by "Device ID"
Device: /dev/sdb1 Device Path: pci-0000:00:04.1-usb-0:4:1.0-scsi-0:0:0:0-part1 Device ID 1: usb-WD_My_Passport_070A_575836314331304132333530-0:0-part1
Device: /dev/sdc1 Device Path: pci-0000:00:06.1-usb-0:2:1.0-scsi-0:0:0:0-part1 Device ID 1: usb-WD_My_Passport_070A_575843304341394436353438-0:0-part1
So I should be ok ?
Device IDs are different from UUIDs; device IDs depend on the hard disk serial number, while a UUID is stored in the filesystem. In your case, fstab is using device IDs, which remain constant across reboots, reconnections etc. So you should be ok.
Don't forget labels. You can name each partition with a label, and use it. Easier to guess than that rigmarole of letters and numbers :-) fstab: LABEL=a_storage /data/storage_a xfs defaults,nofail 1 3 Another method is by "path". Ie, there are four methods: cer@Elessar:~> l /dev/disk/by- by-id/ by-label/ by-path/ by-uuid/ - -- Cheers / Saludos, Carlos E. R. (from 11.2 x86_64 "Emerald" GM (Elessar)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAkxUGAwACgkQU92UU+smfQVw+wCgj+QvUMn3ELRf32iCI6W6kJB8 6d0AnAlPNT55euofAv0+AjSoC0msIDPU =i56W -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
auxsvr@gmail.com said the following on 07/31/2010 05:19 AM:
[...]
Use blkid to get the UUID of the filesystem you need.
Neat! I knew that in the abstract but not about that tool. So I tried it out. I plugged in a couple of USB devices, oh and an old PC card, a HP 16M CompactFlash. # blkid /dev/sda1: UUID="1A0FAAE91D15AD10" TYPE="ntfs" /dev/sda2: LABEL="Data" UUID="33B0AF0B5DE740C8" TYPE="ntfs" /dev/sda4: LABEL="Boot" UUID="4319958a-2402-471e-8a57-e9fee01c90e1" TYPE="ext3" /dev/sda5: UUID="DyDHIl-nCrf-h9vE-xwKq-oe0j-9SCH-rz7Zpp" TYPE="LVM2_member" /dev/sda6: LABEL="ROOT" UUID="38ebd696-d775-4bdf-b5b5-a075dcc5872f" TYPE="ext3" /dev/sda7: LABEL="SWAP0" UUID="c474829b-5bd1-4091-b649-2287a60c3c63" TYPE="swap" [...] /dev/sdb1: SEC_TYPE="msdos" LABEL="120_CAMERA" TYPE="vfat" /dev/sdc1: SEC_TYPE="msdos" LABEL="IMAGES" UUID="ECF1-177C" TYPE="vfat" /dev/sdd: SEC_TYPE="msdos" UUID="CC73-3D1C" TYPE="vfat" It those last 3 that are interesting. The USB devices have UUIDs, the CompactFlash doesn't. -- Now let us retract the foreskin of misconception and apply the wire brush of enlightenment. --Geoff Miller, in comp.lang.perl.moderated -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2010-07-31 15:01, Anton Aylward wrote:
auxsvr@gmail.com said the following on 07/31/2010 05:19 AM:
[...]
Use blkid to get the UUID of the filesystem you need.
Neat! I knew that in the abstract but not about that tool.
Me neither. I like it - but I would like it printed the ID an path, too.
So I tried it out.
I plugged in a couple of USB devices, oh and an old PC card, a HP 16M CompactFlash.
[...] /dev/sdb1: SEC_TYPE="msdos" LABEL="120_CAMERA" TYPE="vfat" /dev/sdc1: SEC_TYPE="msdos" LABEL="IMAGES" UUID="ECF1-177C" TYPE="vfat" /dev/sdd: SEC_TYPE="msdos" UUID="CC73-3D1C" TYPE="vfat"
It those last 3 that are interesting. The USB devices have UUIDs, the CompactFlash doesn't.
Because the UUID is added by the format tool (as the label), it is optional. I suppose all modern formatting tools add it by default, but it seems the one used to create your's did not. mkdosfs - create an MS-DOS file system under Linux -i volume-id Sets the volume ID of the newly created filesystem; volume-id is a 32-bit hexadecimal number (for example, 2e24ec82). The default is a number which depends on the filesystem creation time. For some filesystem types, there are programs that can add/modify the uuid. I don't know about vfat. - -- Cheers / Saludos, Carlos E. R. (from 11.2 x86_64 "Emerald" GM (Elessar)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAkxUhGEACgkQU92UU+smfQVlSQCfVa5RFpE+k65+1g1Exfj3GRtB wSUAnAmjOfZS6TIOnA1VewUOGBHZrD3U =syLJ -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2010-07-31 15:01, Anton Aylward wrote:
auxsvr@gmail.com said the following on 07/31/2010 05:19 AM:
[...]
Use blkid to get the UUID of the filesystem you need. Neat! I knew that in the abstract but not about that tool.
Me neither. I like it - but I would like it printed the ID an path, too.
Be careful with blkid. Sometimes it lies. The issue is that it uses a cache. If you are not root, it just reads the cache, which can be out of date. If you are root, it may or may not use the cache (I forget the option details) and again, it can be out of date. RTFM, carefully ! :( Cheers, Dave -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (6)
-
Andrew Rich
-
Anton Aylward
-
auxsvr@gmail.com
-
Carlos E. R.
-
Dave Howorth
-
dwgallien