AMD Smart Access memory configuration

Recently upgraded my bios since i wanted to try smart access memory. After a headache of being unable to find my Linux boot partition, i determined i can't have CSM mode and Re-size BAR support on at the same time. This is a problem since i cant access my Linux boot drive without CSM enabled. Is there a way to configure an EFI partition for my current BTFS installation?

command:

garuda-inxi

System:
  Kernel: 5.18.16-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.1.1
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=052b08b6-4b04-4770-b2cb-31b98943efb3 rw rootflags=subvol=@
    quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
    systemd.unified_cgroup_hierarchy=1
    resume=UUID=2f66aad3-a3c1-4519-b2dc-f69f7a762c10 loglevel=3 ibt=off
  Desktop: N/A wm: LG3D vt: 1 dm: SDDM Distro: Garuda Linux
    base: Arch Linux
Machine:
  Type: Desktop Mobo: Micro-Star model: MPG X570 GAMING PLUS (MS-7C37) v: 2.0
    serial: <superuser required> BIOS: American Megatrends LLC. v: A.H0
    date: 05/19/2022
CPU:
  Info: model: AMD Ryzen 5 3600X bits: 64 type: MT MCP arch: Zen 2 gen: 3
    built: 2020-22 process: TSMC n7 (7nm) family: 0x17 (23)
    model-id: 0x71 (113) stepping: 0 microcode: 0x8701021
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 3 MiB desc: 6x512 KiB
    L3: 32 MiB desc: 2x16 MiB
  Speed (MHz): avg: 3597 high: 3602 min/max: 2200/4409 boost: enabled
    scaling: driver: acpi-cpufreq governor: performance cores: 1: 3599 2: 3599
    3: 3597 4: 3596 5: 3598 6: 3601 7: 3602 8: 3588 9: 3597 10: 3599 11: 3593
    12: 3598 bogomips: 91197
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  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: retbleed mitigation: untrained return thunk; SMT enabled with STIBP
    protection
  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: Retpolines, IBPB: conditional, STIBP:
    always-on, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: AMD Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] vendor: Sapphire
    driver: amdgpu v: kernel arch: RDNA-2 code: Navi-2x process: TSMC n7 (7nm)
    built: 2020-22 pcie: gen: 4 speed: 16 GT/s lanes: 16 ports:
    active: DP-2,HDMI-A-1 empty: DP-1,DP-3 bus-ID: 2f:00.0 chip-ID: 1002:73bf
    class-ID: 0300
  Display: x11 server: X.Org v: 21.1.4 with: Xwayland v: 22.1.3
    compositor: Picom v: git-c4107 driver: X: loaded: amdgpu gpu: amdgpu
    display-ID: :0 screens: 1
  Screen-1: 0 s-res: 4480x1440 s-dpi: 96 s-size: 1185x381mm (46.65x15.00")
    s-diag: 1245mm (49.01")
  Monitor-1: DP-2 mapped: DisplayPort-1 pos: primary,left model: LG
    (GoldStar) 27GL850 serial: <filter> built: 2020 res: 2560x1440 hz: 144
    dpi: 109 gamma: 1.2 size: 597x336mm (23.5x13.23") diag: 685mm (27")
    ratio: 16:9 modes: max: 2560x1440 min: 640x480
  Monitor-2: HDMI-A-1 mapped: HDMI-A-0 pos: right model: LG (GoldStar)
    23EA63 built: 2012 res: 1920x1080 hz: 60 dpi: 96 gamma: 1.2
    size: 510x290mm (20.08x11.42") diag: 587mm (23.1") ratio: 16:9 modes:
    max: 1920x1080 min: 640x480
  OpenGL: renderer: AMD Radeon RX 6800 (sienna_cichlid LLVM 14.0.6 DRM 3.46
    5.18.16-zen1-1-zen) v: 4.6 Mesa 22.1.4 direct render: Yes
Audio:
  Device-1: AMD Navi 21/23 HDMI/DP Audio driver: snd_hda_intel v: kernel
    pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 2f:00.1 chip-ID: 1002:ab28
    class-ID: 0403
  Device-2: AMD Starship/Matisse HD Audio vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: 31:00.4 chip-ID: 1022:1487 class-ID: 0403
  Sound Server-1: ALSA v: k5.18.16-zen1-1-zen running: yes
  Sound Server-2: JACK v: 1.9.21 running: no
  Sound Server-3: PulseAudio v: 16.1 running: no
  Sound Server-4: PipeWire v: 0.3.56 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Micro-Star MSI X570-A PRO driver: r8169 v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 port: d000 bus-ID: 27:00.0 chip-ID: 10ec:8168
    class-ID: 0200
  IF: enp39s0 state: up speed: 100 Mbps duplex: full mac: <filter>
Drives:
  Local Storage: total: 6.38 TiB used: 383.12 GiB (5.9%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: SSD 970 EVO Plus
    2TB size: 1.82 TiB block-size: physical: 512 B logical: 512 B
    speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter> rev: 2B2QEXM7
    temp: 49.9 C scheme: GPT
  ID-2: /dev/nvme1n1 maj-min: 259:5 vendor: Samsung model: SSD 970 EVO
    500GB size: 465.76 GiB block-size: physical: 512 B logical: 512 B
    speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter> rev: 2B2QEXE7
    temp: 44.9 C scheme: MBR
  ID-3: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 850 PRO 512GB
    size: 476.94 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 2B6Q scheme: MBR
  ID-4: /dev/sdb maj-min: 8:16 vendor: Western Digital
    model: WD4000FYYZ-01UL1B2 size: 3.64 TiB block-size: physical: 512 B
    logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 7200 serial: <filter>
    rev: 1K03 scheme: MBR
Partition:
  ID-1: / raw-size: 431.26 GiB size: 431.26 GiB (100.00%) used: 383.12 GiB
    (88.8%) fs: btrfs dev: /dev/nvme1n1p1 maj-min: 259:6
  ID-2: /home raw-size: 431.26 GiB size: 431.26 GiB (100.00%) used: 383.12
    GiB (88.8%) fs: btrfs dev: /dev/nvme1n1p1 maj-min: 259:6
  ID-3: /var/log raw-size: 431.26 GiB size: 431.26 GiB (100.00%) used: 383.12
    GiB (88.8%) fs: btrfs dev: /dev/nvme1n1p1 maj-min: 259:6
  ID-4: /var/tmp raw-size: 431.26 GiB size: 431.26 GiB (100.00%) used: 383.12
    GiB (88.8%) fs: btrfs dev: /dev/nvme1n1p1 maj-min: 259:6
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: zram size: 31.27 GiB used: 512 KiB (0.0%)
    priority: 100 dev: /dev/zram0
  ID-2: swap-2 type: partition size: 34.5 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/nvme1n1p2 maj-min: 259:7
Sensors:
  System Temperatures: cpu: 45.8 C mobo: N/A gpu: amdgpu temp: 66.0 C
    mem: 62.0 C
  Fan Speeds (RPM): N/A gpu: amdgpu fan: 0
Info:
  Processes: 341 Uptime: 5m wakeups: 0 Memory: 31.27 GiB used: 3.41 GiB
  (10.9%) Init: systemd v: 251 default: graphical tool: systemctl
  Compilers: gcc: 12.1.1 Packages: pacman: 2021 lib: 481 flatpak: 0
  Shell: fish v: 3.5.1 default: Bash v: 5.1.16 running-in: alacritty
  inxi: 3.3.20
Garuda (2.6.5-1):
  System install date:     2022-01-01
  Last full system update: 2022-08-08 ↻
  Is partially upgraded:   No
  Relevant software:       NetworkManager
  Windows dual boot:       <superuser required>
  Snapshots:               Timeshift
  Failed units:            bluetooth-autoconnect.service

Yes that is possible. I know one method using gdisk, although not fully safe (I have had an issue once) and it requires to manually modify a few other system files.

There are various tutorials on the web about this, for Converting MBR to GPT partition table without losing your data (I assume you DON'T want to lose it).

The above method means that you basically are on your own, since you have to take into account all the small details that make your existing system boot and recreate what's required for you as a GPT/UEFI setup.

I highly suggest to somehow test the method before you actually do it on your primary disk.

I am not aware of another method as I could find my ways around with this one (I created my own tutorial for my specific installation), but to answer your question yes it is possible, even though I do not recommend gdisk for newbies.

Let's see if others have better ideas for less expert users. :crossed_fingers:

1 Like

UEFI can work on MBR disks similar to how it works on GPT disks. Shrink your BTRFS partition by 500 MiB, create a FAT32 partition, (primary if possible) mount it to /boot/efi and install GRUB with

sudo grub-install --efi-directory=/boot/efi --boot-directory=/boot --target=x86_64-efi --removable

The important part is –removable, it will install GRUB to default directory so UEFI can find it even if we cannot add GRUB to boot menu.
After installing GRUB, reboot, disable CSM (or boot straight into UEFI GRUB if possible) and if boot succeeds, add an entry to /etc/fstab for the EFI partition.

6 Likes

I am going to dd this drive before i progress any further in shrinking my partition. Would it be an issue if the EFI partition was on /dev/nvme1n1p3? As for configuring fstab, it looks like a have a good reference for the file since my laptop install was UEFI only and has the EFI config.

No problem. You can go ahead.

Everything works as expected. Thank you.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.