LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-29-2020, 12:37 PM   #1
Matej8
LQ Newbie
 
Registered: Aug 2020
Distribution: Pepermint OS and Raspberry Pi OS
Posts: 5

Rep: Reputation: Disabled
Question What software to use for creating custom Linux image on ext4 filesystem


Hi, everyone.

I've been using linux for a year now, but creating small and reliable system backup seems imposible for now, may teere be the software that can make it posible.


I want to make a small disk image that stores just my custom Linux installation with OpenHab and other software, without empty disk space.

Usually, I did a full-size disk image but it seems wasteful to store empty space int an image.

Sometimes I did make smaller partitions, but what to do if partition is big already?
Usually, my system with installed software takes 6-8 GB.

I do file backups but in case of SD card or hard drive corruption, I would like to restore my preconfigured Linux as fast as possible, so my OpenHab connected devices remain accessible.

So I think the disk image is the best for emergency restoration(I like the simplicity and reliability of restoration).

But I don't know what software can achieve creating disk image without storing empty disk space.

I know that ext4 scatters files over the disk but I want the image at most the same size as files on the disk...

For example, Acronis Disk Imager does an amazing job creating a disk image smaller than the size of occupied disk space, sadly I was unable to make bootable media from that image(May I need to reinstall grub by live-boot on that media that I want to restore??)

Resizing partition that I want to backup seems dangerous so...

The software that I am searching for should grab the files and create one file that can be extracted to the disk when restore is needed.


To summarize I want to make a small disk image that can be restored without any fuss other than maybe expanding partition.

Thanks in advance.

Matej
 
Old 08-31-2020, 02:52 PM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,155
Blog Entries: 6

Rep: Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835
Look at rsync

https://linux.die.net/man/1/rsync
https://wiki.archlinux.org/index.php...ackup_programs
 
Old 08-31-2020, 04:15 PM   #3
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,160

Rep: Reputation: 858Reputation: 858Reputation: 858Reputation: 858Reputation: 858Reputation: 858Reputation: 858
dump/restore available as standard on most systems
 
Old 08-31-2020, 05:05 PM   #4
biker_rat
Member
 
Registered: Feb 2010
Posts: 376

Rep: Reputation: 222Reputation: 222Reputation: 222
Make an image file, mount it, create ext4 fs, back up with rsync, compress the backup image file after you finish it (xz, bz2, 7z)?
 
Old 08-31-2020, 05:35 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,156

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
The OP stated they already do file backups.
For a full filesystem, as distinct from a full disk, backup I like fsarchiver. It creates a compressed, CRC checked single file point-in-time backup that can be simply restored in full. Not much use as a day to day backup, but great for a toss-in-the-drawer safety net.

Last edited by syg00; 08-31-2020 at 05:37 PM. Reason: oops - wrong tool initially
 
Old 09-01-2020, 07:43 AM   #6
Matej8
LQ Newbie
 
Registered: Aug 2020
Distribution: Pepermint OS and Raspberry Pi OS
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks a lot for all that great information!!

I will try to implement the recommended tools to make a backup that obviously restores reliably.


As soon as I will get it working I will mark this Solved, is there a button to do so?

Matej
 
Old 09-01-2020, 07:57 AM   #7
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,634

Rep: Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558Reputation: 2558
Quote:
Originally Posted by Matej8 View Post
As soon as I will get it working I will mark this Solved, is there a button to do so?
There should be text saying "Please Mark this thread as solved if you feel a solution has been provided." at the top of the page, where the bold text is a link.

Otherwise, look for the "Thread Tools" menu which will bring up a "Mark this thread as solved" option.

 
Old 09-01-2020, 08:00 AM   #8
Matej8
LQ Newbie
 
Registered: Aug 2020
Distribution: Pepermint OS and Raspberry Pi OS
Posts: 5

Original Poster
Rep: Reputation: Disabled
Oh I see, I was expecting a button somwhere below as on many newer Forum UIs.

Thanks
 
Old 09-03-2020, 06:27 AM   #9
Matej8
LQ Newbie
 
Registered: Aug 2020
Distribution: Pepermint OS and Raspberry Pi OS
Posts: 5

Original Poster
Rep: Reputation: Disabled
I seem to like fsarchiver so far. Thanks to syg00.

Today i will put it throug its pases and see how easy is it to restore.
 
Old 09-03-2020, 03:42 PM   #10
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
Usually one combines some compression with a backup. The type of compression may depend on your data and file size. Not sure why you are stuck with ext4 also.
 
Old 09-07-2020, 04:19 PM   #11
Matej8
LQ Newbie
 
Registered: Aug 2020
Distribution: Pepermint OS and Raspberry Pi OS
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jefro View Post
Usually one combines some compression with a backup. The type of compression may depend on your data and file size. Not sure why you are stuck with ext4 also.
Regarding ext4, I already have one system on 120GB disk(only 10% utilized) with an ext4 filesystem. Keeping a 120GB image, in this case, seems nonsense.

I did a clean install of Peppermint onto a 10GB partition, that I am configuring for OH2. Then I will make an image of this 10GB partition with 70% utilization which doesn't seem so wasteful...
Than at restore I just extend partition.

.........

I did quite some research and people have issues with a bootability of that backup made with fsarchiver. As they needed to repair the grub bootloader and debug things when restoring. Which is no good for system backup, but it is useful for major data backups.

Are any other filesystems better at backup and restore, as you say why ext4...

For new systems I have a solution to image a small partition, but what to do when backing up systems like one mentioned with big empty partition?

The only tools I know that they optimize disk image size are Acronis and MAcriumReflect, the first one did the backup but couldn't restore completely to be bootable.
Anyone suscesfully restore linux with any of them?

Thanks for the effort!
 
Old 09-07-2020, 07:39 PM   #12
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
A file by file method tends to leave the empty data untouched as opposed to a bit by bit copy. Clonezilla uses common programs that you can use alone or just use clonezilla. Many distro's have a backup in package manager.

Backup programs usually don't put file after file like a normal drive. They usually put them into a single file or collection of files (that contain many files).

I have used Acronis a long time ago and have used it for windows. I assume some other issue is going on. Both are well respected programs.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Custom Kernel Boot failed - unknown filesystem type ext4 sreyan32 Linux - Software 1 05-01-2020 07:00 PM
Increase the disk size for a qcow2 image with ext4 filesystem BhushanPathak Linux - Newbie 1 04-24-2019 07:50 AM
LXer: How to Use Dropbox in Non-Ext4 Linux Filesystem LXer Syndicated Linux News 0 03-19-2019 09:43 PM
Creating a filesystem to use free space on an existing filesystem idsouza28 Linux - Newbie 7 06-05-2012 12:29 AM
Creating custom headers to match a custom kernel utanja Debian 2 06-08-2007 03:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration