6

My laptop is running Windows 7 and Ubuntu, which was installed via Wubi.

Ubuntu boots perfectly fine, but I can only log in as a guest. So in order to recover the files, I have to find root.disk so I can mount it and recover the data using ecryptfs-utils.

The file is supposed to be in C:\ubuntu\disks\, but it isn't. A file search (in Windows) didn't turn up anything else.

Where could this file have gone?

I thought the disk might be broken. But, again, I can log in as a guest.

Jorge Castro
  • 71,754
  • 3
    PSA: I can't bounty this right now due to bounty limitations, but I haven't been able to figure this out - I am offering a 100 rep bounty to the person who gets this figured out for him. Also, related. – jrg Jan 27 '12 at 21:38
  • @ObsessiveFOSS check the revisions. I bountied it, but there weren't any "good" answers that recovered the data. - http://askubuntu.com/posts/99112/revisions – jrg Jun 14 '12 at 00:39
  • Oh, sorry. Ignorance – nanofarad Jun 14 '12 at 14:57

2 Answers2

7

You can't boot a wubi install without the root.disk!!?

If the root.disk is being booted, but not visible in Windows, it points to some ntfs corruption (grub can find the root.disk and loop mount it, but windows cannot see it, but that seems strange). To rule that out, you can run chkdsk /r from Windows to repair this (there's always a danger you could lose the disk in this case, or it gets 'recovered' to the C:\found.000 folder and renamed to file0000.chk in the process). In some cases the whole disks directory is recovered to C:\found.000\dir0000.chk\ and within that there'll be the root.disk and swap.disk).

Boot in recovery mode or let the user log in as Guest and drop to a terminal and enter ls /host/ubuntu/disks to confirm they're in wubi. You can check where /host is mounted to get the partition: df or mount That will at least confirm it's a Wubi install and the partition. They may be able to copy data from /home to /host (back to the windows host partition from the virtual disk).

You can identify the root.disk via the command: sudo losetup /dev/loop0 e.g.

bcbc@ubuntu:~/$ sudo losetup /dev/loop0
/dev/loop0: [0803]:2161 (/host/ubuntu/disks/root.disk)
bcbc@ubuntu:~/$ mount | grep /host
/dev/sda3 on /host type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)

With that info you can boot a live CD, mount the /host and recover the data:

sudo mkir /media/win
sudo mount /dev/sda3 /media/win
sudo mount -o loop /media/win/ubuntu/disks/root.disk /mnt

Not sure if you can identify the root.disk from the Guest session as it's unlikely you have sudo rights, so if you can't boot in recovery mode to a root prompt, then you could boot a live CD, mount each partition and look for the file: <mountpoint>/ubuntu/disks/root.disk. But note that running the bootinfoscript will give you the same info (and maybe also some clues if there is any file system corruption).

bcbc
  • 6,026
  • 1
    That chkdsk command didn't do anything (no output). I'm pretty sure the laptop won't boot in recovery mode either (it's badly broken, crashes all the time too when you get it to start). I'll let you know if we can get it to boot in recovery mode - so far you can't get a root shell anywhere (even ctrl+alt+f1 crashes it) – Stefano Palazzo Jan 29 '12 at 23:17
  • 2
    You have to reboot the computer to complete chkdsk on the C: 'drive'. So once running: chkdsk /r it will ask you to reschedule for the next boot. It should always have some output, even if it just says it's clean. You can schedule it from the GUI as well: http://ubuntu-with-wubi.blogspot.com/2011/08/missing-rootdisk.html (there are two checkboxes shown in the screenshot, the first corresponds to chkdsk /f the second chkdsk /r) – bcbc Jan 30 '12 at 05:21
  • Okay, it did scan the disk for half an hour. But it didn't recover any files. This seemed very promising. Is there anything else to try? – Stefano Palazzo Jan 31 '12 at 13:13
  • (1) Check for root.disk in \ubuntu\disks or \found.000 (remember it can be recovered as file0000.chk but you can identify because it will be > 5GB); (2) If still not found, but can still boot Ubuntu (!!?), I'd check the partition (press 'E' on grub entry to get partition and root.disk location), then look for it on a live CD. Normally I'd suggest running 'fsck' on the root.disk but since you can't find it (!?) this seems more likely an NTFS problem; (3) This isn't a usual setup (wubi doesn't setup /home encryption); so give more info about setup and double check each step. – bcbc Jan 31 '12 at 17:38
  • 1
    One more thing - make sure the user has set Windows explorer to show all hidden or protected files (or you won't see the \found.000 directory). Or look from an administrator command prompt to be sure. – bcbc Jan 31 '12 at 17:42
0

I may be not a ubuntu geek but I am using Wubi from the very beginning,try these,

what happens when you click the FILE SYSTEM link in the side pane of the nautilus file browser? simply to the root disk right? then can't you simply goto Host directory? that is where your root file situtated. goto /ubuntu/disks/ and there is your root file.

If you can't access, there may be a error with wubi root file (sometimes windows fails to recognize the root file because of hard reset/power failure when running ubuntu) try a live cd and locate your root file and mount it using these commands,

sudo fdisk -l
sudo mkdir /win
sudo mount /dev/sdxy /win
sudo mkdir /vdisk
sudo mount -o loop /win/ubuntu/disks/root.disk /vdisk

where the "x" and the "y" in "sdxy" is replaced with the correct HDD letter (starting at a of course), and the correct partition number (starting at 1), of the Windows partition your Wubi install is on. The first command will have given you the location. Once running those commands, open up Places>Computer>Filesystem>vdisk, and you should find the contents of your root.disk in there. Now you can backup your data to external media, and reinstall Ubuntu with Wubi if you like.

Prasad RD
  • 2,013