this post was submitted on 23 Mar 2024
27 points (88.6% liked)

Linux

48190 readers
1541 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Ubuntu just started renaming files while exporting (sending over mail, KDE Connect, Whatsapp web). The folder is my google drive, connected to my google drive. Sometimes it looses its file ending/type as well. The file is called something like: "1Kfhgsji2rjfIS-fi3oo598nf8ajlfoi.pdf"

I guess its a weird bug, it persist even after a restart. Thanks, maybe you have a solution

top 21 comments
sorted by: hot top controversial new old
[–] [email protected] 8 points 7 months ago (1 children)

It sounds like your sync process can create files, but not rename them afterwards.

That long filename you've got now is likely the temporary name you get while the file is being transferred, once it's fully there it usually gets renamed to what you want it to be.

Go up one level and check the permissions for the directory the files are in. The permissions should be read-write, otherwise it'd not be able to create files in there at all, but check if the "sticky bit" is set. That stops processes from renaming files once they are made.

Unfortunately I'm travelling at the moment, but hopefully your file manager will have a way of showing if the "sticky bit" is set for that directory.

[–] [email protected] -3 points 7 months ago (1 children)

I should have sudo rights. I'm the only user on the pc and I can execute commands as sudo. The sticky bit seems not to be set. According to the quick Google search it is a "t" behind the rwx permissions when doing ls -l

[–] [email protected] 2 points 7 months ago (1 children)

You might be the only user, but there are processes running on your machine that are not you. Most system processes try to run with the least permissions possible to mitigate security risks.

It feels like it's this kind of problem, but it could also be something to do with file locking. Eg the transfer process wants to rename the file but it can't because another process has it open.

[–] [email protected] 1 points 7 months ago

Can I check what processes are using a file?

[–] [email protected] 1 points 7 months ago (1 children)

Is the original file name like that, or is that the exported name?

[–] [email protected] 1 points 7 months ago (1 children)

The exported one. The original was normal text

[–] [email protected] 1 points 7 months ago (2 children)

Not gonna lie, that’s straight up bizarre. I’m almost wondering if it has to do with the programs not having proper permissions to access those files, but then I’d think that they wouldn’t upload at all.

Have you tried chmod 777 on any of those files to see if it makes a difference? That is usually my first stop when a Linux program has trouble interacting with a file.

[–] [email protected] 1 points 7 months ago (1 children)

I just opened the Google drive folder in the terminal and listed the files. They all have the similar 33 letter name. When I "ls -ld" on the files, it shows -rw-------

[–] [email protected] 3 points 7 months ago* (last edited 7 months ago) (1 children)

Do you know how to accomplish a chmod in Linux?

Here’s a breakdown if you need to learn: https://www.howtogeek.com/437958/how-to-use-the-chmod-command-on-linux/

From your description, it looks like there is read write permission for the user, but no group or general permissions. Again, I don’t know if this will work, but it is where I would start.

Open your terminal and type:

sudo chmod 777 /path/to/file.txt

That will allow all users, groups, and guests to read, write, and/or execute the file. Then, if your programs are set to run under their own user or group, this will open the door for them to be able to access the full file.

Other than that, I’m wondering if the original file names have a structure that one of the systems can’t handle (such as slash marks) and so it changes the name to accommodate.

This is going to take some trial and error in troubleshooting. If you aren’t familiar with your terminal yet, this is going to be a great learning opportunity. Just make a backup of your files and system so you can undo any mistakes.

[–] [email protected] 1 points 7 months ago (1 children)

Thanks dor the link. I ran the command with sudo and the fill path to the file, permission still denied. User group and user is me, still only rw permission for the user.. It confuses me, that I don't have executive permission on my own folder. Should I try to disconnect and reconnect to Google drive?

[–] [email protected] 3 points 7 months ago (1 children)

Couldn’t hurt, but I’d be surprised if that fixed it.

Has your account been added to the sudo group before? If not, run the following command in the terminal with your own username:

sudo usermod -aG sudo

That should give your account sudo privileges and let you run the command with sudo properly.

I really wish I could take a look at your system in person. There are several things happening here that are unusual for Ubuntu.

