LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to delete an partition (https://www.linuxquestions.org/questions/linux-general-1/how-to-delete-an-partition-37161/)

qanopus 12-03-2002 03:38 AM

how to delete an partition
 
Hi, I have a partition that was used as a boot partition on my previus linux system. That partition is'nt used any more. How to savly get rid of this partition? If I simply delete it with fdisk, won't the numbers of the other partitions change? If that happens I'l get a kernel panic when I boot in to linux again. I could give a "root=" option to lilo, but won't things be broken?
So my question is, how do I safely delete a partiton?

acid_kewpie 12-03-2002 03:48 AM

well you should use the e2label program to give the partitions you are using descriptive names, so you can call them by name and not their partition number. eg:

Code:

LABEL=/        /            ext2    defaults              1 1
LABEL=/boot    /boot        ext2    defaults              1 2
LABEL=/usr    /usr          ext2    defaults              1 1

and then it's not a problem anymore. not sure about swap partitions though. i guess you could always let it fail easily enough and change it later.

qanopus 12-03-2002 08:12 AM

I don't quite understand what I have to do. I looked at the man page of e2label and think it says to give an device a label you should do :
"e2label /dev/hda4 root" (hda4 is my root). Is this right? Then what? Can I call on "root" in fstab instead of /dev/hda4 ? So then My fstab should look something like :

root / ext2 errors=remount-ro 0 1

instead of

/dev/hda4 / ext2 errors=remount-ro 0 1

Is this right?

acid_kewpie 12-03-2002 08:16 AM

uh huh, run something like "mount -l" to list the labels of the partitions (assuming they are already mounted) just to check you've got the right name.

what you do to fstab is copy my example.... LABEL= etc...


All times are GMT -5. The time now is 12:17 AM.