BTRFS permissions  [Solved]

Help for Current Versions of MX
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
xh1
Posts: 84
Joined: Sun Jan 16, 2022 12:40 pm

BTRFS permissions

#1 Post by xh1 »

Hi,
I used GParted to format a SSD to BTRFS, to be used as a backup drive. It doesn't allow me to create folders or paste/drag files into it saying I have no permissions. In GParted I see a lock sign under the partition column but at no point was I asked whether I want the partition to be encrypted.
Your help is appreciated.

Here's the QSI:

Code: Select all

System:
  Kernel: 6.10.10-1-liquorix-amd64 [6.10-12~mx23ahs] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0 parameters: audit=0
    intel_pstate=disable BOOT_IMAGE=/antiX/vmlinuz quiet splasht nosplash tz=America/New_York
    persist_static splasht
  Desktop: Xfce v: 4.20.0 tk: Gtk v: 3.24.38 info: xfce4-panel wm: xfwm v: 4.20.0 vt: 7
    dm: LightDM v: 1.32.0 Distro: MX-23.6_ahs_x64 Libretto September 15  2024 base: Debian GNU/Linux
    12 (bookworm)
Machine:
  Type: Laptop System: Nimo Direct product: N154B v: N/A serial: <superuser required> Chassis:
    type: 10 serial: <superuser required>
  Mobo: Nimo Direct model: Portable Computer serial: <superuser required> UEFI: American
    Megatrends LLC. v: DN21CRV207 date: 03/19/2025
Battery:
  ID-1: BAT0 charge: 24.8 Wh (46.2%) condition: 53.7/53.6 Wh (100.2%) volts: 11.0 min: 11.4
    model: Intel SR 1 SR Real Battery type: Unknown serial: <filter> status: discharging
CPU:
  Info: model: 12th Gen Intel Core i3-1215U bits: 64 type: MST AMCP arch: Alder Lake level: v3
    note: check built: 2021+ process: Intel 7 (10nm ESF) family: 6 model-id: 0x9A (154) stepping: 4
    microcode: 0x432
  Topology: cpus: 1x cores: 6 mt: 2 tpc: 2 st: 4 threads: 8 smt: enabled cache: L1: 544 KiB
    desc: d-4x32 KiB, 2x48 KiB; i-2x32 KiB, 4x64 KiB L2: 4.5 MiB desc: 2x1.2 MiB, 1x2 MiB L3: 10 MiB
    desc: 1x10 MiB
  Speed (MHz): avg: 877 high: 2501 min/max: 400/2501 boost: enabled scaling: driver: acpi-cpufreq
    governor: ondemand cores: 1: 400 2: 500 3: 400 4: 500 5: 1918 6: 2501 7: 400 8: 400
    bogomips: 39936
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: reg_file_data_sampling mitigation: Clear Register File
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Enhanced / Automatic IBRS; IBPB: conditional; RSB filling;
    PBRSB-eIBRS: SW sequence; BHI: BHI_DIS_S
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel Alder Lake-UP3 GT1 [UHD Graphics] vendor: IP3 Tech driver: i915 v: kernel
    alternate: xe arch: Gen-12.2 process: Intel 10nm built: 2021-22+ ports: active: eDP-1
    empty: DP-1,HDMI-A-1,HDMI-A-2 bus-ID: 00:02.0 chip-ID: 8086:46b3 class-ID: 0300
  Device-2: Sunplus IT Co PC Camera type: USB driver: snd-usb-audio,uvcvideo bus-ID: 3-5:3
    chip-ID: 2ef4:4944 class-ID: 0102
  Display: x11 server: X.Org v: 1.21.1.7 compositor: xfwm v: 4.20.0 driver: X:
    loaded: modesetting unloaded: fbdev,vesa dri: iris gpu: i915 display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 509x286mm (20.04x11.26") s-diag: 584mm (22.99")
  Monitor-1: eDP-1 model: BOE Display 0x0c4e built: 2023 res: 1920x1080 hz: 60 dpi: 142
    gamma: 1.2 size: 344x194mm (13.54x7.64") diag: 395mm (15.5") ratio: 16:9 modes: 1920x1080
  API: OpenGL v: 4.6 Mesa 25.0.4-1~mx23ahs+1 renderer: Mesa Intel Graphics (ADL GT2)
    direct-render: Yes
Audio:
  Device-1: Intel Alder Lake PCH-P High Definition Audio vendor: IP3 Tech driver: snd_hda_intel
    bus-ID: 3-5:3 v: kernel chip-ID: 2ef4:4944 alternate: snd_soc_avs,snd_sof_pci_intel_tgl
    class-ID: 0102 bus-ID: 00:1f.3 chip-ID: 8086:51c8 class-ID: 0401
  Device-2: Sunplus IT Co PC Camera type: USB driver: snd-usb-audio,uvcvideo
  API: ALSA v: k6.10.10-1-liquorix-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel Alder Lake-P PCH CNVi WiFi driver: iwlwifi v: kernel modules: wl bus-ID: 00:14.3
    chip-ID: 8086:51f0 class-ID: 0280
  IF: wlan0 state: up mac: <filter>
