-2

Hello Im looking to a simple way of using my 2 empty partitions i did format with Gparted, They seem unmounted and im not very sure about setting up the mount points and auto-mount, Im just arriving from windows and im not looking back. Anyone can help ? ( for the details they are lone partitions on their disks boot and system swap was made on a third disk.

!{Listimage}(https://pasteboard.co/oUmywe1f8TuK.png) LSBLK -F yes i woul like to have them permanent @oldfred

1 Answers1

0

Welcome to Linux, Benoit!

Just a reminder, there are no safety nets in linux.

Always make a backup!

The following Bash commands will do what you ask. Be certain the partitions are correct for your environment in the "for vol ..." line.

# Become super user - "danger Will Robinson!"
sudo su

Make backup fstab - in case things go bad

cp /etc/fstab /tmp/fstab.bkup

Make temporary target fstab

cp /etc/fstab /tmp/fstab.tmp

Create mount points and fstab entries

Volume names will vary - use 'lsblk -f' to find yours

for vol in sda1 nvme0n1p1 do mkdir -p /mnt/$vol UUID=$(lsblk -fno UUID /dev/$vol) printf "UUID=%s\t/mnt/%s\text4\tdefaults\t0\t2\n" $UUID $vol >> /tmp/fstab.tmp done

Check that /tmp/fstab.tmp looks good. That is identical to /etc/fstab but with the additional lines added for the new partitions. If all looks good:

cp /tmp/fstab.tmp /etc/fstab
sync;sync
mount -a
exit
Frobozz
  • 719