Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

1 votes
0 answers
33 views
Missing ufs executable in partclone Linux package
I would like to use partclone on Linux to image an external USB-disk I have formatted with FreeBSD. I am using the Devuan GNU/Linux distribution and I have installed the `partclone` package. The [project's README][1] says that the tool supports the `ufs` filesystem through an executable `partclone.u...
I would like to use partclone on Linux to image an external USB-disk I have formatted with FreeBSD. I am using the Devuan GNU/Linux distribution and I have installed the partclone package. The project's README says that the tool supports the ufs filesystem through an executable partclone.ufs. The manpage installed on my system confirms this: ufs | ufs2 partclone.ufs However, there is no executable partclone.ufs installed on my system. There is a file /usr/sbin/partclone.xfs for xfs but there is no file /usr/sbin/partclone.ufs Do you know if it is possible to get this tool from some other source? The documentation I have found on the partclone home page has not helped much so far.
Giorgio (847 rep)
Jul 12, 2025, 05:27 PM
0 votes
0 answers
41 views
How do I create a restorable Clonezilla image from a rootfs directory?
I've built a Debian rootfs for an embedded Linux platform using `debootstrap` et al. My goal is to make this installable to my devices over the network. I previously built [my own solution](https://github.com/rgov/netinstall) using iPXE but I'm evaluating switching to Clonezilla. However, I am not c...
I've built a Debian rootfs for an embedded Linux platform using debootstrap et al. My goal is to make this installable to my devices over the network. I previously built [my own solution](https://github.com/rgov/netinstall) using iPXE but I'm evaluating switching to Clonezilla. However, I am not cloning an existing drive; I want to make the restorable image from my rootfs directory, and populate the necessary metadata fields about the partitions for Clonezilla to recreate on restore. What is the process for "manually" creating a Clonezilla restore image? E.g., should I create a disk image with mkfs && mount -o loop and then clone it? Is there some incantation of partclone that supports this? (A process that doesn't require root and/or that works inside a Docker container would be preferred, since that's easier to deploy via CI.)
rgov (253 rep)
Nov 4, 2024, 10:25 PM • Last activity: Nov 4, 2024, 10:54 PM
0 votes
1 answers
439 views
mount complains about exFAT when mounting partclone image of NTFS partition
I've made a backup of an NTFS partition with partclone, like this: partclone.ntfs -cs /dev/sdk1 -o ./ntfs_backup.img In case that's relevant: The physical hard drive was sitting in a USB dock. Now, I'd like to compare the contents of that image with the contents of the partition, which have changed...
I've made a backup of an NTFS partition with partclone, like this: partclone.ntfs -cs /dev/sdk1 -o ./ntfs_backup.img In case that's relevant: The physical hard drive was sitting in a USB dock. Now, I'd like to compare the contents of that image with the contents of the partition, which have changed in the meantime. To do that, I've put the hard drive in the USB dock again, and it shows up alright as having 4 NTFS partition, and nothing else. Then, I am trying to mount the image with the original state of that partition, but that fails: # mount ./ntfs_backup.img /mnt/ntfs_backup FUSE exfat 1.3.0 ERROR: exFAT file system is not found. Why on earth is exFAT being mentioned here? I read through this question here and tried using the `-o loop` option, but that changes nothing. I also tried specifying the file system type explicitly: # mount -t ntfs ./ntfs_backup.img /mnt/ntfs_backup NTFS signature is missing. Failed to mount '/dev/loop10': Das Argument ist ungültig The device '/dev/loop10' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around? Looking closer, however, it seems that partclone images are not directly mountable, even though I did not compress this one (because I wanted to be able to mount it directly). According to a few other resources, I should be using `partclone.restore` to convert the cloned image file to a ... regular image file? However: # cat ./ntfs_backup.img | partclone.restore -C -s - -O ./ntfs_backup.img Partclone v0.3.13 http://partclone.org Starting to restore image (-) to device (./ntfs_backup_mountable.img) device (./ntfs_backup_mountable.img) is mounted at error exit Partclone fail, please check /var/log/partclone.log ! I suppose I can skip the piping here because the image is not compressed, but running `partclone.restore -C -s ./ntfs_backup.img -o ntfs_backup.img` gives me the same error. ...what am I doing wrong? For this time, I do need to mount the image (which I also have as a n fsarchive file, in case that helps at all), but for the future, I wouldn't mind knowing how to create a mountable image of a partition directly. **Update** Following some advice from @kanehekili used `ntfs-3g` to specify the file system type: # mount -t ntfs-3g ./ntfs_backup.img /mnt/ntfs_backup NTFS signature is missing. Failed to mount './ntfs_backup.img': Das Argument ist ungültig The device '/ntfs_backup.img' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around? So, interestingly, this no longer tries to refer to `/dev/loop10`. I don't know what to make of it, though. I think I must be misunderstanding something, or the way I created the images is not compatible with the mounting process. I *was* able to clone the image back onto another hard drive without problems, though, using `partclone.ntfs`. This means the immediate problem is solved, but I'd still like to be able to create an image of a partition (using partclone -- or fsarchiver) which can be mounted, at least read-only.
Zak (437 rep)
Jun 24, 2020, 08:13 PM • Last activity: Jul 4, 2020, 09:01 PM
0 votes
1 answers
294 views
In LINUX: Using dd to transfer shrunk partitions on a 2TB HDD to a 500GB SSD
A source HDA (2TB mechanical HDD) has 5 partitions on it (GPT) that used to occupy the entire capacity of the 2TB HDA. The Operating System resident on the source drive *is* Windows 10. Since the majority of the 'data' partition was unused storage space, and occupied 1.5TB of the drive capacity, it...
A source HDA (2TB mechanical HDD) has 5 partitions on it (GPT) that used to occupy the entire capacity of the 2TB HDA. The Operating System resident on the source drive *is* Windows 10. Since the majority of the 'data' partition was unused storage space, and occupied 1.5TB of the drive capacity, it was shrunk, using gparted, to about 350GB, and the 'Push Button Recovery' partition (above it on the source HDA) was moved downward to be contiguous with the data partition. The resultant state of the source HDA is 5 partitions occupying less than 400GB on a 2TB HDA, with the excess storage space on the drive being unallocated space. Proposed target device is a Samsung 500GB SDD, which is currently in an unallocated state (no partitions defined and no boot structures written to the drive). Hypothesis: I can use dd (bs=1M, no count parameter specified) to write directly from the source device to the target device, since the aggregate partition sizes on the source device amount to less than the capacity of the target device; and have only an anomalous condition in what will be the unallocated space that results on the target device, post transfer. Addressing this anomalous unallocated region of the target device by relocating the 'Push Button Recovery' partition to the upper end of the drive space, and growing the data partition to fill the remainder of the unallocated space on the target device, using gparted should work and leave me with a bootable device. Question: I don't tinker with windows systems unless I get backed into a corner by somebody else (like a family member), so I do not have a great deal of intuition in dealing with such situations; so, can anybody see why this would produce a non-bootable target SSD before I waste the time doing this? # # # # # # UPDATE # # # # # # OK....I'm following-up on this--merely to let others know what ultimately worked in this particular situation: Partition arrangement on the source HDD: Partition FS Label Size Flags /dev/sdg1 ntfs Recovery 600 MiB hidden, diag /dev/sdg2 fat32 ESP 300 MiB boot, esp /dev/sdg3 unknown 128 MiB msftres /dev/sdg4 NTFS User Data Space 350 GiB msftdata /dev/sdg5 NTFS Push Button Reset 16.61 GiB hidden, diag Unallocated -- -- 1.5 TiB -- Partition arrangement on the target SSD: Partition FS Label Size Flags /dev/sdh1 ntfs Recovery 600 MiB hidden, diag /dev/sdh2 fat32 ESP 300 MiB boot, esp /dev/sdh3 unknown 128 MiB msftres /dev/sdh4 NTFS User Data Space 448.15 GiB msftdata /dev/sdh5 NTFS Push Button Reset 16.61 GiB hidden, diag A lot of time was spent trying various approaches to addressing the issue at hand, with unsatisfactory results. Because allocated time was expiring, the installed OS recovery facilities were used to create 'restore' media, and perform an OS recovery to the SSD installed in the host system. With both drives attached to a Debian 8.5 based computer, partclone_0.2.73-2+b1 (partclone.ntfs) was used to write the user data partition from the source HDD to the the target SSD. (/dev/sdg4 to /dev/sdh4) While a windows-agnostic solution is preferred, this method produces a bootable target SSD with all original user data intact, and mismatches between partition tables were avoided. Info on partclone can be found at: https://packages.debian.org/jessie/admin/partclone https://packages.debian.org/stretch/admin/partclone https://manpages.debian.org/testing/partclone/index.html
AllanGH (9 rep)
Mar 3, 2019, 12:37 AM • Last activity: Mar 22, 2019, 02:51 AM
2 votes
0 answers
1349 views
Dumping a single partition with dd (not the entire disk)
I have dumped the raw partition dumped via ssh from an external system using the command: ssh root@10.10.10.10 'dd if=/dev/xvda2 bs=1M | gzip' | gunzip | dd of=xvda2.raw As you can see, only the partition is dumped `/dev/xvda2` (yes this is on purpose) because this is the / partition with all the im...
I have dumped the raw partition dumped via ssh from an external system using the command: ssh root@10.10.10.10 'dd if=/dev/xvda2 bs=1M | gzip' | gunzip | dd of=xvda2.raw As you can see, only the partition is dumped /dev/xvda2 (yes this is on purpose) because this is the / partition with all the important data for the system to boot, and we need only that, because the whole server is ~1TB with the other storage partitions, so we need to move the root partition first, spin up the server and the rest of the data will be rsync-ed. Next I tried to restore the partition: 1. Created a new disk on a temporary system, with size just a little bit larger than the xvda2.raw dump. In my case 50GB so the disk that I created is 52GB. 2. Create new partition on the disk same as original and format as ext4. 3. dd the contents back: dd if=xvda2.raw of=/dev/sde1 bs=1M conv=notrunc,noerror,sync And when I tried to mount to inspect it, I got an error: # mount /dev/sde1 /mnt/temp/ mount: /dev/sde1: can't read superblock Any suggestions of what I might be dong wrong? **A little backstory** Normally I clone the entire disk. However in this case the source system is very large so the approach is to clone just the root drive, attempt to start the new system like that and then rsync the contents for the other storage partitions. In my case I believe this would work, because the / partition has all of the contents of the server. Edit: Thank you for the pointers. After I mount the partition, and it fails, the following can be found in dmesg: [ 3530.757481] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587756: comm mount: lblock 30700 mapped to illegal pblock (length 1) [ 3530.768332] jbd2_journal_bmap: journal block not found at offset 30700 on sde1-8 [ 3530.768334] JBD2: bad block at offset 30700 [ 3530.768336] JBD2: IO error -5 recovering block 30700 in log [ 3530.768339] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587757: comm mount: lblock 30701 mapped to illegal pblock (length 1) [ 3530.776409] jbd2_journal_bmap: journal block not found at offset 30701 on sde1-8 [ 3530.776411] JBD2: bad block at offset 30701 [ 3530.776412] JBD2: IO error -5 recovering block 30701 in log [ 3530.776415] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587758: comm mount: lblock 30702 mapped to illegal pblock (length 1) [ 3530.790785] jbd2_journal_bmap: journal block not found at offset 30702 on sde1-8 [ 3530.790788] JBD2: bad block at offset 30702 [ 3530.790789] JBD2: IO error -5 recovering block 30702 in log [ 3530.790793] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587759: comm mount: lblock 30703 mapped to illegal pblock (length 1) [ 3530.802422] jbd2_journal_bmap: journal block not found at offset 30703 on sde1-8 [ 3530.802425] JBD2: bad block at offset 30703 [ 3530.802426] JBD2: IO error -5 recovering block 30703 in log [ 3530.802430] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587760: comm mount: lblock 30704 mapped to illegal pblock (length 1) [ 3530.804867] jbd2_journal_bmap: journal block not found at offset 30704 on sde1-8 [ 3530.804869] JBD2: bad block at offset 30704 [ 3530.804870] JBD2: IO error -5 recovering block 30704 in log [ 3530.804873] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587761: comm mount: lblock 30705 mapped to illegal pblock (length 1) [ 3530.805166] jbd2_journal_bmap: journal block not found at offset 30705 on sde1-8 [ 3530.805167] JBD2: bad block at offset 30705 [ 3530.805168] JBD2: IO error -5 recovering block 30705 in log [ 3530.805170] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587762: comm mount: lblock 30706 mapped to illegal pblock (length 1) [ 3530.805467] jbd2_journal_bmap: journal block not found at offset 30706 on sde1-8 [ 3530.805468] JBD2: bad block at offset 30706 [ 3530.805469] JBD2: IO error -5 recovering block 30706 in log [ 3530.805471] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587763: comm mount: lblock 30707 mapped to illegal pblock (length 1) [ 3530.805980] jbd2_journal_bmap: journal block not found at offset 30707 on sde1-8 [ 3530.805981] JBD2: bad block at offset 30707 [ 3530.805982] JBD2: IO error -5 recovering block 30707 in log [ 3530.805984] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587764: comm mount: lblock 30708 mapped to illegal pblock (length 1) [ 3530.806322] jbd2_journal_bmap: journal block not found at offset 30708 on sde1-8 [ 3530.806324] JBD2: bad block at offset 30708 [ 3530.806325] JBD2: IO error -5 recovering block 30708 in log [ 3530.806327] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587765: comm mount: lblock 30709 mapped to illegal pblock (length 1) [ 3530.806644] jbd2_journal_bmap: journal block not found at offset 30709 on sde1-8 [ 3530.806645] JBD2: bad block at offset 30709 [ 3530.820916] JBD2: recovery failed [ 3530.820919] EXT4-fs (sde1): error loading journal [ 4016.957490] EXT4-fs (sde1): mounted filesystem with ordered data mode. Opts: (null) [ 8947.062786] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587756: comm mount: lblock 30700 mapped to illegal pblock (length 1) [ 8947.063597] jbd2_journal_bmap: journal block not found at offset 30700 on sde1-8 [ 8947.063599] JBD2: bad block at offset 30700 [ 8947.063600] JBD2: IO error -5 recovering block 30700 in log [ 8947.063602] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587757: comm mount: lblock 30701 mapped to illegal pblock (length 1) [ 8947.064111] jbd2_journal_bmap: journal block not found at offset 30701 on sde1-8 [ 8947.064113] JBD2: bad block at offset 30701 [ 8947.064114] JBD2: IO error -5 recovering block 30701 in log [ 8947.064116] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587758: comm mount: lblock 30702 mapped to illegal pblock (length 1) [ 8947.064540] jbd2_journal_bmap: journal block not found at offset 30702 on sde1-8 [ 8947.064541] JBD2: bad block at offset 30702 [ 8947.064542] JBD2: IO error -5 recovering block 30702 in log [ 8947.064544] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587759: comm mount: lblock 30703 mapped to illegal pblock (length 1) [ 8947.064960] jbd2_journal_bmap: journal block not found at offset 30703 on sde1-8 [ 8947.064961] JBD2: bad block at offset 30703 [ 8947.064962] JBD2: IO error -5 recovering block 30703 in log [ 8947.064964] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587760: comm mount: lblock 30704 mapped to illegal pblock (length 1) [ 8947.065338] jbd2_journal_bmap: journal block not found at offset 30704 on sde1-8 [ 8947.065340] JBD2: bad block at offset 30704 [ 8947.065340] JBD2: IO error -5 recovering block 30704 in log [ 8947.065342] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587761: comm mount: lblock 30705 mapped to illegal pblock (length 1) [ 8947.066019] jbd2_journal_bmap: journal block not found at offset 30705 on sde1-8 [ 8947.066020] JBD2: bad block at offset 30705 [ 8947.066021] JBD2: IO error -5 recovering block 30705 in log [ 8947.066023] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587762: comm mount: lblock 30706 mapped to illegal pblock (length 1) [ 8947.080135] jbd2_journal_bmap: journal block not found at offset 30706 on sde1-8 [ 8947.080138] JBD2: bad block at offset 30706 [ 8947.080139] JBD2: IO error -5 recovering block 30706 in log [ 8947.080142] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587763: comm mount: lblock 30707 mapped to illegal pblock (length 1) [ 8947.088046] jbd2_journal_bmap: journal block not found at offset 30707 on sde1-8 [ 8947.088049] JBD2: bad block at offset 30707 [ 8947.088051] JBD2: IO error -5 recovering block 30707 in log [ 8947.088054] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587764: comm mount: lblock 30708 mapped to illegal pblock (length 1) [ 8947.088677] jbd2_journal_bmap: journal block not found at offset 30708 on sde1-8 [ 8947.088679] JBD2: bad block at offset 30708 [ 8947.088680] JBD2: IO error -5 recovering block 30708 in log [ 8947.088683] EXT4-fs error (device sde1): ext4_map_blocks:581: inode #8: block 587765: comm mount: lblock 30709 mapped to illegal pblock (length 1) [ 8947.089133] jbd2_journal_bmap: journal block not found at offset 30709 on sde1-8 [ 8947.089134] JBD2: bad block at offset 30709 [ 8947.104770] JBD2: recovery failed [ 8947.104773] EXT4-fs (sde1): error loading journal
Spirit (235 rep)
Mar 9, 2018, 05:24 PM • Last activity: Mar 9, 2018, 06:40 PM
3 votes
0 answers
371 views
Recovery files from partclone backup image without generate a large raw disk file? (like Acronis mount tib file)?
I have a 100GB files stored in a 3TB hdd (NTFS). I backuped it using partclone and resulted a 100GB partclone.pcl image file. Now I want to recovery the files (I don't care about the MBR or other unnecessary staffs, I just need the files). All tutorials online ask me to restore it to a sda1.raw dd i...
I have a 100GB files stored in a 3TB hdd (NTFS). I backuped it using partclone and resulted a 100GB partclone.pcl image file. Now I want to recovery the files (I don't care about the MBR or other unnecessary staffs, I just need the files). All tutorials online ask me to restore it to a sda1.raw dd image (probably will be 3TB?). As the partclone.pcl image can not be mounted. The problem is I don't have a 3TB free disk space... (external usb disks are too slow - not a good option) I know linux are good at piping and redirecting. So is there a way to extract the 100GB files without generating a huge 3TB unless image file?
Dsae (31 rep)
Jan 22, 2017, 04:07 PM
1 votes
1 answers
842 views
Clonezilla part-to-part doesn't show sda2 as source
I needed to replace my 500G HDD with 256G SSD drive. 1. I shrunk the original partitions, 2. properly aligned SDD's partitions on 1 MiB (2048 sectors) 3. and in Parted Magic successfully transfered sda1 (old HDD) EXT4 boot partition to new sdc1 (SSD drive) using Clonezilla's part-to-part (direct dis...
I needed to replace my 500G HDD with 256G SSD drive. 1. I shrunk the original partitions, 2. properly aligned SDD's partitions on 1 MiB (2048 sectors) 3. and in Parted Magic successfully transfered sda1 (old HDD) EXT4 boot partition to new sdc1 (SSD drive) using Clonezilla's part-to-part (direct disc to disc) transfer. **The problem: Clonezilla doesn't see my second partition on the old HDD - sda2**. This one is of 'extended' type and contains LVM2 PV. enter image description here I cannot continue with my data transfer. Can anyone chip in with an advice on how to remedy this and - maybe- why this is happening?
summer.breeze (11 rep)
Mar 15, 2016, 02:25 PM • Last activity: Mar 24, 2016, 10:17 AM
1 votes
0 answers
1130 views
clonezilla - restore OS partition image to larger/smaller partition
My old disk has failed. I have made partition images of OS partition and MRB partition instead of disk image. I have a disk but its size is smaller than the OS partition image. 1. Is it possible to restore the OS partition image to smaller partition? Will the OS bootable? How about restoring to larg...
My old disk has failed. I have made partition images of OS partition and MRB partition instead of disk image. I have a disk but its size is smaller than the OS partition image. 1. Is it possible to restore the OS partition image to smaller partition? Will the OS bootable? How about restoring to larger partition? 2. Do I also need to restore the MBR partition too?
Ron Vince (1472 rep)
Feb 9, 2016, 02:09 AM
9 votes
1 answers
20590 views
Resize VFAT partition?
I'm migrating a machine to another boot drive with more space. I've done the following: sudo partclone.vfat -c -R -o partclone.sda1.vfat.img -s /dev/sdg1 and then I created my partitions on the new device in parted, and then restored: sudo partclone.vfat -r -s partclone.sda1.vfat.img -o /dev/sdg1 Th...
I'm migrating a machine to another boot drive with more space. I've done the following: sudo partclone.vfat -c -R -o partclone.sda1.vfat.img -s /dev/sdg1 and then I created my partitions on the new device in parted, and then restored: sudo partclone.vfat -r -s partclone.sda1.vfat.img -o /dev/sdg1 The new partition is larger than the one I cloned from. $ sudo parted /dev/sdg print 1 Minor: 1 Flags: File System: fat32 Size: 1074MB (0.11%) Minimum size: 210MB (0.02%) Maximum size: 1000GB (100%) However, when I view the filesystem with df, it shows me something else: $ sudo df -h extefi/ Filesystem Size Used Avail Use% Mounted on /dev/sdg1 197M 42M 156M 22% /mnt/extefi Is there a command I can run to properly resize the filesystem to fill its partition?
Naftuli Kay (41366 rep)
Feb 3, 2016, 04:50 AM • Last activity: Feb 3, 2016, 04:57 AM
Showing page 1 of 9 total questions