Score:0

I'm trying to change the flags on my files I copied before stating fresh with Ubuntu 22.04

in flag

I made a copy of my files on a USB hard drive before starting fresh with Ubuntu 22.04. How do I change the ownership of the directories on the USB hard drive, file and sub-directories? I just want to put them on the new installation so I can edit then. I've tried the chown command and can't get the syntax correct. I've looked at as many posts as I can find and I'm getting lost in all of the information.

This is my /etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device;this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/vgubuntu-root /  ext4  errors=remount-ro 0  1
# /boot/efi was on /dev/sda2 during installation
UUID=819C-B893  /boot/efi  vfat  umask=0077  0  1
/dev/mapper/vgubuntu-swap_1 none  swap  sw  0  0
oldfred avatar
cn flag
Did you then copy to NTFS which does not support Linux ownership & permissions? If so you have to copy back to your data partition or /home partition or folder & change permissions & ownership then. Be careful not to change any system ownership or permissions which can damage system.
DavidDJ40 avatar
in flag
I took a new Seagate 5Tb USB drive and with Gparted removed all partitions and created another one with a file system of ext4.
oldfred avatar
cn flag
Did you use gpt. which is required for any drive over 2TB, over old MBR(msdos) partitioning. You then should be able to mount & set ownership & permissions. If removable, you can add to fstab, but need extra parameters since removable drive, like autofs or systemd-automount. But still have do settings. https://unix.stackexchange.com/questions/183994/understanding-unix-permissions-and-file-types
guiverc avatar
cn flag
I'm not sure you'll need to change permissions (*though it may depend on how you copied the files initially or details not provided*). I'm using a newish PC installed last week (Lubuntu) as my old PC died; I just copied my files onto the fresh install where no `chown` was required. If your USB drive uses a format that can't store ownership data (as per oldfred's query) you can't change ownership there, but can easily do so once on your local hdd/ssd which is what I'd suggest doing.
DavidDJ40 avatar
in flag
You were correct. Once I moved the files off the drive I saved them to and on my new install I have read/write and delete access. thank you all for your help.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.