Author Topic: [solved] assign a disk path/label permanently  (Read 1271 times)

Offline peterhodges

  • Jr. Member
  • **
  • Posts: 39
[solved] assign a disk path/label permanently
« on: January 09, 2011, 11:54:06 PM »
every time i start up the system labels the drives differently.

is there a way to permanently assign a path to a drive?

so that a disk shows up as /media/disk every time, and another disk shows up as /media/disk-1 everytime, etc?

thanks



« Last Edit: January 10, 2011, 12:26:04 PM by peterhodges »

uncleV

  • Guest
Re: assign a disk path/label permanently
« Reply #1 on: January 10, 2011, 01:27:53 AM »
How do they show now and by which application(s) you have different naming?

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6471
  • I'm going South
Re: assign a disk path/label permanently
« Reply #2 on: January 10, 2011, 01:59:45 AM »
every time i start up the system labels the drives differently.

is there a way to permanently assign a path to a drive?

so that a disk shows up as /media/disk every time, and another disk shows up as /media/disk-1 everytime, etc?

thanks


If you label the partitions, they'll show up as /media/<label> every time. (Provided that you let HAL mount them.)

How to give them labels? Old-Polack has explained it numerous times:
http://www.pclinuxos.com/forum/index.php/topic,85262.msg706934.html#msg706934
« Last Edit: January 10, 2011, 02:02:08 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

uncleV

  • Guest
Re: assign a disk path/label permanently
« Reply #3 on: January 10, 2011, 02:52:47 AM »
And I'll explain my noob's way of labeling a partition:

PC Control Center-->Local disks-->Manage disks partitions.
Click on the partition, click on "Toggle to expert view", click on "Label":



Click "OK", click "Done", click "Yes" on saving modifications in etc/fstab, close PC Control Center, reboot machine.
You can see the modifications after reboot.

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: assign a disk path/label permanently
« Reply #4 on: January 10, 2011, 03:36:05 AM »
UncleV ........  it used to be that a Label applied as you described would not be written unless the partition is formatted .......  if this is still true then this is not suitable for partitions with data.

The simplest method for Linux filesystems is the command

e2label  /dev/sd??   <new-label>

If <new-label>  is omitted then the command will return the existing label if any of the partition.

Code: [Select]
e2label /dev/sda6
Root

uncleV

  • Guest
Re: assign a disk path/label permanently
« Reply #5 on: January 10, 2011, 04:25:52 AM »
Just18*,
when I wrote this I firstly checked it because was not sure if I can change the label without unmounting the partition. And yes after reboot the Label was changed in etc/fstab.


------------------------------
* - "18" because you told me last year that you are getting younger.

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: assign a disk path/label permanently
« Reply #6 on: January 10, 2011, 05:11:36 AM »
Just18*,
when I wrote this I firstly checked it because was not sure if I can change the label without unmounting the partition. And yes after reboot the Label was changed in etc/fstab.


------------------------------
* - "18" because you told me last year that you are getting younger.

 ;D

Thank you for that info .....  good to know changing the label now works as expected   ;)

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6471
  • I'm going South
Re: assign a disk path/label permanently
« Reply #7 on: January 10, 2011, 06:13:06 AM »
Just18*,
when I wrote this I firstly checked it because was not sure if I can change the label without unmounting the partition. And yes after reboot the Label was changed in etc/fstab.


------------------------------
* - "18" because you told me last year that you are getting younger.

 ;D

Thank you for that info .....  good to know changing the label now works as expected   ;)

It does indeed. But note "after reboot" in uncleV's post. The system won't recognize the label before you reboot, even if the partition hasn't been mounted via /etc/fstab.
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2469
  • Any Bugs in site?
Re: assign a disk path/label permanently
« Reply #8 on: January 10, 2011, 07:20:31 AM »
I have 2 permanently installed SATA drives and another USB drive mounted now and then.
Dolphin my sole partition manager, works well but I have not been able to figure out the rules for listing drives, it seems random.

Code: [Select]
     sda1            Boot            Primary      ntfs                  [XP]                 36701.20    
     sda2                            Primary      ext4                  [minime2010]         30005.83
     sda3                            Primary      ext4                  [kde2010]            30005.83
     sda5                            Logical      ntfs                  [500GB]             524287.58
     sda6                            Logical      swap                  [swap4000]            4186.67
     sda7                            Logical      ext4                  [xfce2010]           12576.46
     sda8                            Logical      ext3                  [lxde2010]           24996.63
     sda9                            Logical      ext4                  [zen2010]            20003.89
     sda10                           Logical      ext4                  [gnome2010]          24996.63
     sda11                           Logical      ext4                  [lxde-mini]          19995.66
     sda12           NC              Logical      ext4                  [mythtvkde12]        21475.89    *
     sda13           NC              Logical      ext4                  [backup]             16319.28    *
                                     Logical      Free Space                                234650.79

