Create an image file of a running Linux system
As I understand it, creating an image of a Linux system makes an exact copy of the OS and any user files/configurations/programs etc.
What I would love to do is create an image of my work PC and install it at home on my desktop. Can someone briefly explain the process of creating and installing images of Linux systems?
Home OS: Windows. Want: An image file that can be executed in a virtual machine (VMPlayer or VirtualBox) or booted directly on my home PC. I have tried clonesys but would appreciate a different method.
linux installation disk-image
add a comment |
As I understand it, creating an image of a Linux system makes an exact copy of the OS and any user files/configurations/programs etc.
What I would love to do is create an image of my work PC and install it at home on my desktop. Can someone briefly explain the process of creating and installing images of Linux systems?
Home OS: Windows. Want: An image file that can be executed in a virtual machine (VMPlayer or VirtualBox) or booted directly on my home PC. I have tried clonesys but would appreciate a different method.
linux installation disk-image
how is the system set up and what imaging tools do you have access to? if you are using lvm it's super easy and can run on a live system. Some of the other tools require offline imaging.
– RobotHumans
Dec 9 '10 at 13:34
You need to provide more detail here, in order to get useful answers. What was "the program" that you tried? What were the image files it produced (their name and size at least)? Are you looking to replace your current OS at home, dual-boot, or run the Linux image in a VM? In any case what is your current OS at home? Do you need to make the image while the OS is actually running or would stopping it for a time be acceptable? (note: edit the extra detail into your question rather than as a comment, or the info could end up hidden after more comments are added by others)
– David Spillett
Dec 9 '10 at 14:08
add a comment |
As I understand it, creating an image of a Linux system makes an exact copy of the OS and any user files/configurations/programs etc.
What I would love to do is create an image of my work PC and install it at home on my desktop. Can someone briefly explain the process of creating and installing images of Linux systems?
Home OS: Windows. Want: An image file that can be executed in a virtual machine (VMPlayer or VirtualBox) or booted directly on my home PC. I have tried clonesys but would appreciate a different method.
linux installation disk-image
As I understand it, creating an image of a Linux system makes an exact copy of the OS and any user files/configurations/programs etc.
What I would love to do is create an image of my work PC and install it at home on my desktop. Can someone briefly explain the process of creating and installing images of Linux systems?
Home OS: Windows. Want: An image file that can be executed in a virtual machine (VMPlayer or VirtualBox) or booted directly on my home PC. I have tried clonesys but would appreciate a different method.
linux installation disk-image
linux installation disk-image
edited Dec 15 '15 at 21:08
Hennes
58.9k792141
58.9k792141
asked Dec 9 '10 at 13:27
toc777toc777
162137
162137
how is the system set up and what imaging tools do you have access to? if you are using lvm it's super easy and can run on a live system. Some of the other tools require offline imaging.
– RobotHumans
Dec 9 '10 at 13:34
You need to provide more detail here, in order to get useful answers. What was "the program" that you tried? What were the image files it produced (their name and size at least)? Are you looking to replace your current OS at home, dual-boot, or run the Linux image in a VM? In any case what is your current OS at home? Do you need to make the image while the OS is actually running or would stopping it for a time be acceptable? (note: edit the extra detail into your question rather than as a comment, or the info could end up hidden after more comments are added by others)
– David Spillett
Dec 9 '10 at 14:08
add a comment |
how is the system set up and what imaging tools do you have access to? if you are using lvm it's super easy and can run on a live system. Some of the other tools require offline imaging.
– RobotHumans
Dec 9 '10 at 13:34
You need to provide more detail here, in order to get useful answers. What was "the program" that you tried? What were the image files it produced (their name and size at least)? Are you looking to replace your current OS at home, dual-boot, or run the Linux image in a VM? In any case what is your current OS at home? Do you need to make the image while the OS is actually running or would stopping it for a time be acceptable? (note: edit the extra detail into your question rather than as a comment, or the info could end up hidden after more comments are added by others)
– David Spillett
Dec 9 '10 at 14:08
how is the system set up and what imaging tools do you have access to? if you are using lvm it's super easy and can run on a live system. Some of the other tools require offline imaging.
– RobotHumans
Dec 9 '10 at 13:34
how is the system set up and what imaging tools do you have access to? if you are using lvm it's super easy and can run on a live system. Some of the other tools require offline imaging.
– RobotHumans
Dec 9 '10 at 13:34
You need to provide more detail here, in order to get useful answers. What was "the program" that you tried? What were the image files it produced (their name and size at least)? Are you looking to replace your current OS at home, dual-boot, or run the Linux image in a VM? In any case what is your current OS at home? Do you need to make the image while the OS is actually running or would stopping it for a time be acceptable? (note: edit the extra detail into your question rather than as a comment, or the info could end up hidden after more comments are added by others)
– David Spillett
Dec 9 '10 at 14:08
You need to provide more detail here, in order to get useful answers. What was "the program" that you tried? What were the image files it produced (their name and size at least)? Are you looking to replace your current OS at home, dual-boot, or run the Linux image in a VM? In any case what is your current OS at home? Do you need to make the image while the OS is actually running or would stopping it for a time be acceptable? (note: edit the extra detail into your question rather than as a comment, or the info could end up hidden after more comments are added by others)
– David Spillett
Dec 9 '10 at 14:08
add a comment |
5 Answers
5
active
oldest
votes
something you could try.
Prepare a live cd (doesn't matter which one).
Have an external storage device large enough (same size as the work HD) to hold the image.
Put the live cd into your work computer and boot it up.
Mount your external storage (or even network if you are so inclined)
Use dd
to clone the hard drive on your work computer and store it as an image on your storage
Shutdown your work computer
do the same exact method on your home laptop, but instead of cloning your hard drive, you'll be putting your image on your hard drive
essentially you have to reverse the if=
and of=
commands
You might have some hardware compatibility issues right out of the box unless the hardware of your home and work comps are the same. But it is all solvable :)
Enjoy.
OP said he wanted to create an image of a running system. A live CD means the system being cloned won't be running.
– Andrew Ensley
Jul 7 '11 at 16:39
@andrew, how about reading the actual question before just skimming the title. My answer is relevant.
– g19fanatic
Aug 5 '11 at 16:57
No offense intended. I did read the whole question. The title plus the question together indicate that the OP wanted to create the image while the system was running. Hence also his reference to clonesys.
– Andrew Ensley
Aug 5 '11 at 17:12
1
The OP mentions nothing of needing to image a running system. Re-read his question, i take it as meaning he has a 'working' linux system and wants to clone it(running in the title can mean 'working'). His mention of clonesys is arbitrary and chalked up to unfamiliarity. You read it as him wanting a running clone (which isn't possible without running it in a VM to start with...). It doesn't read that way at all to me. What he is asking is doable with my method (and others mentioned).
– g19fanatic
Sep 13 '11 at 1:55
add a comment |
http://www.linux-live.org/ gives you a really simple howto of the process:
Linux Live Kit is a set of shell scripts which allows you to create your own Live Linux from an already installed Linux distribution. The Live system you create will be bootable from CD-ROM or a disk device, for example USB Flash Drive, USB Pen Drive, Camera connected to USB port, and so on. People use Linux Live Kit to boot Linux from iPod as well.
+1: I think this is a good solution, but could benefit a lot a few bits of flavor information as to WHY it is a good solution.
– killermist
Mar 28 '13 at 2:26
add a comment |
You could use partimage to create an live image.
But I think it's hard to get an working live image which you can easily transfer to one pc to the other.
When you can shutdown your work pc I would recommend a live cd with partimage and create an image to an usb stick and rewrite it on the home pc.
Or if you can't shutdown your pc, you could use dump (http://linux.about.com/od/commands/l/blcmdl8_dump.htm) to a file or over network (ssh).
add a comment |
You can easily clone the OS using Clonezilla (the Live CD), but just know that the destination drive must be as big, or bigger than the original. These steps will show you how to clone the disk to another.
NOTE - backup your data
1
OP said he wanted to create an image of a running system. A live CD means the system being cloned won't be running.
– Andrew Ensley
Jul 7 '11 at 16:40
add a comment |
Here's how I've just done that:
Preparation
Windows 10 desktop
- Install VirtualBox
The following steps are to provide a way to copy the disk image. I didn't have an external storage device with enough space to hold my laptop's disk image so I mounted my Windows machine vía SSH. There are other ways to do this, but this was easiest for me in the situation.
- Enable WSL and reboot when prompted
- Install Ubuntu from the Windows Store
- Start Ubuntu from the Start Menu
- Run
sudo apt install openssh-server
to install sshd - Run
sudo nano /etc/ssh/sshd_config
to edit the sshd configuration - Change
PasswordAuthentication no
toPasswordAuthentication yes
, then press Ctrl+x, y, enter to save - Run
sudo /etc/init.d/ssh restart
The Windows Firewall dialog should pop up now, click Accept to allow incoming connections.
Linux laptop
Run sudo apt install sshfs virtualbox
to give you the sshfs
and vboxmanage
commands.
Now's a good time to test you can make an SSH connection to your Windows machine
Creating a boot image
If, in the next section, you create an image of your entire disk instead of just the Linux partition, then you probably won't need to do this.
I wanted to save space so only took my Linux root partition, but this isn't bootable by itself so I created a bootable ISO image:
Linux laptop
- Install packages required by grub-mkrescue:
sudo apt install grub-pc-bin xorriso
- Make a directory to hold the bootable files:
mkdir -p efibootiso/boot/grub
- Copy the Grub EFI bootloader:
cp /usr/lib/grub/x86_64-efi/* efibootiso/boot/grub/
- Copy your laptop's Grub configuration:
cp /boot/grub/grub.cfg efibootiso/boot/grub
- Make the image:
grub-mkrescue -o boot.iso efibootiso
- Copy it to your Windows machine:
scp boot.iso username@windowsten:/mnt/d/VMs/WorkLaptop/
Creating the disk image
Linux laptop
- Reboot and select advanced options, then recovery mode from the bootloader
- Select network from the recovery menu to enable networking
- Then select the root console option and press enter
- Run mount to check your root partition (mine is
/dev/sda8
) - Make a temporary directory to mount your Windows machine, eg:
mkdir /run/windowsten
- Mount your Windows machine, eg:
sshfs username@windowsten:/ /run/windowsten
- Change directory to the location you want to save your disk image, eg:
cd /run/windowsten/mnt/d/VMs/WorkLaptop
Here's the trick, if you run mount -o remount,ro /
now then you'll get told it's in use, so instead use the magic sysrq keys: SysRq+s to force sync, then SysRq+u to force remount readonly.
(SysRq on my laptop was Alt Gr + Print Screen)
- Now make the VDI file with
vboxmanage convertfromraw /dev/sda8 worklaptop.vdi
This will take a long time. I got about 10GB/hour with both machines using 802.11n wifi. Next time I'll use a wired connection.
When It eventually finishes, you'll have a disk image of your laptop's Linux partition.
Windows 10 desktop
- Start VirtualBox
- Click New
- Click Expert Mode
- Give your VM a name
- Select the OS type and version (eg. Linux, Ubuntu (64 bit)
- Give it enough RAM
- Select "Use an existing virtual hard disk file" radio button
- Click the yellow folder icon
- Browse to and select the VDI file from the previous step
- Click Create
- Select your new VM
- Click Settings
- Click Storage
- Select the optical Drive
- Click the disc icon and select "Choose Virtual Optical Disc File"
- Browse to and select the boot.iso image
- Click System
- Verify the optical drive is above hard disk in the boot order
- Check Enable EFI
- Click OK
Now you should be able to boot your VM.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f220125%2fcreate-an-image-file-of-a-running-linux-system%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
something you could try.
Prepare a live cd (doesn't matter which one).
Have an external storage device large enough (same size as the work HD) to hold the image.
Put the live cd into your work computer and boot it up.
Mount your external storage (or even network if you are so inclined)
Use dd
to clone the hard drive on your work computer and store it as an image on your storage
Shutdown your work computer
do the same exact method on your home laptop, but instead of cloning your hard drive, you'll be putting your image on your hard drive
essentially you have to reverse the if=
and of=
commands
You might have some hardware compatibility issues right out of the box unless the hardware of your home and work comps are the same. But it is all solvable :)
Enjoy.
OP said he wanted to create an image of a running system. A live CD means the system being cloned won't be running.
– Andrew Ensley
Jul 7 '11 at 16:39
@andrew, how about reading the actual question before just skimming the title. My answer is relevant.
– g19fanatic
Aug 5 '11 at 16:57
No offense intended. I did read the whole question. The title plus the question together indicate that the OP wanted to create the image while the system was running. Hence also his reference to clonesys.
– Andrew Ensley
Aug 5 '11 at 17:12
1
The OP mentions nothing of needing to image a running system. Re-read his question, i take it as meaning he has a 'working' linux system and wants to clone it(running in the title can mean 'working'). His mention of clonesys is arbitrary and chalked up to unfamiliarity. You read it as him wanting a running clone (which isn't possible without running it in a VM to start with...). It doesn't read that way at all to me. What he is asking is doable with my method (and others mentioned).
– g19fanatic
Sep 13 '11 at 1:55
add a comment |
something you could try.
Prepare a live cd (doesn't matter which one).
Have an external storage device large enough (same size as the work HD) to hold the image.
Put the live cd into your work computer and boot it up.
Mount your external storage (or even network if you are so inclined)
Use dd
to clone the hard drive on your work computer and store it as an image on your storage
Shutdown your work computer
do the same exact method on your home laptop, but instead of cloning your hard drive, you'll be putting your image on your hard drive
essentially you have to reverse the if=
and of=
commands
You might have some hardware compatibility issues right out of the box unless the hardware of your home and work comps are the same. But it is all solvable :)
Enjoy.
OP said he wanted to create an image of a running system. A live CD means the system being cloned won't be running.
– Andrew Ensley
Jul 7 '11 at 16:39
@andrew, how about reading the actual question before just skimming the title. My answer is relevant.
– g19fanatic
Aug 5 '11 at 16:57
No offense intended. I did read the whole question. The title plus the question together indicate that the OP wanted to create the image while the system was running. Hence also his reference to clonesys.
– Andrew Ensley
Aug 5 '11 at 17:12
1
The OP mentions nothing of needing to image a running system. Re-read his question, i take it as meaning he has a 'working' linux system and wants to clone it(running in the title can mean 'working'). His mention of clonesys is arbitrary and chalked up to unfamiliarity. You read it as him wanting a running clone (which isn't possible without running it in a VM to start with...). It doesn't read that way at all to me. What he is asking is doable with my method (and others mentioned).
– g19fanatic
Sep 13 '11 at 1:55
add a comment |
something you could try.
Prepare a live cd (doesn't matter which one).
Have an external storage device large enough (same size as the work HD) to hold the image.
Put the live cd into your work computer and boot it up.
Mount your external storage (or even network if you are so inclined)
Use dd
to clone the hard drive on your work computer and store it as an image on your storage
Shutdown your work computer
do the same exact method on your home laptop, but instead of cloning your hard drive, you'll be putting your image on your hard drive
essentially you have to reverse the if=
and of=
commands
You might have some hardware compatibility issues right out of the box unless the hardware of your home and work comps are the same. But it is all solvable :)
Enjoy.
something you could try.
Prepare a live cd (doesn't matter which one).
Have an external storage device large enough (same size as the work HD) to hold the image.
Put the live cd into your work computer and boot it up.
Mount your external storage (or even network if you are so inclined)
Use dd
to clone the hard drive on your work computer and store it as an image on your storage
Shutdown your work computer
do the same exact method on your home laptop, but instead of cloning your hard drive, you'll be putting your image on your hard drive
essentially you have to reverse the if=
and of=
commands
You might have some hardware compatibility issues right out of the box unless the hardware of your home and work comps are the same. But it is all solvable :)
Enjoy.
edited Apr 13 '17 at 12:14
Community♦
1
1
answered Dec 10 '10 at 3:57
g19fanaticg19fanatic
1,116813
1,116813
OP said he wanted to create an image of a running system. A live CD means the system being cloned won't be running.
– Andrew Ensley
Jul 7 '11 at 16:39
@andrew, how about reading the actual question before just skimming the title. My answer is relevant.
– g19fanatic
Aug 5 '11 at 16:57
No offense intended. I did read the whole question. The title plus the question together indicate that the OP wanted to create the image while the system was running. Hence also his reference to clonesys.
– Andrew Ensley
Aug 5 '11 at 17:12
1
The OP mentions nothing of needing to image a running system. Re-read his question, i take it as meaning he has a 'working' linux system and wants to clone it(running in the title can mean 'working'). His mention of clonesys is arbitrary and chalked up to unfamiliarity. You read it as him wanting a running clone (which isn't possible without running it in a VM to start with...). It doesn't read that way at all to me. What he is asking is doable with my method (and others mentioned).
– g19fanatic
Sep 13 '11 at 1:55
add a comment |
OP said he wanted to create an image of a running system. A live CD means the system being cloned won't be running.
– Andrew Ensley
Jul 7 '11 at 16:39
@andrew, how about reading the actual question before just skimming the title. My answer is relevant.
– g19fanatic
Aug 5 '11 at 16:57
No offense intended. I did read the whole question. The title plus the question together indicate that the OP wanted to create the image while the system was running. Hence also his reference to clonesys.
– Andrew Ensley
Aug 5 '11 at 17:12
1
The OP mentions nothing of needing to image a running system. Re-read his question, i take it as meaning he has a 'working' linux system and wants to clone it(running in the title can mean 'working'). His mention of clonesys is arbitrary and chalked up to unfamiliarity. You read it as him wanting a running clone (which isn't possible without running it in a VM to start with...). It doesn't read that way at all to me. What he is asking is doable with my method (and others mentioned).
– g19fanatic
Sep 13 '11 at 1:55
OP said he wanted to create an image of a running system. A live CD means the system being cloned won't be running.
– Andrew Ensley
Jul 7 '11 at 16:39
OP said he wanted to create an image of a running system. A live CD means the system being cloned won't be running.
– Andrew Ensley
Jul 7 '11 at 16:39
@andrew, how about reading the actual question before just skimming the title. My answer is relevant.
– g19fanatic
Aug 5 '11 at 16:57
@andrew, how about reading the actual question before just skimming the title. My answer is relevant.
– g19fanatic
Aug 5 '11 at 16:57
No offense intended. I did read the whole question. The title plus the question together indicate that the OP wanted to create the image while the system was running. Hence also his reference to clonesys.
– Andrew Ensley
Aug 5 '11 at 17:12
No offense intended. I did read the whole question. The title plus the question together indicate that the OP wanted to create the image while the system was running. Hence also his reference to clonesys.
– Andrew Ensley
Aug 5 '11 at 17:12
1
1
The OP mentions nothing of needing to image a running system. Re-read his question, i take it as meaning he has a 'working' linux system and wants to clone it(running in the title can mean 'working'). His mention of clonesys is arbitrary and chalked up to unfamiliarity. You read it as him wanting a running clone (which isn't possible without running it in a VM to start with...). It doesn't read that way at all to me. What he is asking is doable with my method (and others mentioned).
– g19fanatic
Sep 13 '11 at 1:55
The OP mentions nothing of needing to image a running system. Re-read his question, i take it as meaning he has a 'working' linux system and wants to clone it(running in the title can mean 'working'). His mention of clonesys is arbitrary and chalked up to unfamiliarity. You read it as him wanting a running clone (which isn't possible without running it in a VM to start with...). It doesn't read that way at all to me. What he is asking is doable with my method (and others mentioned).
– g19fanatic
Sep 13 '11 at 1:55
add a comment |
http://www.linux-live.org/ gives you a really simple howto of the process:
Linux Live Kit is a set of shell scripts which allows you to create your own Live Linux from an already installed Linux distribution. The Live system you create will be bootable from CD-ROM or a disk device, for example USB Flash Drive, USB Pen Drive, Camera connected to USB port, and so on. People use Linux Live Kit to boot Linux from iPod as well.
+1: I think this is a good solution, but could benefit a lot a few bits of flavor information as to WHY it is a good solution.
– killermist
Mar 28 '13 at 2:26
add a comment |
http://www.linux-live.org/ gives you a really simple howto of the process:
Linux Live Kit is a set of shell scripts which allows you to create your own Live Linux from an already installed Linux distribution. The Live system you create will be bootable from CD-ROM or a disk device, for example USB Flash Drive, USB Pen Drive, Camera connected to USB port, and so on. People use Linux Live Kit to boot Linux from iPod as well.
+1: I think this is a good solution, but could benefit a lot a few bits of flavor information as to WHY it is a good solution.
– killermist
Mar 28 '13 at 2:26
add a comment |
http://www.linux-live.org/ gives you a really simple howto of the process:
Linux Live Kit is a set of shell scripts which allows you to create your own Live Linux from an already installed Linux distribution. The Live system you create will be bootable from CD-ROM or a disk device, for example USB Flash Drive, USB Pen Drive, Camera connected to USB port, and so on. People use Linux Live Kit to boot Linux from iPod as well.
http://www.linux-live.org/ gives you a really simple howto of the process:
Linux Live Kit is a set of shell scripts which allows you to create your own Live Linux from an already installed Linux distribution. The Live system you create will be bootable from CD-ROM or a disk device, for example USB Flash Drive, USB Pen Drive, Camera connected to USB port, and so on. People use Linux Live Kit to boot Linux from iPod as well.
edited Mar 28 '13 at 14:07
slhck
159k47443466
159k47443466
answered Mar 28 '13 at 1:55
Chad LongstaffChad Longstaff
291
291
+1: I think this is a good solution, but could benefit a lot a few bits of flavor information as to WHY it is a good solution.
– killermist
Mar 28 '13 at 2:26
add a comment |
+1: I think this is a good solution, but could benefit a lot a few bits of flavor information as to WHY it is a good solution.
– killermist
Mar 28 '13 at 2:26
+1: I think this is a good solution, but could benefit a lot a few bits of flavor information as to WHY it is a good solution.
– killermist
Mar 28 '13 at 2:26
+1: I think this is a good solution, but could benefit a lot a few bits of flavor information as to WHY it is a good solution.
– killermist
Mar 28 '13 at 2:26
add a comment |
You could use partimage to create an live image.
But I think it's hard to get an working live image which you can easily transfer to one pc to the other.
When you can shutdown your work pc I would recommend a live cd with partimage and create an image to an usb stick and rewrite it on the home pc.
Or if you can't shutdown your pc, you could use dump (http://linux.about.com/od/commands/l/blcmdl8_dump.htm) to a file or over network (ssh).
add a comment |
You could use partimage to create an live image.
But I think it's hard to get an working live image which you can easily transfer to one pc to the other.
When you can shutdown your work pc I would recommend a live cd with partimage and create an image to an usb stick and rewrite it on the home pc.
Or if you can't shutdown your pc, you could use dump (http://linux.about.com/od/commands/l/blcmdl8_dump.htm) to a file or over network (ssh).
add a comment |
You could use partimage to create an live image.
But I think it's hard to get an working live image which you can easily transfer to one pc to the other.
When you can shutdown your work pc I would recommend a live cd with partimage and create an image to an usb stick and rewrite it on the home pc.
Or if you can't shutdown your pc, you could use dump (http://linux.about.com/od/commands/l/blcmdl8_dump.htm) to a file or over network (ssh).
You could use partimage to create an live image.
But I think it's hard to get an working live image which you can easily transfer to one pc to the other.
When you can shutdown your work pc I would recommend a live cd with partimage and create an image to an usb stick and rewrite it on the home pc.
Or if you can't shutdown your pc, you could use dump (http://linux.about.com/od/commands/l/blcmdl8_dump.htm) to a file or over network (ssh).
edited Dec 4 '15 at 21:20
Benjamin
2122927
2122927
answered Dec 9 '10 at 13:45
patrickspatricks
60637
60637
add a comment |
add a comment |
You can easily clone the OS using Clonezilla (the Live CD), but just know that the destination drive must be as big, or bigger than the original. These steps will show you how to clone the disk to another.
NOTE - backup your data
1
OP said he wanted to create an image of a running system. A live CD means the system being cloned won't be running.
– Andrew Ensley
Jul 7 '11 at 16:40
add a comment |
You can easily clone the OS using Clonezilla (the Live CD), but just know that the destination drive must be as big, or bigger than the original. These steps will show you how to clone the disk to another.
NOTE - backup your data
1
OP said he wanted to create an image of a running system. A live CD means the system being cloned won't be running.
– Andrew Ensley
Jul 7 '11 at 16:40
add a comment |
You can easily clone the OS using Clonezilla (the Live CD), but just know that the destination drive must be as big, or bigger than the original. These steps will show you how to clone the disk to another.
NOTE - backup your data
You can easily clone the OS using Clonezilla (the Live CD), but just know that the destination drive must be as big, or bigger than the original. These steps will show you how to clone the disk to another.
NOTE - backup your data
answered Dec 9 '10 at 14:11
invertinvert
4,80721732
4,80721732
1
OP said he wanted to create an image of a running system. A live CD means the system being cloned won't be running.
– Andrew Ensley
Jul 7 '11 at 16:40
add a comment |
1
OP said he wanted to create an image of a running system. A live CD means the system being cloned won't be running.
– Andrew Ensley
Jul 7 '11 at 16:40
1
1
OP said he wanted to create an image of a running system. A live CD means the system being cloned won't be running.
– Andrew Ensley
Jul 7 '11 at 16:40
OP said he wanted to create an image of a running system. A live CD means the system being cloned won't be running.
– Andrew Ensley
Jul 7 '11 at 16:40
add a comment |
Here's how I've just done that:
Preparation
Windows 10 desktop
- Install VirtualBox
The following steps are to provide a way to copy the disk image. I didn't have an external storage device with enough space to hold my laptop's disk image so I mounted my Windows machine vía SSH. There are other ways to do this, but this was easiest for me in the situation.
- Enable WSL and reboot when prompted
- Install Ubuntu from the Windows Store
- Start Ubuntu from the Start Menu
- Run
sudo apt install openssh-server
to install sshd - Run
sudo nano /etc/ssh/sshd_config
to edit the sshd configuration - Change
PasswordAuthentication no
toPasswordAuthentication yes
, then press Ctrl+x, y, enter to save - Run
sudo /etc/init.d/ssh restart
The Windows Firewall dialog should pop up now, click Accept to allow incoming connections.
Linux laptop
Run sudo apt install sshfs virtualbox
to give you the sshfs
and vboxmanage
commands.
Now's a good time to test you can make an SSH connection to your Windows machine
Creating a boot image
If, in the next section, you create an image of your entire disk instead of just the Linux partition, then you probably won't need to do this.
I wanted to save space so only took my Linux root partition, but this isn't bootable by itself so I created a bootable ISO image:
Linux laptop
- Install packages required by grub-mkrescue:
sudo apt install grub-pc-bin xorriso
- Make a directory to hold the bootable files:
mkdir -p efibootiso/boot/grub
- Copy the Grub EFI bootloader:
cp /usr/lib/grub/x86_64-efi/* efibootiso/boot/grub/
- Copy your laptop's Grub configuration:
cp /boot/grub/grub.cfg efibootiso/boot/grub
- Make the image:
grub-mkrescue -o boot.iso efibootiso
- Copy it to your Windows machine:
scp boot.iso username@windowsten:/mnt/d/VMs/WorkLaptop/
Creating the disk image
Linux laptop
- Reboot and select advanced options, then recovery mode from the bootloader
- Select network from the recovery menu to enable networking
- Then select the root console option and press enter
- Run mount to check your root partition (mine is
/dev/sda8
) - Make a temporary directory to mount your Windows machine, eg:
mkdir /run/windowsten
- Mount your Windows machine, eg:
sshfs username@windowsten:/ /run/windowsten
- Change directory to the location you want to save your disk image, eg:
cd /run/windowsten/mnt/d/VMs/WorkLaptop
Here's the trick, if you run mount -o remount,ro /
now then you'll get told it's in use, so instead use the magic sysrq keys: SysRq+s to force sync, then SysRq+u to force remount readonly.
(SysRq on my laptop was Alt Gr + Print Screen)
- Now make the VDI file with
vboxmanage convertfromraw /dev/sda8 worklaptop.vdi
This will take a long time. I got about 10GB/hour with both machines using 802.11n wifi. Next time I'll use a wired connection.
When It eventually finishes, you'll have a disk image of your laptop's Linux partition.
Windows 10 desktop
- Start VirtualBox
- Click New
- Click Expert Mode
- Give your VM a name
- Select the OS type and version (eg. Linux, Ubuntu (64 bit)
- Give it enough RAM
- Select "Use an existing virtual hard disk file" radio button
- Click the yellow folder icon
- Browse to and select the VDI file from the previous step
- Click Create
- Select your new VM
- Click Settings
- Click Storage
- Select the optical Drive
- Click the disc icon and select "Choose Virtual Optical Disc File"
- Browse to and select the boot.iso image
- Click System
- Verify the optical drive is above hard disk in the boot order
- Check Enable EFI
- Click OK
Now you should be able to boot your VM.
add a comment |
Here's how I've just done that:
Preparation
Windows 10 desktop
- Install VirtualBox
The following steps are to provide a way to copy the disk image. I didn't have an external storage device with enough space to hold my laptop's disk image so I mounted my Windows machine vía SSH. There are other ways to do this, but this was easiest for me in the situation.
- Enable WSL and reboot when prompted
- Install Ubuntu from the Windows Store
- Start Ubuntu from the Start Menu
- Run
sudo apt install openssh-server
to install sshd - Run
sudo nano /etc/ssh/sshd_config
to edit the sshd configuration - Change
PasswordAuthentication no
toPasswordAuthentication yes
, then press Ctrl+x, y, enter to save - Run
sudo /etc/init.d/ssh restart
The Windows Firewall dialog should pop up now, click Accept to allow incoming connections.
Linux laptop
Run sudo apt install sshfs virtualbox
to give you the sshfs
and vboxmanage
commands.
Now's a good time to test you can make an SSH connection to your Windows machine
Creating a boot image
If, in the next section, you create an image of your entire disk instead of just the Linux partition, then you probably won't need to do this.
I wanted to save space so only took my Linux root partition, but this isn't bootable by itself so I created a bootable ISO image:
Linux laptop
- Install packages required by grub-mkrescue:
sudo apt install grub-pc-bin xorriso
- Make a directory to hold the bootable files:
mkdir -p efibootiso/boot/grub
- Copy the Grub EFI bootloader:
cp /usr/lib/grub/x86_64-efi/* efibootiso/boot/grub/
- Copy your laptop's Grub configuration:
cp /boot/grub/grub.cfg efibootiso/boot/grub
- Make the image:
grub-mkrescue -o boot.iso efibootiso
- Copy it to your Windows machine:
scp boot.iso username@windowsten:/mnt/d/VMs/WorkLaptop/
Creating the disk image
Linux laptop
- Reboot and select advanced options, then recovery mode from the bootloader
- Select network from the recovery menu to enable networking
- Then select the root console option and press enter
- Run mount to check your root partition (mine is
/dev/sda8
) - Make a temporary directory to mount your Windows machine, eg:
mkdir /run/windowsten
- Mount your Windows machine, eg:
sshfs username@windowsten:/ /run/windowsten
- Change directory to the location you want to save your disk image, eg:
cd /run/windowsten/mnt/d/VMs/WorkLaptop
Here's the trick, if you run mount -o remount,ro /
now then you'll get told it's in use, so instead use the magic sysrq keys: SysRq+s to force sync, then SysRq+u to force remount readonly.
(SysRq on my laptop was Alt Gr + Print Screen)
- Now make the VDI file with
vboxmanage convertfromraw /dev/sda8 worklaptop.vdi
This will take a long time. I got about 10GB/hour with both machines using 802.11n wifi. Next time I'll use a wired connection.
When It eventually finishes, you'll have a disk image of your laptop's Linux partition.
Windows 10 desktop
- Start VirtualBox
- Click New
- Click Expert Mode
- Give your VM a name
- Select the OS type and version (eg. Linux, Ubuntu (64 bit)
- Give it enough RAM
- Select "Use an existing virtual hard disk file" radio button
- Click the yellow folder icon
- Browse to and select the VDI file from the previous step
- Click Create
- Select your new VM
- Click Settings
- Click Storage
- Select the optical Drive
- Click the disc icon and select "Choose Virtual Optical Disc File"
- Browse to and select the boot.iso image
- Click System
- Verify the optical drive is above hard disk in the boot order
- Check Enable EFI
- Click OK
Now you should be able to boot your VM.
add a comment |
Here's how I've just done that:
Preparation
Windows 10 desktop
- Install VirtualBox
The following steps are to provide a way to copy the disk image. I didn't have an external storage device with enough space to hold my laptop's disk image so I mounted my Windows machine vía SSH. There are other ways to do this, but this was easiest for me in the situation.
- Enable WSL and reboot when prompted
- Install Ubuntu from the Windows Store
- Start Ubuntu from the Start Menu
- Run
sudo apt install openssh-server
to install sshd - Run
sudo nano /etc/ssh/sshd_config
to edit the sshd configuration - Change
PasswordAuthentication no
toPasswordAuthentication yes
, then press Ctrl+x, y, enter to save - Run
sudo /etc/init.d/ssh restart
The Windows Firewall dialog should pop up now, click Accept to allow incoming connections.
Linux laptop
Run sudo apt install sshfs virtualbox
to give you the sshfs
and vboxmanage
commands.
Now's a good time to test you can make an SSH connection to your Windows machine
Creating a boot image
If, in the next section, you create an image of your entire disk instead of just the Linux partition, then you probably won't need to do this.
I wanted to save space so only took my Linux root partition, but this isn't bootable by itself so I created a bootable ISO image:
Linux laptop
- Install packages required by grub-mkrescue:
sudo apt install grub-pc-bin xorriso
- Make a directory to hold the bootable files:
mkdir -p efibootiso/boot/grub
- Copy the Grub EFI bootloader:
cp /usr/lib/grub/x86_64-efi/* efibootiso/boot/grub/
- Copy your laptop's Grub configuration:
cp /boot/grub/grub.cfg efibootiso/boot/grub
- Make the image:
grub-mkrescue -o boot.iso efibootiso
- Copy it to your Windows machine:
scp boot.iso username@windowsten:/mnt/d/VMs/WorkLaptop/
Creating the disk image
Linux laptop
- Reboot and select advanced options, then recovery mode from the bootloader
- Select network from the recovery menu to enable networking
- Then select the root console option and press enter
- Run mount to check your root partition (mine is
/dev/sda8
) - Make a temporary directory to mount your Windows machine, eg:
mkdir /run/windowsten
- Mount your Windows machine, eg:
sshfs username@windowsten:/ /run/windowsten
- Change directory to the location you want to save your disk image, eg:
cd /run/windowsten/mnt/d/VMs/WorkLaptop
Here's the trick, if you run mount -o remount,ro /
now then you'll get told it's in use, so instead use the magic sysrq keys: SysRq+s to force sync, then SysRq+u to force remount readonly.
(SysRq on my laptop was Alt Gr + Print Screen)
- Now make the VDI file with
vboxmanage convertfromraw /dev/sda8 worklaptop.vdi
This will take a long time. I got about 10GB/hour with both machines using 802.11n wifi. Next time I'll use a wired connection.
When It eventually finishes, you'll have a disk image of your laptop's Linux partition.
Windows 10 desktop
- Start VirtualBox
- Click New
- Click Expert Mode
- Give your VM a name
- Select the OS type and version (eg. Linux, Ubuntu (64 bit)
- Give it enough RAM
- Select "Use an existing virtual hard disk file" radio button
- Click the yellow folder icon
- Browse to and select the VDI file from the previous step
- Click Create
- Select your new VM
- Click Settings
- Click Storage
- Select the optical Drive
- Click the disc icon and select "Choose Virtual Optical Disc File"
- Browse to and select the boot.iso image
- Click System
- Verify the optical drive is above hard disk in the boot order
- Check Enable EFI
- Click OK
Now you should be able to boot your VM.
Here's how I've just done that:
Preparation
Windows 10 desktop
- Install VirtualBox
The following steps are to provide a way to copy the disk image. I didn't have an external storage device with enough space to hold my laptop's disk image so I mounted my Windows machine vía SSH. There are other ways to do this, but this was easiest for me in the situation.
- Enable WSL and reboot when prompted
- Install Ubuntu from the Windows Store
- Start Ubuntu from the Start Menu
- Run
sudo apt install openssh-server
to install sshd - Run
sudo nano /etc/ssh/sshd_config
to edit the sshd configuration - Change
PasswordAuthentication no
toPasswordAuthentication yes
, then press Ctrl+x, y, enter to save - Run
sudo /etc/init.d/ssh restart
The Windows Firewall dialog should pop up now, click Accept to allow incoming connections.
Linux laptop
Run sudo apt install sshfs virtualbox
to give you the sshfs
and vboxmanage
commands.
Now's a good time to test you can make an SSH connection to your Windows machine
Creating a boot image
If, in the next section, you create an image of your entire disk instead of just the Linux partition, then you probably won't need to do this.
I wanted to save space so only took my Linux root partition, but this isn't bootable by itself so I created a bootable ISO image:
Linux laptop
- Install packages required by grub-mkrescue:
sudo apt install grub-pc-bin xorriso
- Make a directory to hold the bootable files:
mkdir -p efibootiso/boot/grub
- Copy the Grub EFI bootloader:
cp /usr/lib/grub/x86_64-efi/* efibootiso/boot/grub/
- Copy your laptop's Grub configuration:
cp /boot/grub/grub.cfg efibootiso/boot/grub
- Make the image:
grub-mkrescue -o boot.iso efibootiso
- Copy it to your Windows machine:
scp boot.iso username@windowsten:/mnt/d/VMs/WorkLaptop/
Creating the disk image
Linux laptop
- Reboot and select advanced options, then recovery mode from the bootloader
- Select network from the recovery menu to enable networking
- Then select the root console option and press enter
- Run mount to check your root partition (mine is
/dev/sda8
) - Make a temporary directory to mount your Windows machine, eg:
mkdir /run/windowsten
- Mount your Windows machine, eg:
sshfs username@windowsten:/ /run/windowsten
- Change directory to the location you want to save your disk image, eg:
cd /run/windowsten/mnt/d/VMs/WorkLaptop
Here's the trick, if you run mount -o remount,ro /
now then you'll get told it's in use, so instead use the magic sysrq keys: SysRq+s to force sync, then SysRq+u to force remount readonly.
(SysRq on my laptop was Alt Gr + Print Screen)
- Now make the VDI file with
vboxmanage convertfromraw /dev/sda8 worklaptop.vdi
This will take a long time. I got about 10GB/hour with both machines using 802.11n wifi. Next time I'll use a wired connection.
When It eventually finishes, you'll have a disk image of your laptop's Linux partition.
Windows 10 desktop
- Start VirtualBox
- Click New
- Click Expert Mode
- Give your VM a name
- Select the OS type and version (eg. Linux, Ubuntu (64 bit)
- Give it enough RAM
- Select "Use an existing virtual hard disk file" radio button
- Click the yellow folder icon
- Browse to and select the VDI file from the previous step
- Click Create
- Select your new VM
- Click Settings
- Click Storage
- Select the optical Drive
- Click the disc icon and select "Choose Virtual Optical Disc File"
- Browse to and select the boot.iso image
- Click System
- Verify the optical drive is above hard disk in the boot order
- Check Enable EFI
- Click OK
Now you should be able to boot your VM.
edited Dec 11 '18 at 22:10
answered Dec 11 '18 at 17:11
Aaron FAaron F
1011
1011
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f220125%2fcreate-an-image-file-of-a-running-linux-system%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
how is the system set up and what imaging tools do you have access to? if you are using lvm it's super easy and can run on a live system. Some of the other tools require offline imaging.
– RobotHumans
Dec 9 '10 at 13:34
You need to provide more detail here, in order to get useful answers. What was "the program" that you tried? What were the image files it produced (their name and size at least)? Are you looking to replace your current OS at home, dual-boot, or run the Linux image in a VM? In any case what is your current OS at home? Do you need to make the image while the OS is actually running or would stopping it for a time be acceptable? (note: edit the extra detail into your question rather than as a comment, or the info could end up hidden after more comments are added by others)
– David Spillett
Dec 9 '10 at 14:08