I’m formatting a USB disk for backup using the backup application: rear
The formatting is really slow and I’m wondering if there is a quickformat option within Ubuntu that I might be able to use instead of rear to prepare the disk.
The disk is being formatted with the ext3 filesystem.
In Windows there is a quickformat option for NTFS partitions and I’m wondering if there is something similar for mkfs (not that I can see it though)
@VeeDub I just looked into manual page. There is no such thing as a ‘quick’ format for the ext4/ext3 file system. Such option is only available for ntfs and fat32 filesystem under Linux. The mkfs.ext4 is much faster tho. May I know your USB disk size? Is it bigger than 4TB?
I’ve just noticed, that according to GParted the disk has been formatted with ext4, despite the fact that rear reported that the partition was formatted with ext3.
Not sure if this matters, but reporting it, in case it is relevant.
lazy_itable_init[= <0 to disable, 1 to enable>]
If enabled and the uninit_bg feature is enabled, the inode table will not be fully initialized by mke2fs. This speeds up filesystem initialization noticeably, but it requires the kernel to finish initializing the filesystem in the background when
the filesystem is first mounted. If the option value is omitted, it defaults to 1 to enable lazy inode table zeroing.
So when you mount the disk first time it will initialize creating those inodes. That is all I can think. Try it out.
I’ve had a look both at disks and gparted, and I’m having trouble working out how I can setup another bootable USB disk with the same properties as the one prepared by rear.
Here are the two partitions on the existing disk that were created by the rear setup
What I want to try and do is work out a way that I can setup a 2nd disk with the same properties where the data volume is setup quickly. I don’t know how exactly rear is formatting the data partition, but it is taking hours!
I want to see if I can create and format the data partition in some other way that doesn’t check all the sectors, write 0’s or whatever it is doing.
You can copy the partition table layout of a whole disk using standard tools named sfdisk. For example, if device is /dev/sda and want to copy that to /dev/sdb, then. Make a copy:
# *******************************************
# !!! WARNING !!!
# BE CAREFUL WITH DEVICE NAMEs
# *******************************************
sudo sfdisk -d /dev/sda > sda.part.copy.txt
There here is how to restore keeping the same disk and partition IDs to the /dev/sdb:
# *******************************************
# !!! WARNING !!!
# BE CAREFUL WITH DEVICE NAMEs
# *******************************************
sudo sfdisk /dev/sdb < sda.part.copy.txt
## OR ##
sudo sfdisk -f /dev/sdb < sda.part.copy.txt
Of course, partition table replication is possible with one command as the root user when you wish to keep the same partitions and IDs:
sfdisk -d /dev/sda | sfdisk -f /dev/sdb
Here is how to restore generating a new disk and partition IDs. First use the grep and sed command to remove older IDS:
The grep and sed will remove uuid. This is useful when using two disks on the same machine. Typically uuid is used to mount and do other stuff. Hence, having different uuid helps. I hope this helps.
This appears to have created, but not formatted the partitions as per disks. If you compare the screenshots from disks below with the previous screenshots
Well, that’s the question. We would have to find out.
rear format /dev/sdX does not seem to do more than just creating a partition and formatting it so it shouldn’t be a problem to just format the disk yourself.
After formatting you just need to set the following in your /etc/rear/local.conf:
OUTPUT=USB
BACKUP_URL=usb:///dev/sdX
I haven’t tried it out but this is how it should work.
worked really well, it formatted the partition in around 1 minute. So that was perfect.
Rear has been able to backup to the data partition, but there were some errors during the backup related to the EFI partition (see below).
For some reason the boot partition was resized from 1GB to 419MB and this has created some issues. So I need to be able to setup the EFI partition as 1GB.