Question about dietpi-backup, usb drive and ext4 format

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
skyfly555
Posts: 81
Joined: Tue Nov 17, 2015 12:16 pm

Question about dietpi-backup, usb drive and ext4 format

Post by skyfly555 »

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

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

Code: Select all

df -h
, unmounted with

Code: Select all

umount /dev/sda1
and formatted with

Code: Select all

mkfs.ext4 /dev/sda1
. Then I can go into it in

Code: Select all

/mnt/usb_1
.

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 "

Code: Select all

/etc/fstab
" and uncommenting the line:

Code: Select all

/dev/sda1       /mnt/usb_1      ext4    defaults,noatime,nofail  0       0
And commenting the line:

Code: Select all

#/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

Code: Select all

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,
skyfly555
Posts: 81
Joined: Tue Nov 17, 2015 12:16 pm

Re: Question about dietpi-backup, usb drive and ext4 format

Post by skyfly555 »

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

Code: Select all

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]
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Question about dietpi-backup, usb drive and ext4 format

Post by Fourdee »

skyfly555 wrote:df -has said it's only used 60 M when it should be 1 G approx.
Sounds like you didn't clear the partition table before formatting

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

Code: Select all

		#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:

Code: Select all

/DietPi/dietpi/dietpi-external_drive_setup
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
skyfly555
Posts: 81
Joined: Tue Nov 17, 2015 12:16 pm

Re: Question about dietpi-backup, usb drive and ext4 format

Post by skyfly555 »

Thank you very much.

Perfect!
Post Reply