How do i erase a file?


#1

got this error while attempting a backup again
error mounting /dev/sda at/media/openhabian/OHBACKUP
i want to erase this file: mkdir /mnt/OHBACKUPDrive


#2

i am not sure but when you are in the folder the file is try ( rm “the file”) enter
then write (yes) and enter again. dont use the () and "


#3

I realise this is a rather old post, but it might have some value solving.

The “file” you are describing is not technically a file you can delete. It’s a linux mount point. If you type the command: lsblk Then you can see all mounted partitions on your system. If /dev/sda already is mounted you cannot mount it twice. Usually this is mounted with a single forward slash ( / ) Could also be that you got an error due to you missing root priveleges. Did you run the command using sudo?

If the mountpoint /mnt/OHBACKUPDrive already is mounted, then you can unmount it using:
sudo umount /mnt/OHBACKUPDrive


#4

[21:58:21] openhabian@openHABianPi:/etc$ rm dhcpcd,conf
rm: remove write-protected regular file ‘dhcpcd,conf’? y
rm: cannot remove ‘dhcpcd,conf’: Permission denied
[21:59:10] openhabian@openHABianPi:/etc$

Above failed to remove the unwanted file.

Using sudo rm worked for me.


#5

Rule of thumb: whenever a file is outside of the user pi’s directory, then you probably need to use sudo.