Skip to content

Commit

Permalink
v7.2 (#4340)
Browse files Browse the repository at this point in the history
+ DietPi-Drive_Manager | Revert to blkid for mounted filesystem type detection, as findmnt will show "fuseblk" for NTFS filesytems, which is a correct result but cannot be used in fstab or for mounting the drive: #4339
+ DietPi-Drive_Manager | Consequently avoid using blkid cache, as it may show outdated info and list drives which are not attached anymore.
+ DietPi-Drive_Manager | Add a code comment for all cases where we use the not recommended blkid tool and why it is required.
  • Loading branch information
MichaIng authored May 4, 2021
1 parent 8a70018 commit 0cf41b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Changes:
Fixes:
- Odroid XU4 | Resolved an issue where installs and possibly other tasks hang, because the device ran out of entropy. All Odroid XU4 system will have the unsupported hardware random generator daemon removed and the software HAVEGE daemon installed instead for entropy generation. Many thanks to @Speeedfire for reporting this issue: https://github.com/MichaIng/DietPi/issues/4318
- DietPi-Banner | Resolved an issue where the MOTD was not updated via daily cron job, if the banner settings have not been changed yet, hence no config file exists. Since the MOTD is enabled by default, it needs to be updated as well if the config file does not exist. Many thanks to @gorby-pranata for helping us discovering this issue: https://github.com/MichaIng/DietPi/pull/4292#issuecomment-830787256
- DietPi-Drive_Manager | Resolved an issue where NTFS (and potentially other) filesystems were not detected correctly, leading to failing mount attempts at boot. Many thanks to @NoLifer for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8971
- DietPi-LetsEncrypt | Resolved an issue with Lighttpd, where lighty-enable-mod or lighty-disable-mod failed, if the related config was already enabled or disabled, respectively. Many thanks to @staxfax for reporting this issue: https://github.com/MichaIng/DietPi/issues/4336
- DietPi-Software | Python 3: Resolved an issue where installing pip on Stretch systems failed, due to a changed download URL. Many thanks to @tfmeier for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8968
- DietPi-Software | Webmin: Resolved an issue where restarts from the web interface only stopped the service. Many thanks to @Burgess85 and @Keridos for reporting this issue: https://dietpi.com/phpbb/viewtopic.php?t=8839, https://github.com/MichaIng/DietPi/pull/4331
Expand Down
10 changes: 6 additions & 4 deletions dietpi/dietpi-drive_manager
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ $swap_mounts
# Physical?
if [[ -d '/sys/block/'${aDRIVE_SOURCE_DEVICE[$index]} ]]; then

aDRIVE_FSTYPE[$index]=$(findmnt -no FSTYPE "${aDRIVE_MOUNT_TARGET[$index]}")
# blkid is required here, as findmnt will show "fuseblk" for NTFS filesytems, which is a correct result but cannot be used in fstab or for mounting the drive.
aDRIVE_FSTYPE[$index]=$(blkid -s TYPE -o value -c /dev/null "${aDRIVE_MOUNT_SOURCE[$index]}")
[[ ${aDRIVE_FSTYPE[$index]} ]] && aDRIVE_ISFILESYSTEM[$index]=1

# Networked
Expand Down Expand Up @@ -267,7 +268,7 @@ $swap_mounts

done < <(df -a --output=source --exclude-type=tmpfs --exclude-type=ecryptfs --exclude-type=vboxsf --exclude-type=glusterfs | sed "\|^/dev/root$|c$G_ROOTFS_DEV" | mawk '/\// && !x[$0]++')

# Check blkid for unmounted filesystems
# Check blkid for unmounted filesystems: lsblk may be preferred in the future, but blkid has the benefit of showing only drives with filesystems, which is what we want.
while read -r line
do

Expand All @@ -293,10 +294,11 @@ $swap_mounts
aDRIVE_SOURCE_DEVICE[$index]=$(Return_Drive_Without_Partitions "${aDRIVE_MOUNT_SOURCE[$index]}")
[[ ${aDRIVE_MOUNT_SOURCE[$index]} == /dev/${aDRIVE_SOURCE_DEVICE[$index]} ]] || aDRIVE_ISPARTITIONTABLE[$index]=1
(( ${aDRIVE_ISPARTITIONTABLE[$index]} )) && aDRIVE_PART_UUID[$index]=$(lsblk -no PARTUUID "${aDRIVE_MOUNT_SOURCE[$index]}")
aDRIVE_FSTYPE[$index]=$(blkid -s TYPE -o value "${aDRIVE_MOUNT_SOURCE[$index]}")
# blkid needs to be used here, as lsblk does not work in containers.
aDRIVE_FSTYPE[$index]=$(blkid -s TYPE -o value -c /dev/null "${aDRIVE_MOUNT_SOURCE[$index]}")
[[ ${aDRIVE_FSTYPE[$index]} ]] && aDRIVE_ISFILESYSTEM[$index]=1

done < <(blkid -o device)
done < <(blkid -o device -c /dev/null)

# Find unformatted drives
# - Exclude mtdblock devices: https://github.com/MichaIng/DietPi/issues/2067#issuecomment-422400520
Expand Down

0 comments on commit 0cf41b4

Please sign in to comment.