Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Udev rule to map partition labels to device links
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Alighieri
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jan 2005
Posts: 88

PostPosted: Wed Jul 13, 2005 8:58 pm    Post subject: Udev rule to map partition labels to device links Reply with quote

It is sometimes useful to refer to a disk partition by its partition label rather than the device name. First, place the following:
Code:
# Maps ext2/3 partition labels to symlinks
SUBSYSTEM="block", PROGRAM="/sbin/e2label %r/%k", MATCH="?*", SYMLINK="e2label/%c%e"
into the file /etc/udev/rules.d/10-local-udev.rules. This could be tailored a bit [done], but does the job.

Now use e2label to label an ext2/3 partition, e.g,
Code:
e2label /dev/hd4 test


Then run
Code:
udevstart

There should be a device symlink at /dev/e2label/test pointing to /dev/hda4. You can now use these device links in /dev/e2label in your fstab, etc.

Update: changed to disallow empty labels and to append a number to duplicate symlinks.


Last edited by Alighieri on Tue Jul 19, 2005 6:52 pm; edited 4 times in total
Back to top
View user's profile Send private message
manny15
Guru
Guru


Joined: 01 Dec 2002
Posts: 473
Location: USA

PostPosted: Wed Jul 13, 2005 9:59 pm    Post subject: Reply with quote

oooo, that's cool!
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Wed Jul 20, 2005 8:40 am    Post subject: Reply with quote

Yes it really is!!!

Is there by any chance a similar tool for reiserfs???

don't wanna reformat 400 GB :twisted:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum