LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-15-2019, 09:13 AM   #1
system001
Member
 
Registered: Nov 2018
Location: Portland Oregon Canada
Distribution: Kubuntu 19.04 - Manjaro 18.0
Posts: 199

Rep: Reputation: 15
Want To Do A Full Drive Image


i would like to do a full os drive backup image, and was wanting recommendations on making sure i did it right so if for some reason i should need it i won't have problems. first image is my os drive just the two partitions. the second image is of the drive that i want to free up enough space on to create a 150 partition on for the image. i just redid and tested all my usb media, so i should have all the tools i will need. mint 19.1 live, makulu live, gandalf's win 10 pe, and parted magic.
Attached Thumbnails
Click image for larger version

Name:	GParted .png
Views:	20
Size:	33.6 KB
ID:	29802   Click image for larger version

Name:	GParted 2.png
Views:	22
Size:	44.9 KB
ID:	29803  
 
Old 02-15-2019, 09:15 AM   #2
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Personally, I'd use Clonezilla myself if it were me.
 
Old 02-15-2019, 09:21 AM   #3
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Just a wee note that you should always aim to have at least two copies of any data, preferably on different devices in different locations.

So, if you're going to clone a drive before deleting something off that drive, you would be best making a second copy too so that after the deletion you still have 2 copies of the data left.

I hope that makes sense.
 
Old 02-15-2019, 10:26 AM   #4
system001
Member
 
Registered: Nov 2018
Location: Portland Oregon Canada
Distribution: Kubuntu 19.04 - Manjaro 18.0
Posts: 199

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by hydrurga View Post
Just a wee note that you should always aim to have at least two copies of any data, preferably on different devices in different locations.

So, if you're going to clone a drive before deleting something off that drive, you would be best making a second copy too so that after the deletion you still have 2 copies of the data left.

I hope that makes sense.
yea currently i have my files on 8 different partitions not counting vm's and the two partitions on the os drive. i have a large additional drive with folders named after each of those partitions, and once a week i backup all 8 of those to the master backup. like you i don't like to take chances. i could creat another 150 gig partition on that drive and keep a second os drive image there.

with that said i'd just as well boot into the live environment and use disk to create the images. unless i'm missing something i don't see why i can't do it that way.
 
Old 02-15-2019, 05:06 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,132

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
You can do it that way - surely the simplest.
Like everything, caveats apply - it appears to indeed image the entire disk, including all that unused space. So you'd be copying the entire 110G for 51G (currently) of useful data. But with a modicum of work you should be able to mount the partitions contained in that image to recover individual files - you would not necessarily have to restore the lot for a single file recovery. clonezilla has smarts that only backs up the used data and compresses it IIRC - so it's faster and smaller, but you can't directly recover individual files without a full restore first.
Both of those solutions require you to copy all the data every time - no ability to only process the changed data (differential backup). Apparently not a concern in this case. FWIW I use fsarchiver in situations like this - it also produces a compressed image of the used portions of a filesystem, but CRC checks each file. Also requires a full restore to get at the files, but I only use it in exceptional cases.

Lots of other choices as well, but none are simpler than disks if that is your primary aim.
 
Old 02-15-2019, 07:02 PM   #6
system001
Member
 
Registered: Nov 2018
Location: Portland Oregon Canada
Distribution: Kubuntu 19.04 - Manjaro 18.0
Posts: 199

Original Poster
Rep: Reputation: 15
yea i just want to run a full image while i sleep via the live environment, get up copy that to the master backup, same routine a week later replacing the old images. this is more for if something goes wrong with a program install or update and i can't log back,or simply won't boot.
 
Old 02-15-2019, 07:21 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,132

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
If you have Mint 19, you'd be better off looking at Timeshift.
 
Old 02-15-2019, 08:09 PM   #8
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
I've been backing up everything for at least 15 years. In my experience, it is extremely rare to have to restore Linux OS images. Windows I restore the original tweaked installation a couple times a year, apply all updates and clean off all backups from those updates out of the WinSxS with DISM, delete all downloaded updates in C:\Windows\SoftwareDistribution\Downloads, then create a new image. Only after the latest image is created do I install software I typically use on an as needed basis from the Data drive.

My Windows without personal software installed uses around 50GB. I do as recommended in earlier posts, I do compressed images of used space only with BootitBM, the image size for Windows is around 20GB, which is a tenth of the partition size of 200GB, Debian Testing with all software is 3.34GB. I have never had a need to try and and retrieve anything from OS images as personal data is in the data drive only, never in OS partitions.

I much prefer this approach as it's much faster to create the images, much faster to restore the images, much faster to back them up (original written into the data drive, backed up on removable drive). And helps extend the life of the drives, If you intend on writing a 111GB file to two drives once a week, you will shorten their life spans. Drives won't get as hot writing a 20GB file versus a 200GB file (in my case). And when you are writing a file close to the size of the partition, you are writing over the same spot every time, when you write to a partition with lots of free space, you are typically writing to the oldest free space which is more efficient and again, extends the life of the drive.
 
