UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If I format to ext4 a USB and store root owned things and other things and lose like my main user that I used to own and write it, can I use root with new user like sudo to get at those root owned things? It would be root owner and group things on that USB maybe or maybe not, maybe.
Note that the ownership is stored in terms of UID and GID numbers, not the actual names of the user and group. UID 0 is reserved for root, so that'll be the same.
But for any normal users, you can't count on the UID for a particular user name to be the same. If you're using something like Ubuntu or Debian, than the first normal user created will be UID 1000, but that's just convention not a true "standard". So you may be surprised to see files/directories owned by a user name you don't expect.
For example, suppose you mount your USB drive on an Ubuntu system where the first normal user created was "jos". Then all files with UID 1000 ownership will show up as owned by "jos". But if you unmount this USB drive and then mount it on an Ubuntu system where the first normal user created was "may", then those same files will show up as owned by "may".
Personally, I always set the first user to the name "kuo", which has saved me some confusion but of course I can't count on anyone else's computers to follow my convention.
If a file/directory is owned by a UID/GID that doesn't exist in the OS you've booted up (or if you deleted that user or group), then the file/directory will still show up - it just won't have a friendly name to show instead of the UID/GID number.
Since "root" will always be UID 0, those will always show up as expected.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.