Rename partition c0d0p1

 
Thread Tools Search this Thread
Operating Systems Linux SuSE Rename partition c0d0p1
# 1  
Old 10-04-2011
Rename partition c0d0p1

Hi guys, need some help with a simple renaming task under SUSE.

I'm trying to use a custom name for a disk device under OpenSUSE.

I have a device named "c0d0" which contains a partition "c0d0p1"

/dev/cciss/c0d0p1 is the name of the file as well as the name reported by "fdisk".

I'd like to change the name from "c0d0p1" to "c0d0pA". How can I achieve that?

The disk is currently empty so there is no data to worry about.

Thanks. Smilie

Last edited by verdepollo; 10-06-2011 at 10:37 AM.. Reason: typo
# 2  
Old 10-05-2011
This is a device file, so I would suggest not doing that. However, you can go about doing things like this with udev.
# 3  
Old 10-05-2011
It's a device file, meaning, its name is autogenerated by udev and has nothing to do with the contents of the disk. Unless you coerce udev into naming it what you want somehow, it will just come back as its old name next reboot.

Messing with existing udev rules, particularly the important ones which create disk names, can be dicey. udev also has rules to create symlinks for more convenient names in /dev/disk/. If there's not ones suiting you in there already, perhaps you could add a rule to add more symlinks more to your purpose. That way, if your naming rule messes up, you haven't cut yourself off from all your disks...
# 4  
Old 10-06-2011
Hmm, I hadn't considered using a link but that would definitely do the trick. Smilie

Ok, so I copied an existing rule on /etc/udev/rules.d/ and modified it a bit just to test the behavior, then I ran udevcontrol reload_rules but I don't see the link getting created under /dev/disk/by-id (which is the path I used for my rule).

Other default links are still there though.

The rule looks like this:
Code:
KERNEL=="sd*[0-9]|cciss*p[0-9]*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-A"

Am I missing something?
# 5  
Old 10-06-2011
getting udev rules to properly reload without rebooting can be a pain, I'm not sure if that's the correct method. 'udevcontrol' looks like a distribution-specific thing, too.

What do you need from the new rule that the old ones don't provide?

[edit] I see a lower-case $env vs an upper-case ENV. Ditch the $ and make them uppercase.
# 6  
Old 10-06-2011
Quote:
Originally Posted by Corona688
What do you need from the new rule that the old ones don't provide?
Basically I need the partition name to end with a letter (c0d0pA) instead of a number (c0d0p1).

Quote:
[edit] I see a lower-case $env vs an upper-case ENV. Ditch the $ and make them uppercase
Well, those two (uppercase and lowercase) were already defined in the file and almost all of the default rules have both.

I have not modified anything besides copying an existing rule and appending a letter "A" at the end.

Anyway, just in case I changed the $env to ENV and it's still not creating the symlinks. :/
# 7  
Old 10-06-2011
getting udev rules to properly reload without rebooting can be a pain, I'm not sure if that's the correct method. 'udevcontrol' looks like a distribution-specific thing, too.

---------- Post updated at 12:49 PM ---------- Previous update was at 12:48 PM ----------

If applicable, another thing you could do is remove the module for that device and reload it, which will cause whatever rules are there to be re-applied. Just reloading the rules may not be enough to actually get udev to use those rules, that happens when the kernel tells it a new device has arrived...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Shrink LVM partition & create new Linux Primary partition

Hello All, I have a Red Hat Linux 5.9 Server installed with one hard disk & 2 Partitions created on it as follows, /boot - Linux Partition & another is LVM - One VG & under that 5-6 Logical volumes(var,opt,home etc). Here my requirement is to take out 1GB of space from LVM ( Any logical... (5 Replies)
Discussion started by: gr8_usk
5 Replies

2. Filesystems, Disks and Memory

Ask concept soft partition vs hard partition

Hi Experts I would like to know different between soft partition concept and hard partition concept on solaris. Here is little explanation between soft partition concept and hard partition concept on solaris. Soft Partition: 1TB total space available in storage in all mapped to the OS to... (2 Replies)
Discussion started by: edydsuranta
2 Replies

3. Solaris

Partition overlaps another partition while creating new parition in solaris

hi all while formatting hard disk i am getting following error. Partition 1 ends at 266338338 It must be between 34 and 143374704. label error: EFI Labels do not support overlapping partitions Partition 8 overlaps partition 1. Warning: error writing EFI. Label failed. I have formatted the... (2 Replies)
Discussion started by: nikhil kasar
2 Replies

4. Solaris

Rename soft partition

Hi folks, is there any possibility how to rename soft partitions?? Here I found that this is not possible (I know that it is) but I need do it in some supported way. http://dlc.sun.com/osol/docs/content/LOGVOLMGRADMIN/tasks-basics-5.html This is production system it is why I need do it... (0 Replies)
Discussion started by: brusell
0 Replies

5. Shell Programming and Scripting

rsync from partition to partition fastest

Gentleman, Please move if I have chose the incorrect forum section. I am trying to move data that is not backed up from partition 1 to partition 2 on a SAN that has a GFS2 filesystem. Since the data is not backed up I am rsyncing this data and once verified I will delete from the source... (6 Replies)
Discussion started by: jaysunn
6 Replies

6. Solaris

Solaris Filesystem - rename the partition

Hi all i got this filesystem Filesystem size used avail capacity Mounted on /dev/dsk/c0t600A0B80001F350A000033404A5D29D9d0s2 492G 64M 487G 1% /u10 How do i change the name for /dev/dsk/c0t600A0B80001F350A000033404A5D29D9d0s2 to the... (3 Replies)
Discussion started by: SmartAntz
3 Replies

7. Linux

Partition

Why the hard drive can only have 4 primary partition. If i want do more, what should i do? (3 Replies)
Discussion started by: RaNoNeR
3 Replies

8. UNIX for Dummies Questions & Answers

I've created a partition with GNU Parted, how do I mount the partition?

I've created a partition with GNU Parted, how do I mount the partition? The manual information at http://www.gnu.org/software/parted/manual/parted.html is good, but I am sure about how I mount the partition afterwards. Thanks, --Todd (1 Reply)
Discussion started by: jtp51
1 Replies

9. UNIX for Dummies Questions & Answers

understanding logical partition, physical partition

hi, 1) is logical partition the same as physical partition except that one is physical and the other is logical? 2) then it must a one to one ratio? (3 Replies)
Discussion started by: yls177
3 Replies

10. UNIX for Dummies Questions & Answers

partition

How do I create a new Disk partition in HP-unix machine??? (1 Reply)
Discussion started by: chakradharm
1 Replies
Login or Register to Ask a Question