Score:0

I think i need a hand with my Gparted partitions, maybe mount-points + automounts?

ng flag

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

oldfred avatar
cn flag
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.
Benoit Lagace avatar
ng flag
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
Frobozz avatar
ng flag
Welcome, Benoit. What version of Ubuntu are you running?
oldfred avatar
cn flag
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
Score:0
ng flag

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
Benoit Lagace avatar
ng flag
Thanks alot !!! :) im sorry i had the window lowered it works great !! very appreciated
Benoit Lagace avatar
ng flag
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
Frobozz avatar
ng flag
Oooo. That is not slight. The UUID you want is assigned to the partitions (the drive has one too but that's another show ...). Make two backups of your /etc/fstab, edit one, deleting the lines with UUID:sync and post the edited copy here so we can check that it is in tact. DO NOT REBOOT! We need to make sure your root and boot partition entries are still intact.
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.