-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

  • Post this: lsblk -f Are these partitions you want to permanent mount with fstab when you reboot or occasionally mount just by clicking on them with file browser. – oldfred Mar 05 '22 at 19:39
  • well i dont find the square brackets so you are most likely seing the same as me only the link toward the image i took..i want them permanent mounted , i took the image to have each collum on top of each item properly, a copy paste was too messy – Benoit Lagace Mar 05 '22 at 19:59
  • Welcome, Benoit. What version of Ubuntu are you running? – Frobozz Mar 05 '22 at 20:36
  • 1
    I prefer labels, but you can use UUID to keep unique. You can use Disks, gparted or command line to add labels: https://askubuntu.com/questions/147319/how-can-i-give-other-drives-and-partitions-short-meaningful-names-in-nautilus or sudo e2label /dev/sdXY data or /dev/nvme0n1p1. You also need ownership & permissions. https://askubuntu.com/questions/1013677/storing-data-on-second-hdd-mounting & https://askubuntu.com/questions/1058756/installing-all-applications-on-a-ssd-disk-and-putting-all-files-on-hdd-disk & https://help.ubuntu.com/community/Fstab – oldfred Mar 05 '22 at 20:44

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
  • 689
  • Thanks alot !!! :) im sorry i had the window lowered it works great !! very appreciated – Benoit Lagace Mar 06 '22 at 01:14
  • i think i made one slight mistake adding the sync;sync after /ect/fstab on the same line, im not certain but now i seem to have UUID=sync in my Fstab (and thats now that i see your wise warning) hehe im guessing i have to enter the UUID manually in the file is there one UUID for the whole Pc or one per drive – Benoit Lagace Mar 06 '22 at 01:31