Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a relatively new installation of Centos 6 installed as a virtual machine on VMWare Workstation. The original issue I was getting was that one of the partitions was created too small in the original OS installation.

I deleted /dev/sda4 with fdisk and the immediately recreated another one with the larger size. fdisk now shows /dev/sda4 as empty with the new, larger size, but when I exit out and perform a ls, I still get the old size and the old files.

Normally I would reboot but I am hesitant to do so if the partitions are funky. What is going on? How do I fix this? Should I be concerned?

share|improve this question

migrated from serverfault.com Dec 19 '12 at 21:38

This question came from our site for professional system and network administrators.

    
Are you saying that you had /dev/sda4 MOUNTED when you deleted it? –  mdpc Dec 19 '12 at 20:20
    
I cant recall if that was the case or not. If I had to guess, I would probably say: yes, it was mounted when I deleted it. –  Jeff Dec 19 '12 at 20:23
    
You should probably reboot as soon as possible so that some of the internal buffers and tables referencing this disk remain in tact. In general, to prevent problems you should unmount the old disk. Please do reboot now if you have not done so. –  mdpc Dec 19 '12 at 20:46
add comment

2 Answers 2

up vote 5 down vote accepted

You shouldn't be concerned. When you deleted / recreated the partition, you weren't actually wiping the filesystem, only changing information in the partition map. The old filesystem was still intact, so it was able to mount and show files normally. I'm willing to bet the filesystem shows the old smaller size, not the larger size.

share|improve this answer
    
Had you started the partition on a different cylinder when you re-created it, this wouldn't be the case and you wouldn't have been able to mount the partition as a filesystem at all. –  John Dec 19 '12 at 20:23
    
Perhaps I should have mentioned that I wanted to copy files from the old partition back onto the new partition. Can I do that before rebooting? –  Jeff Dec 19 '12 at 20:27
    
There is no old/new partition. There's only the existing partition - the files are already there. If you reboot now, nothing will change. You can run resize2fs to grow the filesystem to the size of the partition, and that's all you really need to do to make use of the larger partition. –  John Dec 19 '12 at 20:28
add comment

Since you had the disk area mounted when you deleted it....I'd reboot the system as soon as possible to protect the integrity of the disk.

AFTER you reboot you should do a resize2fs /dev/sda4 so that the new space is added to the logical filesystem.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.