Old 02-16-2019, 06:39 AM   #9
system001
Member
 
Registered: Nov 2018
Location: Portland Oregon Canada
Distribution: Kubuntu 19.04 - Manjaro 18.0
Posts: 199

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by syg00 View Post
If you have Mint 19, you'd be better off looking at Timeshift.
simply no. i can't trust a program that's not setup to recognize the default partitioning. long story short. i wiped the os drive after i was comfortable enough in mint to finally drop win 10 altogether. i let the install chose how to partition. it created a boot partition, and a partition for everything else. first thing right out of the gate upon landing on the desktop was to use timeshift, got told that it did not like my ext4 partition and i needed the newer partition type to use timeshift. can't and won't trust a program that will not except the standard os file system.

"BootitBM" is a thought but i would really rather do it from the live environment than create another book disk.

Last edited by system001; 02-16-2019 at 06:51 AM.
 
Old 02-16-2019, 06:43 AM   #10
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by system001 View Post
simply no. i can't trust a program that's not setup to recognize the default partitioning. long story short. i wiped the os drive after i was comfortable enough in mint to finally drop win 10 altogether. i let the install chose how to partition. it created a boot partition, and a partition for everything else. first thing right out of the gate upon landing on the desktop was to use timeshift, got told that it did not like my ext4 partition and i needed the newer partition type to use timeshift. can't and won't trust a program that will not except the standard os file system.
That's an interesting one. I use TimeShift successfully on ext4 partitions (older-style MBR rather than GPT too, if that was the issue).
 
Old 02-16-2019, 06:45 AM   #11
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
Couldnt you could do this using a script, cp command and tools like mksquashfs etc?
I had to move my whole slackware install from sda6 to larger sda5 the other day and after looking at all options- dd, clonezilla, etc I decided on just using
Code:
cp -avf /* /mnt/sda5
using mksquashfs, xz or whatever?
Make the script automatic, etc?
then compress whatever

Last edited by linus72; 02-16-2019 at 06:46 AM.
 
Old 02-16-2019, 08:17 AM   #12
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
OK so heres simple script I made for my system on sda5 20gb to backup my install of slack 14.2 which is about 7gb
I have my storage/vista partition mounted and will back up everything except dev, mnt, media, proc, sys you know.
my script

Code:
#!/bin/sh
cd /
mksquashfs bin boot etc home lib lib64 opt root tmp usr var /run/media/bz/OS/SlackBackUp/slack-02162019.squashfs -no-duplicates
Probably could add more options just issue "mksquashfs" and itll print out info
And resulting squashfs file is 1.8gb
You can mount it and look in it with
Code:
mkdir /mnt/sqfs
mount -o loop slack-02162019.squashfs /mnt/sqfs
ls /mnt/sqfs
boot  etc  home  lib  lib64  opt  root	tmp  usr  var
With yours on differing partitions I suppose youd just mount them all and direct mksquashfs to compress them either all together or single for each idk?
Just a thought hope it helps

Last edited by linus72; 02-16-2019 at 08:21 AM.
 
Old 02-16-2019, 08:32 AM   #13
system001
Member
 
Registered: Nov 2018
Location: Portland Oregon Canada
Distribution: Kubuntu 19.04 - Manjaro 18.0
Posts: 199

Original Poster
Rep: Reputation: 15
think you mis read my op. all a want to do is backup the entire os drive. another user suggested making two backups of it and i agreed. i think after doing some more extensive reading on various sites i am going to go wioth the mint live environment and disk, no compression for either backup, and just replace them every 3 to 6 months. most things that would keep one from being able to boot or login can be fixed via the live media, so the os clones would only be a last resort instead of needing to rebuild from scratch.
 
Old 05-26-2019, 09:44 AM   #14
system001
Member
 
Registered: Nov 2018
Location: Portland Oregon Canada
Distribution: Kubuntu 19.04 - Manjaro 18.0
Posts: 199

Original Poster
Rep: Reputation: 15
pk no neon now and for my needs loving it far better than mint because of plasma and not having to have 2 desktops installed to get plasma. however one problem after i made the back of the os drive, and that was i found out several days later i was actually booting into it and not the original. i guess i need a way to make it nonbootable til i actually need it.
 
  


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] Slackware 14.1 32bit system tarball/stage3 image/chroot image/bootstrap image vinipsmaker Slackware 20 05-14-2014 01:41 AM
Raw drive image change drive size in image? jefro Linux - General 6 10-17-2012 03:04 PM
[SOLVED] slackware "full ==> what you want " or "minimal ===> what you want" ? emre polat Slackware 17 10-09-2012 10:55 PM
Using dd and gzip to create hard drive image but image is bigger than hard drive? banz Linux - Software 3 11-22-2008 04:25 AM
Mount a full drive image? sancho Linux - Software 3 01-17-2006 10:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:04 AM.

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