[–] [email protected] 1 points 7 months ago (1 children)

Still permission denied :&

[–] [email protected] 2 points 7 months ago (1 children)

It sounds like you aren’t an admin somehow. Do you know the root login credentials? Maybe adding the user to sudo from root will get you closer.

You could also try running chmod as root as a shortcut, but be very careful making a bunch of changes as root.

[–] [email protected] 1 points 7 months ago (1 children)

When I use "su" and login as root, I can not navigate using ls or cd.. it says permission denied again.. I'm a little confused to be honest

[–] [email protected] 3 points 7 months ago (1 children)

Honestly, it sounds like you set up some unusual settings when you first set up Ubuntu. Usually, the default Ubuntu options will disable root and give your first account sudo permissions. If it didn’t do that, then it should still have root enabled as a user you can log in as.

I mean no disrespect, but it seems like you need some terminal fundamentals that will be difficult for me to relay to you one at a time. Instead, I’m going to give you the basic game plan that I would run here, and then I suggest you google the individual commands to see how they work.

Step 1: Get Admin Permissions

It is imperative that you get administrator privileges. Try logging out completely and logging in as root. If that doesn’t work, do some googling about Ubuntu root accounts and wrack your brain to remember what you selected when you first set up the OS. When you get access to the root account, you should be able to run that command from earlier to add your user to the sudo group. Running commands with sudo will give your primary account root like permissions without having to risk a fat finger error like you do with root.

Step 2: Try Changing File Permissions

Once you have sudo or root access, use sudo or root to run the chmod 777 command to change a file’s permissions to global access. This will allow any user or program to access that file. There are other chmod restrictions that are more specialized that you may want to learn about, but 777 is a good place to start while testing this because we want to reduce the chance of something going wrong as much as humanly possible.

Step 3: Look For Dependancies

Look up terminal install instructions for google drive. Are there other programs that need to be installed first that may have been missed? If so, install all dependencies.

Step 4: Test Other Distros

Spin up a VM of Debian and try installing google drive there. Does it work on Debian? If so, it may be some setting with Ubuntu that is keeping it from working. I’ve occasionally run across weird incompatibilities with Ubuntu that resolve themselves on Debian.

Step 5: The Nuclear Option

If it works in Debian or another distro, then you may want to consider switching distros, reinstalling Ubuntu, or spending a few hours of googling to figure out what the differences are between the two OS’s to track down your problem. Tracking the solution down may be the hardest option, and though it seems daunting, switching distros isn’t so bad.

Good luck, soldier! The sweet release of solving a problem in Linux is better than any orgasm. I honestly think if you do googling about root accounts, sudo, chmod, and the individual dependencies for your malfunctioning programs, that you will figure this out.

If you get it fixed, I’d love to hear your solution. Also, I’m happy to answer more questions if you make some progress and hit another block, I just figured it was easier to spell out a whole plan instead of giving it to you a step at a time.

[–] [email protected] 3 points 7 months ago (1 children)

Thank you so much for all your time and thought! I'm lot super new to Linux, but it's my main OS for a few months only. I will look into your steps that you listed. Thanks again!

[–] [email protected] 1 points 7 months ago (1 children)

Stick with it! I was intimidated by Linux at first and barely learned anything the first year because I was afraid to tinker.

Learn how to make a backup and do a restore (timeshift is a good option), and then tinker with abandon. The terminal is your friend. Experience is the best teacher.

I’m excited for you. I wish I could learn it all again to experience the excitement of writing my first script or figuring out docker again. It’s going to be an awesome adventure for you. 🙂

[–] [email protected] 2 points 7 months ago

Haha thanks! I actually have an docker project planned next! I want to make my own little home server with a raspberry and rum nextcloud and some other services in docker containers. I'm a little afraid but also very excited 😁

[–] [email protected] 1 points 7 months ago (1 children)

And chmod 777 returns "operation not supported"

[–] [email protected] 1 points 7 months ago (1 children)

Did you run it as sudo? And you’re on Ubuntu?

[–] [email protected] 1 points 7 months ago

Yes to both. Ubuntu should be up to date