LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-21-2019, 02:59 PM   #1
AndreasKralj
LQ Newbie
 
Registered: Jun 2019
Posts: 2

Rep: Reputation: Disabled
How to clone Linux hard drive to smaller flash drive


Currently, I'm trying to clone a hard drive that has Linux installed to a 16GB flash drive. The hard drive is 233GB, but df -h shows that only 3.5G is in use. Can I use clonezilla to create an image using just the allocated amount of space and copy it to a flash drive, where I can deploy the image to other Linux laptops?
 
Old 06-21-2019, 03:30 PM   #2
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Hi & Welcome to LQ.

I've never used Conezilla so I'm not sure if you can create an image using just that amount of space.
If I had to guess I would imagine you could.

When you have time read the Clonezilla documentation. It should help clarify what you need.

https://clonezilla.org/clonezilla-live-doc.php
 
Old 06-21-2019, 04:44 PM   #3
AndreasKralj
LQ Newbie
 
Registered: Jun 2019
Posts: 2

Original Poster
Rep: Reputation: Disabled
Yeah. I'm using Parted Magic so I'm using Clonezilla from there. I tried doing device-image and it gets part of the way done, then throws the error

split /home/partimag/lubuntu.img/lubuntu-vg-root.ext4.ptcl-img.gz.aa: Input/output error
Checking the disk space...
Failed to save partition /dev/lubuntu-vg/root.
Press Enter to continue
 
Old 06-21-2019, 05:57 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,129

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
No.
Go to their front page and look under "Limitations".

That's why people document things.
 
Old 06-22-2019, 04:56 AM   #5
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,493

Rep: Reputation: Disabled
Some distros, such as antiX & MX Linux, come with the ability to do that, they call it a 'snapshot' (of your present system), & can create a bootable version to put onto a pendrive/SDHC card, for installing to other machines.
 
Old 06-22-2019, 08:22 AM   #6
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
What linux distro are you running that you want cloned?
 
Old 06-22-2019, 09:24 AM   #7
verndog
Member
 
Registered: Oct 2007
Posts: 278

Rep: Reputation: 67
fsarchiver will do just that. It clones only used sectors.
And you can restore to smaller partition as long as the data fits.

Last edited by verndog; 06-23-2019 at 08:10 AM.
 
Old 06-28-2019, 08:53 AM   #8
catatom
LQ Newbie
 
Registered: Oct 2014
Posts: 23

Rep: Reputation: Disabled
I too only remember failing at this. I also failed at creating a USB key with a cryptsetup encrypted harddrive.

You can dd a partition, but you'll have to shrink it first. I don't know why it did not work to (A) make a Ubuntu Live pendrive (B) delete the main partition (C) shrink my harddrive's main partition, and (D) dd the shrunken partition onto a bootable USB drive. If it worked, I would remember it.
 
Old 06-28-2019, 09:31 AM   #9
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by AndreasKralj View Post
Currently, I'm trying to clone a hard drive that has Linux installed to a 16GB flash drive. The hard drive is 233GB, but df -h shows that only 3.5G is in use. Can I use clonezilla to create an image using just the allocated amount of space and copy it to a flash drive, where I can deploy the image to other Linux laptops?
What filesystem type??
You could use dump/restore (or xfsdump/xfsrestore). man pages of these commands have good examples.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Open-spec SBC is a clone of a clone of a clone of a Raspberry Pi 3 LXer Syndicated Linux News 0 04-25-2018 04:56 PM
How to 'clone' to smaller drive? Geoff_L Linux - Newbie 10 03-01-2016 11:21 AM
clone hard drive to smaller hard drive digity Linux - Newbie 8 01-11-2009 06:29 PM
Clone a dual booting IDE hard drive to a SATA hard drive namida12 Linux - Distributions 1 07-14-2008 10:01 AM
Free disk space in '/' getting smaller and smaller. simjii SUSE / openSUSE 5 12-16-2005 11:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:37 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