Question about dietpi-backup, usb drive and ext4 format

It’s needed a USB drive with ext4 format to use dietpi-backup.

So I’ve taken my vfat usb drive, ubicated with

df -h

, unmounted with

umount /dev/sda1

and formatted with

mkfs.ext4 /dev/sda1

. Then I can go into it in



What happens:
1- Maybe dietpi-backup says it’s read only.
2- Maybe during the formatting process I get an error.

I’ve tried, after formatting it, edit "


" and uncommenting the line:

/dev/sda1       /mnt/usb_1      ext4    defaults,noatime,nofail  0       0

And commenting the line:

#/dev/sda1       /mnt/usb_1      vfat    defaults,noatime,nofail       0       0

And, after that, rebooting.

The time the process has gone better, the USB drive has been formatted without any error messages, dietpi-backup supposedly has done its job and the pendrive has been detected after dietpi-backup, but

df -h

has said it’s only used 60 M when it should be 1 G approx.
After rebooting, the pendrive hasn’t been detected.

I’ve read on forums than they talk about permissions and so on, but I don’t know what I’m doing wrong.

Please, can you give me some light? I suppose I’m not formatting the USB drive correctly.

Thank you very much,

Looking at /var/log/dietpi-backup.log, it ends:

2016/02/25 17:56:00 [2668] rsync: write failed on "/mnt/usbdrive/build/php5-5.6.17+dfsg/pear-build-download/turba-4.2.12.tgz": Input/output error (5)
2016/02/25 17:56:00 [2668] rsync: failed to set times on "/mnt/usbdrive/build/php5-5.6.17+dfsg/pear-build-download/.turba-4.2.12.tgz.NK7Ilf": Read-only file system (30)
2016/02/25 17:56:00 [2668] rsync: rename "/mnt/usbdrive/build/php5-5.6.17+dfsg/pear-build-download/.turba-4.2.12.tgz.NK7Ilf" -> "build/php5-5.6.17+dfsg/pear-build-download/turba-4.2.12.t$
2016/02/25 17:56:00 [2668] rsync error: error in file IO (code 11) at receiver.c(393) [receiver=3.1.1]

Sounds like you didn’t clear the partition table before formatting

Heres the code that /DietPi/dietpi/dietpi-external_drive_setup uses:

		#Unmount all connected drives
		umount /dev/sd[a-z][1-9]
		#Clear MBR and partition table from device
		dd if=/dev/zero of=/dev/sda bs=512 count=1

		#Create New partition on /dev/sda
		echo -e "o\nn\np\n1\n\n\nw" | fdisk /dev/sda

		#Format ext4
		umount /dev/sd[a-z][1-9]
		echo -e "y" | mkfs.ext4 /dev/sda1
		resize2fs /dev/sda1
		mount -a
		chown -R root:root /mnt/usb_1

You can also run the following script to format/setup your USB drive:


Thank you very much.