Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I used dd if=/dev/sda of=~/backup.img where /dev/sda was an ext4 filesystem. I want to perform recovery on it which means I need to mount it as ext4 filesystem using extundelete application. Can anyone help me mount this properly?

Output from dumpe2fs -h:

dumpe2fs 1.42.5 (29-Jul-2012)  
Filesystem volume name:   DOROOT  
Last mounted on:          /  
Filesystem UUID:          6c4f1456-a5bb-4d1d-afd4-a13d0a1ce63d  
Filesystem magic number:  0xEF53  
Filesystem revision #:    1 (dynamic)  
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize  
Filesystem flags:         signed_directory_hash  
Default mount options:    (none)  
Filesystem state:         clean  
Errors behavior:          Continue  
Filesystem OS type:       Linux  
Inode count:              1310720  
Block count:              5242880  
Reserved block count:     262144  
Free blocks:              4116242  
Free inodes:              1127629  
First block:              0  
Block size:               4096  
Fragment size:            4096  
Reserved GDT blocks:      1022  
Blocks per group:         32768  
Fragments per group:      32768  
Inodes per group:         8192  
Inode blocks per group:   512  
Flex block group size:    16  
Filesystem created:       Thu May  3 16:58:15 2012  
Last mount time:          Sat Jul 13 10:24:27 2013  
Last write time:          Thu Mar 28 12:54:31 2013  
Mount count:              2  
Maximum mount count:      29  
Last checked:             Thu Mar 28 12:54:31 2013  
Check interval:           15552000 (6 months)  
Next check after:         Tue Sep 24 12:54:31 2013  
Lifetime writes:          724 MB  
Reserved blocks uid:      0 (user root)  
Reserved blocks gid:      0 (group root)  
First inode:              11  
Inode size:           256  
Required extra isize:     28  
Desired extra isize:      28  
Journal inode:            8  
Default directory hash:   half_md4  
Directory Hash Seed:      9eb0125c-e592-492e-87ad-aaf42f92061d  
Journal backup:           inode blocks  
Journal features:         journal_incompat_revoke  
Journal size:             128M  
Journal length:           32768  
Journal sequence:         0x0006800e  
Journal start:            23393 

Output from fdisk -lu:

Disk ssdback: 21.5 GB, 21474836480 bytes  
255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors  
Units = sectors of 1 * 512 = 512 bytes  
Sector size (logical/physical): 512 bytes / 512 bytes  
I/O size (minimum/optimal): 512 bytes / 512 bytes  
Disk identifier: 0x00000000  
Disk ssdback doesn't contain a valid partition table 

Output from df:

Filesystem Size Used Avail Use% Mounted on
/dev/sda 20G 3.4G 16G 18% /
udev 242M 8.0K 242M 1% /dev
tmpfs 99M 208K 99M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 246M 0 246M 0% /run/shm

Output from blkid /dev/sda:
/dev/sda: LABEL="DOROOT" UUID="6c4f1456-a5bb-4d1d-afd4-a13d0a1ce63d" TYPE="ext4"

share|improve this question
add comment

2 Answers 2

The dd command you used:

dd if=/dev/sda of=~/backup.img
is for backing up the harddrive(/dev/sda) to your home directory/image.img
isn't that forming a loop.

Did it worked ...??

and for mounting a partition:

 mkdir /media/mountPoint

mount /dev/sda5 /media/mountPoint

Your device will be mounted at /media/mountPoint.

share|improve this answer
    
It would not be a loop if there's another physical disk that holds the /home directory. If the system has just one physical disk, though, you're right that you'd never be able to create a complete backup using dd in this way. –  Rod Smith Sep 1 '13 at 17:28
    
hi user182904, yes I did issue the dd if=/dev/sda of=~/backup.img command –  dougvk Sep 2 '13 at 16:24
    
@dougvk If you want to do recover, don't mount it. use this commmand ** dd if=~/backup.img of=/dev/sda ** NOTE: This command will copy all the data from ~/backup.img and copy to /dev/sda, and if there is important data on /dev/sda, you'll lose it... Use it properly !! If i'm wrong somewhere, pls do tell me ..!! :) –  user182904 Sep 3 '13 at 10:32
add comment

You say that "/dev/sda was an ext4 filesystem." If this statement is accurate, it means that the entire disk was one filesystem, without a partition table. If so, fdisk will be useless on the disk, because fdisk manipulates partition tables, and your disk has no such data structure. It's valid to create a filesystem on the whole disk in this way, but it's unusual; it's much more common to create a partition table on the disk, even if you intend to use the whole thing as one filesystem. Since you didn't report device filenames with your other commands, it's unclear whether you've actually set things up in this way or if you have some sort of problem. You might be able to figure it out by using blkid, as in:

$ sudo blkid /dev/sda
/dev/sda: UUID="a139b90e-2f94-4378-bf66-fe7669808dbe" TYPE="ext4"

This example shows that /dev/sda does indeed hole a valid ext4 filesystem. You can also look for device files for partitions in /dev, as in:

$ ls /dev/sda*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sda3  /dev/sda4  /dev/sda5

This example, contrary to the earlier one, shows that /dev/sda is partitioned -- that's what the files that end in numbers refer to.

share|improve this answer
    
hi, i used the command dd if=/dev/sda of=~/sda.img and I edited my above question to include the filesystem layout and other information you requested –  dougvk Sep 2 '13 at 16:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.