Here is listing of my labels for /dev/sda the order that Dolphin will show them:

Quote
minime2010
lxde2010
sda12-mythtv-bk
DELTA-12
mythtvkde12
zen2010
DELTA-03
DELTA-08-DONE
XP
DELTA-10
xfce2010
..
..
...
I am rather intrigued and in the back of my mind this pops up now and again.

DELTA-01 to DELTA-12 belongs to the second hard disk, I was expecting at least those to be in a alpha/numerical sequence.  Am I missing a switch/option somewhere.   :)
« Last Edit: January 11, 2011, 04:20:47 AM by wedgetail »
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: assign a disk path/label permanently
« Reply #9 on: January 10, 2011, 10:44:17 AM »
Quote
DELTA-01 to DELTA-12 belongs to the second hard disk, I was expecting at least those to be in a alpha/numerical sequence.  Am I missing a switch/option somewhere.   Smiley

You can drag & drop the partitions into whatever order you would like them to appear, I believe.
     

Offline peterhodges

  • Jr. Member
  • **
  • Posts: 39
Re: assign a disk path/label permanently
« Reply #10 on: January 10, 2011, 12:25:19 PM »
excellent, uncle's easy way did the trick...at least on one of the drives!  i did have to unmount the partitions. i have added the command line versions to my handy reference list of commands.

the drive shows up as /media/myname so now i don't have to keep redoing the path in various conf files!
« Last Edit: January 10, 2011, 12:28:29 PM by peterhodges »

Offline wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2469
  • Any Bugs in site?
Re: [solved] assign a disk path/label permanently
« Reply #11 on: January 11, 2011, 01:31:31 AM »
Just19
Imagine that, dragging the mount points, well it works. Not sure yet how permanent as one of the DELTA line did swop with another but I was not alert at the time. 

I had just recently found out that the whole mount panel disengages from Dolphin if you like that. Anyway I am real happy with being able to group them.   :D
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen

uncleV

  • Guest
Re: assign a disk path/label permanently
« Reply #12 on: January 11, 2011, 03:41:31 AM »
Just18*,
when I wrote this I firstly checked it because was not sure if I can change the label without unmounting the partition. And yes after reboot the Label was changed in etc/fstab.


------------------------------
* - "18" because you told me last year that you are getting younger.

I was not accurate saying this. Actually fstab is modified immediately after "Yes" to save changes in fstab but system reads it at the next boot only.
« Last Edit: January 11, 2011, 03:43:46 AM by uncleV »

Offline wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2469
  • Any Bugs in site?
Re: [solved] assign a disk path/label permanently
« Reply #13 on: January 11, 2011, 10:09:49 PM »
The following question I have not searched yet as I am not sure what to search for.

I am getting to grips with dragging the listed devices in Dolphin insert panel. Running into an interesting situation where I have the same name label on hard disk A and hard disk B.  Decided to change the name label om disk B a bit by doing it as root in konsole.

Code: [Select]
[root@localhost gert]# tune2fs -L kde2010-crash /dev/sdb1

Question arises, can I 'start' or 'restart something that will reflect the change when I open a new instance of Dolphin, without having to reboot?

I am not clear on who or what program populate the Dolphin list.  Had a vague idea this is tied up with 'udev' but that is the extent of my knowledge.    :)
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen

Offline wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2469
  • Any Bugs in site?
Re: [solved] assign a disk path/label permanently
« Reply #14 on: January 14, 2011, 08:41:21 PM »
Don't know if this means anything but I have just made a backup copy of my new kde2010 workhorse as I am going to tinker with wine.

/dev/sda3  backing up to /dev/sdb14 while I am running minime from /dev/sda2 but I had to format /dev/sdb14 first.

Quote
mount /dev/sda3 /here
mke2fs -t ext4 -L DELTA-14 /dev/sdb14
mount /dev/sdb14 /there
rsync -av /here/  /there       <--- notice /here/ the extra slash at the end of /here

Only a couple of minutes at the most and backup done.

Starting up Dolphin, this does not list /dev/sda3 LABEL=kde2010 nor /dev/sdb14 LABEL=DELTA-14

I decided to restart udev to see what happens.

Code: [Select]
[root@localhost gert]# /sbin/start_udev
Starting udev:                                                                              [  OK  ]
[root@localhost gert]#

Now running Dolphin or Konqueror I will see /dev/sda3 LABEL=kde2010

I guess I am halfway there, but looks like I still need to do a re-start to full listing.  :)
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen