Cant't delete other debian systems created files

Asked by Grigor Khachatryan

Hello guys.

I am trying to delete some files and directory's which is made by other user in other debian system.

How can i delete these files?

I tryed`
1.
# chown -hR root ls
chown: changing ownership of ‘ls’: Operation not permitted
2.
# rm -f -R bin
rm: cannot remove ‘bin/ps’: Operation not permitted
rm: cannot remove ‘bin/ls’: Operation not permitted
rm: cannot remove ‘bin/netstat’: Operation not permitted
3.
# shred -u -v -f ls
shred: ls: failed to open for writing: Operation not permitted

Nothig helps.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
N1ck 7h0m4d4k15 (nicktux) said :
#1

Hello,

it seems that the chown command didn't work well. First thing you have to do is to change the ownership. You need root privileges for this, and of course the correct path. The exact path of the folder you want to take ownership. If you want to take the ownership of the additional subfolders and/or files (if any) you should use the -R option.

Here is an example.

I have a folder that belongs to another user and its name is Other. This folder is mounted under /mnt folder.

How to take the ownership ?

    sudo chown $USER:$USER /mnt/Other

Recursively ?

    sudo chown -R $USER:$USER /mnt/Other

You can replace $USER with your actual username, but is not necessary as $USER is a variable of the connected user in the system/ the user that runs the command.

    echo $USER

Then you can do anything you want in that folder (delete, write, move, copy..etc)

Regards
 NikTh

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2

If you run:

gksudo nautilus

You can delete what you desire. I assume you have a desktop OS.

Revision history for this message
Grigor Khachatryan (grigorkh) said :
#3

Thanks friends

I have already deleted these files with hard delete tool which is deleting blocks of files and deleting connections.

Revision history for this message
Grigor Khachatryan (grigorkh) said :
#4

What can i do to delete these filess?????

# sudo chown -R $USER:$USER /media/grigor/7625d8bb-b667-4d92-962a-13f508f80fb5/.Trash-1000/
chown: changing ownership of ‘/media/grigor/7625d8bb-b667-4d92-962a-13f508f80fb5/.Trash-1000/expunged/1433697096/sbin/ttymon’: Operation not permitted
chown: changing ownership of ‘/media/grigor/7625d8bb-b667-4d92-962a-13f508f80fb5/.Trash-1000/expunged/1433697096/sbin/ttyload’: Operation not permitted
chown: changing ownership of ‘/media/grigor/7625d8bb-b667-4d92-962a-13f508f80fb5/.Trash-1000/expunged/1433697096/sbin/ifconfig’: Operation not permitted
chown: changing ownership of ‘/media/grigor/7625d8bb-b667-4d92-962a-13f508f80fb5/.Trash-1000/expunged/1433697096/bin/ps’: Operation not permitted
chown: changing ownership of ‘/media/grigor/7625d8bb-b667-4d92-962a-13f508f80fb5/.Trash-1000/expunged/1433697096/bin/ls’: Operation not permitted
chown: changing ownership of ‘/media/grigor/7625d8bb-b667-4d92-962a-13f508f80fb5/.Trash-1000/expunged/1433697096/bin/netstat’: Operation not permitted
chown: changing ownership of ‘/media/grigor/7625d8bb-b667-4d92-962a-13f508f80fb5/.Trash-1000/expunged/1433697096/usr/sbin/ttyload’: Operation not permitted
chown: changing ownership of ‘/media/grigor/7625d8bb-b667-4d92-962a-13f508f80fb5/.Trash-1000/expunged/1433697096/usr/bin/top’: Operation not permitted
chown: changing ownership of ‘/media/grigor/7625d8bb-b667-4d92-962a-13f508f80fb5/.Trash-1000/expunged/1433697096/usr/bin/md5sum’: Operation not permitted
chown: changing ownership of ‘/media/grigor/7625d8bb-b667-4d92-962a-13f508f80fb5/.Trash-1000/expunged/1433697096/usr/bin/pstree’: Operation not permitted
chown: changing ownership of ‘/media/grigor/7625d8bb-b667-4d92-962a-13f508f80fb5/.Trash-1000/expunged/1433697096/usr/bin/find’: Operation not permitted
chown: changing ownership of ‘/media/grigor/7625d8bb-b667-4d92-962a-13f508f80fb5/.Trash-1000/expunged/1433697096/usr/bin/ssh’: Operation not permitted
chown: changing ownership of ‘/media/grigor/7625d8bb-b667-4d92-962a-13f508f80fb5/.Trash-1000/expunged/1433697096/usr/lib/libsh’: Operation not permitted
chown: changing ownership of ‘/media/grigor/7625d8bb-b667-4d92-962a-13f508f80fb5/.Trash-1000/expunged/1433697096/etc/sh.conf’: Operation not permitted
chown: changing ownership of ‘/media/grigor/7625d8bb-b667-4d92-962a-13f508f80fb5/.Trash-1000/expunged/1433697096/lib/libsh.so’: Operation not permitted

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

what file system is the storage?

Revision history for this message
N1ck 7h0m4d4k15 (nicktux) said :
#6

Try

    gksudo nautilus /media/grigor/

And see if you can just right click and delete them.

Regards
 NikTh

Revision history for this message
Grigor Khachatryan (grigorkh) said :
#7

actionparsnip (andrew-woodhead666) # EXT3 and these files created by NAS "D-Link DNS-323 chroot-debian mod"

Nik.Th. (nick-athens30) # "gksudo nautilus /media/grigor/" does not work: typing "Operation not permitted" or "access denied"

Revision history for this message
N1ck 7h0m4d4k15 (nicktux) said :
#8

Well, maybe those files are not there for real ? Maybe are only links to files that are not exist ?

When you delete a file from a device that is mounted, and then you remove this device the /.Trash folder seems full, but in really is not. You must mount the device again and delete those files with the device mounted. Trash keeps symlinks to deleted files.

But lets see some info about those files.

    ls -la /media/grigor/

and

    stat -c "%a,%n" /media/grigor/*

The results could be many, but we don't need them all. 10-15 results would be OK.

Also try to remount the partition with read-write access and special permissions.

First create a specific mount point under your /home directory, where you have full access.

    mkdir device

then unmount the device and mount it again with some special permissions under "device" folder

    sudo umount /media/grigor/

    sudo mount -t ext3 /dev/sdXX device/ -o umask=0777

Where XX replace it with the letter and number of the partition (e.g. /dev/sdb1 or /dev/sdc1). See the correct letter and number with

    sudo fdisk -l

Regards
 NikTh

Can you help with this problem?

Provide an answer of your own, or ask Grigor Khachatryan for more information if necessary.

To post a message you must log in.