Home pertition removed.

I mistakenly removed my /home of openSUSE while trying to install another distro. My root pertition is OK. openSUSE is shown in grub. but i cannot boot into it as there is no /home :frowning: is there any way to fix this without removing my openSUSE ?

Are you wanting to recover the data?

What OS did you install and did it just use the entire /home partition or divide it up?

Can you post

fdisk -l

you have to be su - or sudo
and explain anything there?

I mistakenly removed my /home of openSUSE while trying to install another distro. My root pertition is OK. openSUSE is shown in grub. but i cannot boot into it as there is no /home :frowning: is there any way to fix this without removing my openSUSE ?
I guess I would download a LiveCD, make a disk and use it to create a new home partition. If it is not the same partition on the same disk as before, then you need to edit the existing /etc/fstab file of the / main openSUSE partition and modify the /home/your_name mount command. You could then start openSUSE, with an option 3 (for init 3, don’t start X) and then log in as root at the terminal prompt. To create yourself use this command:

useradd -c ā€œFirst and Last Nameā€ -m first_name -p new_password

Then I would reboot and try to log in as your old self, but you must recreate your old settings.

Thank You,

If you can use linux fdisk (running from a live CD), and if you can create ā€œ/homeā€ to be in exactly the same spot where it previously was, then you will probably get it back with all data.

DO NOT use Windows FDISK, as that deliberately obliterates the first few sectors of a newly created partition so as to be sure that it looks unformatted to the Windows software.

I installed Ubuntu 11.4 . I had Ubuntu 10.10 an openSUSE 11.4 on my pc. I wanted to remove the both root and /home of my previous Ubuntu, but mistakenly i removed both /home of the both. i don’t want to recover the Ubuntu, but i need to recover openSUSE as that was my primary OS and i have important documents there.

This is what comes after i run sudo fdisk -l from ubuntu

opu@planet-earth:~$ sudo fdisk -l
[sudo] password for opu: 

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x10881087

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        4462    35840983+  83  Linux
/dev/sda2            4463        7012    20478976    7  HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sda3   *        7012       30402   187877377    5  Extended
Partition 3 does not end on cylinder boundary.
/dev/sda5           19761       27410    61440000    7  HPFS/NTFS
/dev/sda6           27410       30402    24034304    7  HPFS/NTFS
/dev/sda7            7012       13386    51200000   83  Linux
/dev/sda8           13386       13648     2105344   82  Linux swap / Solaris
/dev/sda9           13649       15066    11388928   83  Linux
/dev/sda10          15067       16890    14647296   83  Linux
/dev/sda11          16890       18106     9764864   83  Linux
/dev/sda12          18106       19760    13289472   83  Linux

Partition table entries are not in disk order

Here is the the /etc/fstab of openSUSE (seen from ubuntu)

/dev/disk/by-id/ata-SAMSUNG_HD251HJ_S13QJ90S211864-part8 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-SAMSUNG_HD251HJ_S13QJ90S211864-part9 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-SAMSUNG_HD251HJ_S13QJ90S211864-part10 /home                ext4       acl,user_xattr        1 2
/dev/disk/by-id/ata-SAMSUNG_HD251HJ_S13QJ90S211864-part2 /windows/C           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/ata-SAMSUNG_HD251HJ_S13QJ90S211864-part5 /windows/D           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/ata-SAMSUNG_HD251HJ_S13QJ90S211864-part6 /windows/E           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

sda10 is your /home from SUSE
It’s still there and I assume ubuntu is using sda11 and 12, but you would have to confirm that.
I guess you should be able to access sda10 from Ubuntu as it will mount partitions on the fly. And if you can, I suggest you make some kind of back up just in case.
Worst case, you have to re-install SUSE and just make sure you select sda10 as /home and use the exact same username and all should be good (assuming you didn’t format the partition and or now Ub* is using it)

I am afraid it is not. I wanted to remove the root and home of Ubuntu 10.10 and install Ubuntu 11.4 but what i did was i removed the /home of openSUSE and the /home of Ubuntu 10.10. sda10 is the root of Ubuntu. I now have root of ubuntu 10.10, root 0f openSUSE, and root and home of ubuntu 11.4 .

So you overwrote sda10 with ubuntu? Your best bet then may be PhotoRec - CGSecurity an example here PhotoRec Step By Step - CGSecurity This should allow to recover some data, but not what has been overwritten. (please read the info on the links and consider before jumping in)

You can use the same tool on what was the ubuntu10.10 /home, you should be able to recover a reasonable amount of data, but murphy’s law dictates that the data you most need is lost. Backups are important!

Oh dear
Partial recovery might be possible, but if you make mistakes like that - you might find the process rather difficult.

So… seems like i have to reinstall. I don’t care about Ubuntu 10.10 and now 11.4 also. (you may suggest a new Linux to replace Ubuntu :stuck_out_tongue: )
The important thing is I had all of my project source-codes (php and C# files and some presentations )and some video files which I must recover. So if you can please suggest me a data recovery tool.

I think you’ll be lucky to recover much because the partition will have been formatted and then written to. It’s not something I much experience with as I have never needed it. I tend to keep a backup.

So if you can please suggest me a data recovery tool.
PhotoRec, as in post #8

So… seems like i have to reinstall.
No, but work on data recovery first.

I think you’ll be lucky to recover much because the partition will have been formatted and then written to
Only some of the data will have been overwritten, and, a formatted partition can largely be handled, (quote from my previous link)

PhotoRec ignores the file system and goes after the underlying data, so it will still work even if your media’s file system has been severely damaged or reformatted.
I have tested this, i also backup data, but have been bitten, hence the testing.

:slight_smile: thanks to all. recovery was successful ! got almost everything i needed (thanks god !). did a fresh install and now installing gnome3 :slight_smile:

That’s good to read!

I guess you will be careful to keep backups of that important stuff from now on ?:wink: