Things have obviously gotten very confusing, if even the more experienced members are having trouble identifying the breakdown and what to fix. So ...
Let's go back to some basic steps and work from the ground up.
First, let's pinpoint the device and get its name, if it has one. That way, we will know we are dealing with the correct device.
Requirement #1
We need the fullpath to the mountpoint, i.e.
-
/mountDir
(normal form for non-root partitions on same device as root), or
-
/site/mountDir
(my preferred for non-root devices/partitions), or
-
/media/userid/mountDir
(system-preferred for plug-n-play auto-mount devices/partitions)
/mnt is NOT the location for a user-defined/-named mountpoint directory. That is used strictly for system internal action.
Requirement #2
Provide report from
ls -l /dev/${deviceFile}
Requirement #3
As part of getting that clarity on the situation at hand, let's get a list of ALL your devices and what is know for each of them.
Can you please provide the output of the following script?
Please provide the output from the command
Devices__ReportDiskParts.sh --raw
for the following script:
#!/bin/sh
###
### $Id: Devices__ReportDiskParts.sh,v 1.7 2021/02/20 02:43:37 root Exp root $
###
### Script to report all partitions that detected by the system.
###
TMP=/tmp/`basename $0 ".sh" `.tmp
doFSTAB=0
while [ $# -gt 0 ]
do
case $1 in
"--fstab" ) doFSTAB=1 ; break ;;
"--disk" ) lsblk -l -p --output-all | awk '/[/]dev[/]sd[a-z][0-9]/ { print $0 }' | sort --key=3 | awk '{ printf("%s\n\n", $0 ) ; }' ; exit 0 ;;
"--pairs" ) lsblk -p -P --output-all | awk '/[/]dev[/]sd[a-z][0-9]/ { print $0 }' | sort --key=3 | awk '{ printf("%s\n\n", $0 ) ; }' ; exit 0 ;;
"--raw" ) lsblk -l -p --output-all | sort --key=3 | awk '{ printf("%s\n\n", $0 ) ; }' ; exit 0 ;;
* ) echo "\n\t Invalid parameter '$1' used on command line. Only options allowed: [ --raw | --disk | --fstab ]\n Bye!\n" ; exit 1 ;;
esac
done
if [ -z "${MROOT}" ]
then
MROOT="/site" ; export MROOT
fi
pROOT=`df / | grep '/dev/' | awk '{ print $1 }' `
dROOT=`echo ${pROOT} | cut -c1-8 `
# If not terminal redirect comments to stderr.
if [ -t 1 ] ; then echo "\n\t NOTE: Expected mount point parent for all partitions not on root device => '$MROOT' ..." ; fi
#if [ ! -t 1 ] ; then echo "\n\t NOTE: Expected mount point parent for all partitions not on root device => '$MROOT' ..." >&2 ; fi
###
### All available parameters for lsblk (based on lsblk from util-linux 2.31.1)
###
### In sort order reported by --output-all
###
#1 NAME
# KNAME
# MAJ:MIN
#2 FSTYPE
#5 MOUNTPOINT
#ALT3 LABEL
#4 UUID
# PARTTYPE
#3 PARTLABEL
# PARTUUID
# PARTFLAGS
# RA
# RO
# RM
# HOTPLUG
# MODEL
# SERIAL
#6 SIZE
# STATE
# OWNER
# GROUP
# MODE
# ALIGNMENT
# MIN-IO
# OPT-IO
# PHY-SEC
# LOG-SEC
# ROTA
# SCHED
# RQ-SIZE
# TYPE
# DISC-ALN
# DISC-GRAN
# DISC-MAX
# DISC-ZERO
# WSAME
# WWN
# RAND
# PKNAME
# HCTL
# TRAN
#7 SUBSYSTEMS
# REV
# VENDOR
# ZONED
#lsblk -l -p -o NAME,FSTYPE,PARTLABEL,UUID,SIZE,MOUNTPOINT,SUBSYSTEMS | grep -v 'GRUB' | awk '/[/]dev[/]sd[a-z][0-9]/ { print $0 }' | sort --key=3 > ${TMP}.lsblk
#cat ${TMP}.lsblk
#cat ${TMP}.lsblk | awk '{ print NF }'
lsblk -P -p -o NAME,FSTYPE,PARTLABEL,UUID,SIZE,MOUNTPOINT,SUBSYSTEMS | grep -v 'GRUB' | awk '/[/]dev[/]sd[a-z][0-9]/ { print $0 }' | sort --key=3 > ${TMP}.lsblk.PAIRS
#cat ${TMP}.lsblk.PAIRS
while read line
do
eval echo '${line}' | tr ' ' "\n" |
{ fTYPE=""
while read data
do
eval echo '${data}' | awk -F'"' -v ftype="${fTYPE}" '{
split($1, vars, "=" ) ;
Fname=vars[1] ;
# Fval=vars[2] ;
Fval=$2 ;
if( Fval == "" ){
Fval="null" ;
} ;
printf("%s ", Fval) ;
# printf("%s|%s ", Fname, Fval) ;
}'
# case ${data} in
# FSTYPE* ) fTYPE="USB" ;;
# * ) ;;
# esac
done
}
echo ""
done <${TMP}.lsblk.PAIRS >${TMP}.lsblk
#cat ${TMP}.lsblk
#cat ${TMP}.lsblk | awk '{ print NF }'
## WD 4 TB My Book
#----------------------------------------------------------------------------------------------------------------------
#/dev/sdb1 on /site/My Book type exfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,iocharset=utf8,namecase=0,errors=remount-ro,uhelper=udisks2)
### 1,4,9,7,5,18
#----------------------------------------------------------------------------------------------------------------------
### /dev/sdb1 exfat My Book Not_Mounted /My
#/dev/sdb1 /dev/sdb1 /dev/sdb1 8:17 3.7T 3.7T exfat 6M 0% /site/My Book My Book 40FA-E56B fc843c51-1aec-4aab-8676-9043c9e59d0d atari ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 My Book 4c1ee663-135c-4809-a61e-f38ec52d80a7 128 0 0 1 3.7T root disk brw-rw---- 0 4096 0 4096 512 1 mq-deadline 2 part 0 4K 4G 0 0B 1 /dev/sdb block:scsi:usb:pci none
#----------------------------------------------------------------------------------------------------------------------
### /dev/sde3 ext4 DB002_F1 1b4157be-79cd-472b-96d9-a4cabacaffe1 Not_Mounted /site/DB002_F1
#/dev/sde3 /dev/sde3 /dev/sde3 8:67 ext4 DB002_F1 1b4157be-79cd-472b-96d9-a4cabacaffe1 9a3649a5-cbbb-4f1b-ae0b-f3c0d9cdec21 dos c12a7328-f81f-11d2-ba4b-00a0c93ec93b DB002_F1 a9b2eda8-ec21-4999-b1f6-eab36ce3bf75 128 0 0 0 279.4G root disk brw-rw---- 0 4096 0 4096 512 1 mq-deadline 64 part 0 0B 0B 0 0B 0x50014ee263b2c636 1 /dev/sde block:scsi:pci none
#----------------------------------------------------------------------------------------------------------------------
#----------------------------------------------------------------------------------------------------------------------
### **** ERROR **** Not handling 'My Passport' condition correctly
###
### Reporting as follows:
### /dev/sde1 ntfs My null Mounted 1.8T /media/ericthered/My
#----------------------------------------------------------------------------------------------------------------------
if [ ${doFSTAB} -eq 0 ]
then
if [ -t 1 ] ; then echo "\n\t ALL recognized DISK partitions:\n" ; fi
#if [ ! -t 1 ] ; then echo "\n\t ALL recognized DISK partitions:\n" >&2 ; fi
cat ${TMP}.lsblk | awk -v othrPath=${MROOT} -v dROOT="${dROOT}" '{
if ( $6 == "null" ){
if ( $2 == "swap" ){
printf("%-12s %-8s %-10s %-38s %-13s %-30s %s\n", $1, $2, $3, $4, "Not_Enabled", "[SWAP_OFFLINE]", $7 ) ;
}else{
if ( index($1,dROOT) == 0 ){
thatPath=sprintf("%s/%s", othrPath, $3 ) ;
printf("%-12s %-8s %-10s %-38s %-13s %-30s %s\n", $1, $2, $3, $4, "Not_Mounted", thatPath, $7 ) ;
}else{
thatPath=sprintf("/%s", $3 ) ;
printf("%-12s %-8s %-10s %-38s %-13s %-30s %s\n", $1, $2, $3, $4, "Not_Mounted", thatPath, $7 ) ;
} ;
} ;
}else{
if ( $2 == "swap" ){
printf("%-12s %-8s %-10s %-38s %-13s %-30s %s\n", $1, $2, $3, $4, "Enabled", $6, $7 ) ;
}else{
printf("%-12s %-8s %-10s %-38s %-13s %-30s %s\n", $1, $2, $3, $4, "Mounted", $6, $7 ) ;
} ;
} ;
}'
else
if [ -t 1 ] ; then echo "\n\t ALL recognized DISK partitions reported in format required to update '/etc/fstab':\n" ; fi
#if [ ! -t 1 ] ; then echo "\n\t ALL recognized DISK partitions reported in format required to update '/etc/fstab':\n" >&2 ; fi
#/dev/sdd1 ext4 DB002_F1 0aa50783-954b-4024-99c0-77a2a54a05c2 300G /site/DB002_F1
#UUID=f56b6086-229d-4c17-8a5b-e68de1a4e73d / ext4 errors=remount-ro 0 1
#UUID=7e9a663e-ff1d-4730-8544-c37519056b6f /DB001_F2 ext4 nosuid,nodev,nofail,errors=remount-ro 0 2
#UUID=c37e53cd-5882-401c-8ba3-172531a082e9 none swap sw,pri=3 0 0
###
### FUTURES: USB options rw,suid,umask=0000,uid=1000,gid=1000
###
cat ${TMP}.lsblk | awk -v othrPath=${MROOT} -v pROOT="${pROOT}" -v dROOT="${dROOT}" '{
if( index( $0, "usb" ) != 0 ){
usbPlug="USB_EXTERNAL" ;
}else{
usbPlug="INTERNAL" ;
} ;
if ( $6 == "null" ){
if ( $2 == "swap" ){
if ( $1 == pROOT ) {
perms="sw,pri=1" ;
seq=1 ;
}else{
perms="sw,pri=2" ;
seq=2 ;
} ;
if( $4 == "null" ){
printf("### %s ### No value for UUID. No file system on this partition.\n\n", $3 ) ;
}else{
printf("# %-12s %-8s %-10s %-38s %-13s %s %s\n", $1, $2, $3, $4, $5, "[SWAP]", usbPlug ) ;
printf("UUID=%s \t%s \t%s \t%s \t%s \t%s\n\n", $4, "none", $2, perms, "0", seq ) ;
} ;
}else{
if ( $1 == pROOT ) {
perms="defaults" ;
seq=0 ;
}else{
#perms="nosuid,nodev,nofail,defaults" ;
if( usbPlug == "USB_EXTERNAL" ){
perms="defaults,nofail,noauto" ;
}else{
perms="defaults,nofail" ;
} ;
if ( $1 ~ dROOT ) { seq=1 ; }else{ seq=2 ; } ;
} ;
if( $4 == "null" ){
printf("### %s ### No value for UUID. No file system on this partition.\n\n", $3 ) ;
}else{
if ( index($1,dROOT) == 0 ){
printf("# %-12s %-8s %-10s %-38s %-13s %s/%s %s\n", $1, $2, $3, $4, $5, othrPath, $3, usbPlug ) ;
printf("UUID=%s \t%s/%s \t%s \t%s \t%s \t%s\n\n", $4, othrPath, $3, $2, perms, "0", seq ) ;
}else{
printf("# %-12s %-8s %-10s %-38s %-13s /%s %s\n", $1, $2, $3, $4, $5, $3, usbPlug ) ;
printf("UUID=%s \t/%s \t%s \t%s \t%s \t%s\n\n", $4, $3, $2, perms, "0", seq ) ;
} ;
} ;
} ;
}else{
if ( $2 == "swap" ){
if ( $1 == pROOT ) {
perms="sw,pri=1" ;
seq=1 ;
}else{
perms="sw,pri=2" ;
seq=2 ;
} ;
if( $4 == "null" ){
printf("### %s ### No value for UUID. No file system on this partition.\n\n", $3 ) ;
}else{
printf("# %-12s %-8s %-10s %-38s %-13s %s %s\n", $1, $2, $3, $4, $5, $6, usbPlug ) ;
printf("UUID=%s \t%s \t%s \t%s \t%s \t%s\n\n", $4, "none", $2, perms, "0", seq ) ;
};
}else{
if ( $1 == pROOT ) {
perms="defaults" ;
seq=0 ;
}else{
#perms="nosuid,nodev,nofail,defaults" ;
if( usbPlug == "USB_EXTERNAL" ){
perms="defaults,nofail,noauto" ;
}else{
perms="defaults,nofail" ;
} ;
if ( $1 ~ dROOT ) { seq=1 ; }else{ seq=2 ; } ;
} ;
if( $4 == "null" ){
printf("### %s ### No value for UUID. No file system on this partition.\n\n", $3 ) ;
}else{
printf("# %-12s %-8s %-10s %-38s %-13s %s %s\n", $1, $2, $3, $4, $5, $6, usbPlug ) ;
printf("UUID=%s \t%s \t%s \t%s \t%s \t%s\n\n", $4, $6, $2, perms, "0", seq ) ;
};
} ;
} ;
}'
fi
# Other command format for other properties related to partitions:
# lsblk -o NAME,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED,RQ-SIZE,RA,WSAME
# Other option which is not as complete:
# blkid -o list
if [ -t 1 ] ; then echo "\n\t Done. [`basename $0 `]\n" ; fi
#if [ ! -t 1 ] ; then echo "\t Done. [`basename $0 `]\n" >&2 ; fi
rm -f ${TMP}.*
exit 0
exit 0
exit 0
If you prefer, limit the sharing of the output to only the line relevant to the device in question.
Recommendation
If the offending partitions do not have a Partition Label, please consider giving those partitions a unique label. VERY IMPORTANT: as always, ensure you have full backup of that data before attempting to assign that label via "gparted". The partition must be un-mounted in order to give it a label.