Bluetooth:
  Device-1: Intel AX201 Bluetooth type: USB driver: btusb v: 0.8 bus-ID: 3-10:5 chip-ID: 8087:0026
    class-ID: e001
  Report: hciconfig ID: hci0 rfk-id: 1 state: up address: <filter> bt-v: 3.0 lmp-v: 5.2
    sub-v: 37c8 hci-v: 5.2 rev: 37c8
  Info: acl-mtu: 1021:4 sco-mtu: 96:6 link-policy: rswitch sniff link-mode: peripheral accept
    service-classes: rendering, capturing, object transfer, audio, telephony
Drives:
  Local Storage: total: 1.62 TiB used: 115 GiB (6.9%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Western Digital model: WD Green SN350 1TB 2G0C
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD
    serial: <filter> rev: 236050WD temp: 37.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 type: USB vendor: Samsung model: Flash Drive FIT size: 59.75 GiB
    block-size: physical: 512 B logical: 512 B type: SSD serial: <filter> rev: 1100 scheme: MBR
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
  ID-3: /dev/sdb maj-min: 8:16 type: USB vendor: Kingston model: SA400S37240G size: 223.57 GiB
    block-size: physical: 4096 B logical: 512 B type: SSD serial: <filter> rev: 0214 scheme: GPT
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
  ID-4: /dev/sdc maj-min: 8:32 type: USB vendor: Kingston model: SA400S37480G size: 447.13 GiB
    block-size: physical: 512 B logical: 512 B type: SSD serial: <filter> scheme: GPT
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
Partition:
  Message: No partition data found.
Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 2 GiB used: 0 KiB (0.0%) priority: -2
    file: /live/boot-dev/swap-file
Sensors:
  System Temperatures: cpu: 47.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Repos:
  Packages: pm: dpkg pkgs: 2191 libs: 1091 tools: apt,apt-get,aptitude,nala,synaptic pm: rpm
    pkgs: 0 pm: flatpak pkgs: 0
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
    1: deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
    2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb http://mirror.math.princeton.edu/pub/mxlinux/mx/repo/ bookworm main non-free
    2: deb http://mirror.math.princeton.edu/pub/mxlinux/mx/repo/ bookworm ahs
Info:
  Processes: 351 Uptime: 11m wakeups: 24194 Memory: 31.09 GiB used: 1.55 GiB (5.0%) Init: SysVinit
  v: 3.06 runlevel: 5 default: graphical tool: systemctl Compilers: gcc: 12.2.0 alt: 12
  Client: shell wrapper v: 5.2.15-release inxi: 3.3.26
Boot Mode: UEFI

User avatar
dolphin_oracle
Developer
Posts: 22668
Joined: Sun Dec 16, 2007 12:17 pm

Re: BTRFS permissions  [Solved]

#2 Post by dolphin_oracle »

when gparted formats, the file system is owned by root.

so you need to give your user permission to use the file system. I suspect right now the user has permissions to read but not write.

you can use the commandline, but I think if the device is mounted then you should be able to open the top level folder in a "root thunar" and change the permissions in the properites for that folder.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/

xh1
Posts: 84
Joined: Sun Jan 16, 2022 12:40 pm

Re: BTRFS permissions

#3 Post by xh1 »

I tried doing that and I'm getting a popup saying:
Failed to change the permissions of "lib". Error setting permissions: Operation not supported. Do you want to skip it?

User avatar
dolphin_oracle
Developer
Posts: 22668
Joined: Sun Dec 16, 2007 12:17 pm

Re: BTRFS permissions

#4 Post by dolphin_oracle »

I guess I don't understand what you've done. I though you said this was a newly formatted partition, which I presumed had nothing on it.

maybe navigate to the mount point in the terminal and provide output of

Code: Select all

ls -l
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/

xh1
Posts: 84
Joined: Sun Jan 16, 2022 12:40 pm

Re: BTRFS permissions

#5 Post by xh1 »

Hopefully this is what you were asking for. sdb is the SSD I'm trying to use.

Code: Select all

demo@mx1:~
$ pwd
/home/demo
demo@mx1:~
$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0         7:0    0   2.3G  1 loop /live/linux
loop1         7:1    0    20G  0 loop /live/persist-root
loop2         7:2    0    20G  0 loop /home
sda           8:0    1  59.8G  0 disk 
├─sda1        8:1    1  59.7G  0 part /home/blue/Live-usb-storage
│                                     /home/demo/Live-usb-storage
│                                     /root/Live-usb-storage
│                                     /live/boot-dev
└─sda2        8:2    1    49M  0 part 
sdb           8:16   0 223.6G  0 disk 
└─sdb1        8:17   0 223.6G  0 part /media/demo/Backups
nvme0n1     259:0    0 931.5G  0 disk 
├─nvme0n1p1 259:1    0   128M  0 part 
├─nvme0n1p2 259:2    0   100M  0 part 
├─nvme0n1p3 259:3    0 929.4G  0 part 
└─nvme0n1p4 259:4    0   1.8G  0 part 
demo@mx1:~
$ cd /media/demo/Backups
demo@mx1:/media/demo/Backups
$ pwd
/media/demo/Backups
demo@mx1:/media/demo/Backups
$ ls -l
total 0
demo@mx1:/media/demo/Backups
$ ^C
demo@mx1:/media/demo/Backups
$ 

User avatar
dolphin_oracle
Developer
Posts: 22668
Joined: Sun Dec 16, 2007 12:17 pm

Re: BTRFS permissions

#6 Post by dolphin_oracle »

yes thanks.

sorry use

Code: Select all

ls -la
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/

atomick

Re: BTRFS permissions

#7 Post by atomick »

brtfs mounts a tad different when setting a perma Mount Point to access the drive as "Space" Windows would call it a fully other added new drive by its letter or how you administer it. Same here. but instead of the letter assignment Linux can be taught what a user might like to call it.

as any directory type per a disk no matter can be called its mounted directory or "Mount Point" have you shared Gparted formatting yes its owned here by the format building as to be has to be root:root. But that is just a start we need the UUID and even thought part-UUID and Part-Label even /dev/sdb1 etc can be used Linux now loves likes
UUID without double quotes that you can get by lsblk or blkid -o list or simply blkid listings this will show all drives found by what is plugged into your mobo. So here a few steps that might show a solution "easy peezi like " Sorry this will be running a Terminal Shell Program as in Xfce-terminal command line ol school like.
ps: one caveat - if other disks types exists and are already set as ext4 the info for entry to /etc/fstab will be tad different as too after /bigDisk we have Filesystem Type ext4 would look like ext4 defaults,data=ordered 0 2
brtfs only will take perma mount as shown solely defaults 0 2 see below.

Code: Select all

 
sudo blkid 
/dev/sdb1: UUID="d8713fbe-d1a1-4ccf-9c9f-577b27df9007" UUID_SUB="2f1b3f25-9222-4645-8e5a-de06197cbdb9" BLOCK_SIZE="4096" TYPE="btrfs" PARTUUID="145e6af6-afdf-48d8-41bd-d7f1fc2fd321"
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cd /etc ; sudo cp fstab fstab.org
nano or vi / vim if you prone to like either we want to open a new line above swap swap  enter a mount-point and disk settings. 
UUID=d8713fbe-d1a1-4ccf-9c9f-577b27df9007 /bigDisk btrfs defaults 0 2     # here I created a new mount-pt called bigDisk  we would in terminal cd /  sudo mkdir bigDisk Note no double quotes when I copied from blkid output
write complete quite this edit of /etc/fstab
cd /
sudo mkdir bigDisk
sudo mount -a     # this will mount your new brtfs drive type does not matter as long we use the 1st long UUID as shown  this now ties the directory name with the disk drive. 
sudo chown -R xh1:xh1 /bigDisk     # can do without the 1st forward slash but gets the job done.   this now you own it from root 1st  build ownership
sudo chmod -R 755 /bigDisk           # if you are only to use this drive can set 760  inplay of 755 which is a common umask by user creation. 
cd /bigDisk
touch test 
ls -la    -- should see test
rm test
ls -al    -- no should see - your now up and its your drive to operate as normal. 

Steps to making it yours. 


xh1
Posts: 84
Joined: Sun Jan 16, 2022 12:40 pm

Re: BTRFS permissions

#8 Post by xh1 »

Code: Select all

demo@mx1:/media/demo/Backups
$ ls -la
total 16
drwxr-xr-x  1 root root  0 Jul 15 17:04 .
drwxr-x---+ 3 root root 60 Jul 17 11:40 ..
demo@mx1:/media/demo/Backups

xh1
Posts: 84
Joined: Sun Jan 16, 2022 12:40 pm

Re: BTRFS permissions

#9 Post by xh1 »

@atomick ,Thank you for replying. My Linux command line chops are less than minimal and I had a hard time following your instructions once it got to the nano/vi/vim part, of with I use non.

atomick

Re: BTRFS permissions

#10 Post by atomick »

See your using the new drive as temp or auto mount and not permanent mounted via a mount point.
Creating a mount point is at the root file system simply creating a Directory Name that you know to be your btrfs drive I simply exampled it via a name bigDisk
call it anything. the /etc/fstab file is where you tie the drive and directory name together via the UUID I underlined part of it, It is long as well I shared an example of my own
with what would be entered in the /etc/fstab file . This would make the drive always accessible fully recoverable via reboot and or startup boot.
the steps are pretty much start from blkid and entering this into the /etc/fstab as shown. ext4 formatted has slight difference in same entry that is all.
So Replace bigDisk with Backups and it is all the same. cmd mount -a can immediately access mount the drive without a reboot as like 'windows'

Post Reply

Return to “MX Help”