LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Permission Denied when trying to delete /var (https://www.linuxquestions.org/questions/linux-general-1/permission-denied-when-trying-to-delete-var-364248/)

robintw 09-17-2005 12:54 PM

Permission Denied when trying to delete /var
 
Hi

I've recently put a hard drive from an old linux system into my new one. There is some important data on the drive which I need to keep - but I need to delete the bin, usr, var etc etc directories. Some of those delete ok - but when I try to delete some of them (with rm -rf) I get a permission denied error. I've tried doing chmod -R 777 on the directory - but still get the error. Is there any way to 'force delete regardless of anything' these directories?

Thanks,

Robin

paulsm4 09-17-2005 01:02 PM

1. Where have you mounted the old filesystem from the old disk onto your new filesystem. For example, have you tried something like:

mkdir /old_root
mount /dev/hd<NNN> /old_root
rm -rf /okld_root/var

2. Have you tried doing this in single-user mode?
In "boot from CD" mode?

robintw 09-17-2005 01:12 PM

Hi

I've mounted it in a directory inside /mnt. So it is /mnt/120gb/var that I am trying to delete.

I'll try it in Single User mode (running init 3) and see what happens.

Thanks,

Robin

robintw 09-17-2005 01:20 PM

Hi

I've tried running it in single user mode - it still gives the Permission Denied errors. Now it also gives a Sementation Fault - it gives all sorts of details about this but I'm not sure which details I should give in this post - any ideas of what to post would be useful!

Thanks,

Robin

paulsm4 09-17-2005 02:00 PM

In single user mode, try:

1. run "fsck" on the drive (something corrupt)?

2. try "rm -rf" a directory at a time (who's the
culprit? All of "//mnt/120gb/var", or something in particular?)


All times are GMT -5. The time now is 11:06 PM.