Announcement

Collapse
No announcement yet.

Deleting folders in /media/username/

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Deleting folders in /media/username/

    Hi, I am using kubunu 20.04 from an external usb 3.1 HDD. That means that any time I connect my kubuntu in a new pc/laptop, new folders appear under /media/myusername, depending on the hard drives or media in that computer.
    Now I am trying to control that with the fstab file, forcing them to mount in a specific folder under /media/myusername instead of the alphanumeric default folder kubuntu creates.
    My question is if I can safely delete the folders that had been created by the system, and no longer need, under the /media/myusername folder; without harming the system in any way.
    Thank you very much for your time.

    #2
    Normally the directories in /media/$USER/ that are added by the system are removed by the system. I don't know how you got directories there that are not for current mounts; I suggest they shouldn't be there and deleting them is a good idea.
    forcing them to mount in a specific folder under /media/myusername instead of the alphanumeric default folder kubuntu creates
    If the volume has a label, that label is used in /media/$USER/, which would be simpler. The partition manager can set labels, and there's commands for various file system types.
    Now I am trying to control that with the fstab file
    IMO it's better to use system settings, hardware section, removable storage, removable devices to mount removable storage.
    Regards, John Little

    Comment


      #3
      IMO it's generally a bad idea to use system folders for custom purposes. In this case, the /media folder is a system folder used to allow root to mount a removable device (as required) but allow a logged-in and active user read-write access to it. The user folder under /media is created when you are logged in and insert a removable device and has special properties as seen here:
      Code:
      stuart@office:~$ sudo getfacl /media/stuart
      getfacl: Removing leading '/' from absolute path names
      # file: media/stuart
      # owner: root
      # group: root
      user::rwx
      user:stuart:r-x
      group::---
      mask::r-x
      other::---
      vs. my home folder:
      Code:
      stuart@office:~$ sudo getfacl /home/stuart/
      getfacl: Removing leading '/' from absolute path names
      # file: home/stuart/
      # owner: stuart
      # group: stuart
      user::rwx
      group::r-x
      other::r-x
      I would always recommend mounting any device in a standard location to avoid issue like left over folders and such. Use /home/<USER> to mount things you want to access exclusively and /mnt for other devices.

      I agree with jlittle's advice to stick with the built-in mounting capabilities for removable devices to avoid little nagging issues such as this.

      Please Read Me

      Comment


        #4
        Thank you both for your answers.

        Can we say that If these folders are empty, and none of the partitions are mounted to these folders, I can delete them?. At worst, they will be created again by the system if there are no corresponding entry in the /etc/fstab file, right?

        Thanks

        Comment


          #5
          Yes, they are safe to delete.

          Please Read Me

          Comment


            #6
            Thank you very much! =)

            Comment

            Working...
            X