I did something wrong with the Drive Manager...

Hi all, I’m using an external USB connected to my Raspberry. Today I formatted the HDD, probably in the wrong way, and now I have two items in my external disk list: loop0 (I think a mounting point) and sda. I think before formatting, the name of the disk was sda1 or something like that and was in the right size (over 700gb) but now is showing only 3.2 mb. How can I delete these two items and format correctly my HDD? Thanks in advance
dietpidrivemanager1.png

can you share following

lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid

Thank for the prompt reply. Here it is:

root@DietPi:~# lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid
NAME        FSTYPE LABEL   SIZE RO TYPE MOUNTPOINT PARTUUID                             UUID
loop0       exfat          5.2M  0 loop /mnt/plex                                       FEE4-B43D
sda                      698.6G  0 disk
└─sda1      exfat        698.6G  0 part                                                 EFF7-B674
mmcblk0                  119.3G  0 disk
├─mmcblk0p1 vfat           128M  0 part /boot      9bcc366d-01                          3718-9869
└─mmcblk0p2 ext4         119.1G  0 part /          9bcc366d-02                          ecc48f57-d6f8-42a3-b123-152334699793

Your HDD is still there, but it is not mounted actually. It’s the sda device, formated with a exfat file system. Was this intended to have your HDD formatted like this?

The very small loop0 device is some kind of virtual disk. It’s not a real physical drive.

Yes, I need exfat because I also plan to use with Samba on my Windows. From the drive manager I cannot mount it because it says it doesn’t have a filesystem.

For using SAMBA you don’t need exfat. Samba will do the translation between a Linux file system like ext4 and Windows. I recommend to format your HDD with ext4, install SAMBA server and mount the Samba share on Windows.

I tried, but I get an error:

  • Command: mkfs.ext4 -F -m 0 /dev/sda1 │
    │ - Exit code: 1 │
    │ - DietPi version: v8.1.2 (MichaIng/master) | HW_MODEL: 3 | HW_ARCH: 3 | DISTRO: 6 │
    │ - Image creator: DietPi Core Team │
    │ - Pre-image: from scratch │
    │ - Error log: │
    │ mke2fs 1.46.2 (28-Feb-2021) │
    │ Found a dos partition table in /dev/sda1 │
    │ /dev/sda1 is mounted; will not make a filesystem here!

Is there any way to reset all the mounting point and the mess that I did with dietpi or do I need to reinstall dietpi? It doesn’t detect the full size of my HDD and I would like to reset all I did.

no need to reinstall DietPi as your HDD is the challange, not DietPi. Your disk is fully detected.

sda                      698.6G  0 disk
└─sda1      exfat        698.6G  0 part                                                 EFF7-B674

Can you share following

cat /etc/fstab



root@DietPi:~# root@DietPi:~# cat /etc/fstab
# You can use "dietpi-drive_manager" to setup mounts.
# NB: It overwrites and re-creates physical drive mount entries on use.
#----------------------------------------------------------------
# NETWORK
#----------------------------------------------------------------


#----------------------------------------------------------------
# TMPFS
#----------------------------------------------------------------
tmpfs /tmp tmpfs size=1024M,noatime,lazytime,nodev,nosuid,mode=1777
tmpfs /var/log tmpfs size=50M,noatime,lazytime,nodev,nosuid,mode=1777

#----------------------------------------------------------------
# MISC: ecryptfs, vboxsf, glusterfs, bind, Btrfs subvolume mounts
#----------------------------------------------------------------


#----------------------------------------------------------------
# SWAP SPACE
#----------------------------------------------------------------
/var/swap none swap sw

#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
PARTUUID=9bcc366d-02 / ext4 noatime,lazytime,rw 0 1
PARTUUID=9bcc366d-01 /boot vfat noatime,lazytime,rw 0 2
UUID=a624b184-c4b1-4683-b6a9-6c3715cfc62a /mnt/a624b184-c4b1-4683-b6a9-6c3715cfc62a ext4 noatime,lazytime,rw,nofail,noauto,x-systemd.automount
root@DietPi:~#

there seems to be a leftover in /etc/fstab. Can you remove the last line if not needed

UUID=a624b184-c4b1-4683-b6a9-6c3715cfc62a /mnt/a624b184-c4b1-4683-b6a9-6c3715cfc62a ext4 noatime,lazytime,rw,nofail,noauto,x-systemd.automount

To clear your HDD and to create a ext4 file system, do following

reboot
dd if=/dev/zero of=/dev/sda1 bs=4K count=1337
mkfs.ext4 -F -m 0 /dev/sda1

It works like a charm, Mr. Thank you very much! I have also another question for the external USB drives, hows possible to put always one the read/write permissions? I noticed that sometimes the drive goes into Read Only mode if I start a new putty ssh session a few days later.

There is something wrong with the drive or the connection to the drive if it goes into read-only mode. Usually the drive should be writable all the time. If this happen, have a look to kernel error messages.

dmesg -l err,crit,alert,emerg

How is the drive powered? Does it have a dedicated PSU? Or just powered by the SBC?

It’s a fairly old USB 1.0 (I guess) self powered External HDD of around 700GB. Is very slow but it does the job for all my movies on the Plex Server. I have a much bigger Nas with 2.0 USB in another house and I cannot retrieve in these days. Here is the message I get after executing the command you gave me:

[    6.541223] sd 0:0:0:0: [sda] No Caching mode page found
[    6.541240] sd 0:0:0:0: [sda] Assuming drive cache: write through

no issues yet. But keep an eye on kernel errors as soon your disk is going into read only.