LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 01-07-2024, 05:59 PM   #1
maybeJosiah
Member
 
Registered: Jan 2024
Location: USA
Distribution: Ubuntu, Android, Ubuntu Touch, Jolla Sailfish maybe
Posts: 195
Blog Entries: 2

Rep: Reputation: 5
Question With ext4 USB is any root USB root?


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.
 
Old 01-07-2024, 06:22 PM   #2
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,388

Rep: Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560
Yes.
 
1 members found this post helpful.
Old 01-08-2024, 08:35 AM   #3
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
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.
 
  


Reply

Tags
back-up, ext4, ubuntu, usb



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NAS ext4 drives initialized with Win10 Computer manager :( guid parttable and ext4 filesystem loss uyjjhak Linux - Server 4 04-20-2021 06:32 PM
How to change file system from ext4 journeying to ext4 writeback ? 5883 Linux - Newbie 6 03-10-2014 08:04 AM
modprobe: Module ext4 not found. no dependencies for kernel module 'ext4' found Aquarius_Girl Linux - Newbie 6 01-25-2012 05:07 AM
[SOLVED] root partition mounted:/dev/root on / type ext4 (rw,relatime,barrier=1,data=ordered) costasdk Slackware 2 06-30-2011 02:09 PM
Is it safe to format USB flash to ext4 or ext4? joham34 Linux - Newbie 2 01-08-2011 11:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 12:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration