LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-05-2008, 07:36 AM   #1
Brian RW
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Rep: Reputation: 0
Second HDD (D:) system changed after clean-installing Ubuntu on C:


I have installed Ubuntu on a new HDD (C but accidentally left my second HDD connected. The radio button for the second drive (D: under WinXP -NTFS) was unmarked so I would have expected that it should not have touched it. Now I have a second disk, that was full of my daughters homework, that just has a series of directories in it all containing a log file and something else. I cannot open any of the data in Ubuntu or Windows.
I feel that the data is still there somewhere but I just do not have a clue how to get to it.
Any help to recover or educate me would be very much appreciated.
 
Old 08-05-2008, 08:17 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
First, don't do anything that might write to that drive (partition). This will protect whatever data is still there.

Next, note that the nomenclature can be ambiguous. Windows uses "drive" to mean a partition--thus the "C Drive" and the "D Drive" might be both on the same physical harddisk--or not. Linux, however, uses a notation that identifies both the physical drive and the partition. e.g. (for IDE/PATA):
hda = drive #1
hda1 = first partition on dirve 1
hdb2 = second partition on drive 2
etc.

When installing Ubuntu, did you do manual partitioning, or something else (including the option to take the whole disk)? Do you remember what information you were given on the partition layout?

Regardless of how much you can recall, boot into Ubuntu, open a terminal, and run "sudo fdisk -l". Post the results here.
Also, if you can see the problem partition with Ubuntu, tell us more about what is there. e.g., suppose it is mounted at /mnt/somedisk. Simply do "cd /mnt/somedisk" and then "ls".**

When we know what is where, we can tackle recovery. Again, don't write to the partition.

Post back with any questions. While you are waiting, get an order placed for a USB external harddrive, for backups.

** More on mounting and inspecting partitions:
sudo fdisk -l tells you what your partitions are
sudo mount tells you what is mounted
To look at one that is not mounted---eg hda3:
sudo mkdir /mnt/name
sudo mount /dev/hda3 name
cd name
ls


"name" can be anything not already appearing in /mnt

If you get tired of typing "sudo", then turn on the root account using "sudo passwd root"
 
Old 08-05-2008, 12:54 PM   #3
Brian RW
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Original Poster
Rep: Reputation: 0
Hi pixellany, Thanks for the quick response and the useful help with commands. Firstly, I have 2 physical hard disks, and usually back up to another PC. In this instance I dropped a clanger by not disconnecting HDD2 when I was experimenting with Linux. Here goes with the data:
brian@brian-desktop:~$ sudo fdisk -l
[sudo] password for brian:

Disk /dev/sda: 6448 MB, 6448619520 bytes
240 heads, 63 sectors/track, 833 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x7a4c7a4c

Device Boot Start End Blocks Id System
/dev/sda1 * 1 833 6297448+ 7 HPFS/NTFS

Disk /dev/sdb: 20.4 GB, 20409532416 bytes
255 heads, 63 sectors/track, 2481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x32cf32ce

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1163 9341766 7 HPFS/NTFS
/dev/sdb2 1164 2481 10586835 5 Extended
/dev/sdb5 1164 2419 10088788+ 83 Linux
/dev/sdb6 2420 2481 497983+ 82 Linux swap / Solaris
brian@brian-desktop:~$

Tried cd /mount/ etc with no luck - see line 3 below.

brian@brian-desktop:~$ cd /mnt/dev/sdb
bash: cd: /mnt/dev/sdb: No such file or directory
brian@brian-desktop:~$ cd/ mnt/dev/sdb1
bash: cd/: No such file or directory
brian@brian-desktop:~$ sudo mount
[sudo] password for brian:
/dev/sdb5 on / type ext3 (rw,relatime,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.24-19-generic/volatile type tmpfs (rw)
/dev/sdb1 on /media/ HDD DISK 2 type fuseblk (rw,nosuid,nodev,noatime,allow_other,blksize=4096)
securityfs on /sys/kernel/security type securityfs (rw)
gvfs-fuse-daemon on /home/brian/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=brian)
brian@brian-desktop:~$

This means little to me so I put myself in your hands. Thanks.
 
Old 08-05-2008, 02:28 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,528

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
Are you able to boot Ubuntu or are you using the Live CD? You skipped at least one step in pixellany's suggestion. Log on, open a terminal and type: mkdir /mnt/ubuntu, hit the enter key and type: mount -t ext3 /dev/sdb5 /mnt/ubuntu. After doing this, you should be able to see your files by changing directories, type: cd /mnt/ubuntu, the run the command:
ls -l in that directory and you should see directories and files.

Your fdisk -l output shows windows on sda1 and sdb1 with Ubuntu on sdb5. You should be able to see the windows folders/files by running the commands above and substituting windows for ubuntu and sda1 for sdb5.

I'm not sure what else to suggest as I'm not sure what else your problem is. Were you planning to boot from windows or Ubuntu? Did you install the Grub bootloader during your Ubuntu installation? If you want to boot with Grub/Ubuntu, post the contents of the file menu.lst which is in the /boot/grub directory of Ubuntu partition.
 
Old 08-05-2008, 03:10 PM   #5
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
What is your "first drive" and what is your "second drive"?

As detected by Linux, your "first drive" (sda) is a single partition drive with a Windows (NTFS) file system on it. Your "second drive" has two physical partitions of roughly equal size. The first partition (sdb1) is a Windows partition; the second partition (sdb2) is an extended partition with two virtual partitions (sda5 and sda6) on it. Sda5 shows as your Linux installation.

Is this correct, to the best of your knowledge? In this case, probably sda1 is your Windows system and sdb1 is your data partition with the homework on it?

How did you do your install? Did you repartition sdb to make room? You did not specify which release of Ubuntu, but all later versions would have taken pains to reorganize the partition in order to protect the data before resizing it.

Your partition table looks OK.

I strongly suspect the data is safe. Why you cannot read it is not obvious to me, but it won't take long to figure it out.

What is in your file /etc/fstab? Please print that out here. Also, what directories are in /mnt? What directories are in /media?

Do you have ntfs-3g installed on your system (you might try "locate ntfs-3g" or you might try "find -name ntfs-3g", or you could ask the package manager "audacity" to tell you).

Last edited by jiml8; 08-05-2008 at 03:12 PM.
 
Old 08-05-2008, 06:22 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Is your daughters stuff on the windows drive? If so, then look in /media/.
This line "/dev/sdb1 on /media/ HDD DISK 2 type fuseblk (rw,nosuid,nodev,noatime,allow_other,blksize=4096)" indicates it was mounted automatically. It does seem to have a stupid label that begins with a space however. You might want to fix that in Windows if possible because spaces in Labels can cause problems and one that begins with a space even more so.

It wasn't a mistake not disconnecting a drive before installing Ubuntu. After reconnecting, the device nodes will be different. Just be careful installing. Use the expert mode instead of selecting an entire drive and install into unoccupied space on the drive.

I wouldn't recommend formatting partitions before an install as some people do. This makes it too easy to select the wrong partition. Let the installer create new partitions in non-partitioned space.

Always pay attention to what the partitions are. Don't rely on C: and D:. They can even change in Windows when you add a second drive.
 
Old 08-09-2008, 04:30 PM   #7
Brian RW
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Original Poster
Rep: Reputation: 0
Hello All
Thanks for the continuing adbvice.
Firstly let me clarify my installation:
I have 2 physical hard disks which are sda1 which has Ubuntu installed and also dual boots into WinXP Pro with the partition formatted to NTFS (C: in Windows speak)and the second HDD is now sdb which was formatted NTFS and had windows files on it (my daughters homework). It was never my intention to use this drive for anything else.
I have no problems with drive sda all is working well but I cannot figure out what has happened to sdb. I did not knowingly instruct Ubuntu to touch this drive.
All following comments refer to drive sdb:
If I boot into windows, the drive shows no folders.
If I boot into Ubuntu I get lots of folders with the same two files and folders in it.
Folders are named RP1 through RP46 and most contain a file called MountPointManagerRemoteDatabase and a file called Tracking.log.
Path from copy file name is:
/media/ HDD DISK 2/System Volume Information/_restore{4D6C46F0-61CE-4FD8-93F3-EF9BB392168C}
and another similarly named folder that appears empty but when I try to copy the file name as above it just pastes the word
Message:
I also have a first level folder that all the above reside in called SystemVolumeInformation/

I assume the RP files are some form of restore point information but I have absolutely no idea what to with them.
 
Old 08-09-2008, 07:08 PM   #8
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Don't panic, even if your NTFS partition got overwritten somehow, you can still dig up the files that were there but they will take a bit of patience to reorgainze.
 
Old 08-09-2008, 07:49 PM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Look at the output of "sudo /sbin/fdisk -l" to list out all of the drives and partitions.

If there is a single partition on the drive (/dev/sdb1), you can examine it with the file command. For example: "sudo file -s /dev/sdb1".
Use the "-s" argument so you don't just get information about the device node itself.

You could also fire up the "gparted" program. Instead of reformatting a partition, select the partition and then right click and select "information".

If it is an ntfs partition, you could try mounting it in Linux and simply backup the files there.

Suppose that the partition table is wiped out but it wasn't formatted. You could use the "fdisk" program to re-partition the program. You said that the entire drive use used, so when creating the partition, you can use the defaults which start at sector 1 and end at the last sector. Then change the type to "7", write the table, exit the program and reboot. Hopefully, the filesystem itself will be intact and you can use it again. You may need to boot into windows and let windows repair it if it is marked dirty.
 
Old 08-09-2008, 08:03 PM   #10
garyg007
Member
 
Registered: Aug 2008
Location: north-east ohio
Distribution: Debian-squeeze/stable;
Posts: 279
Blog Entries: 1

Rep: Reputation: 31
Lets clarify something.In your post which said
Quote:
Firstly let me clarify my installation:
I have 2 physical hard disks which are sda1 which has Ubuntu installed and also dual boots into WinXP Pro with the partition formatted to NTFS (C: in Windows speak)and the second HDD is now sdb which was formatted NTFS and had windows files on it (my daughters homework). It was never my intention to use this drive for anything else.
There are errors.
Lets take a close look at the fdisk -l you posted

Quote:
brian@brian-desktop:~$ sudo fdisk -l
[sudo] password for brian:

Disk /dev/sda: 6448 MB, 6448619520 bytes
240 heads, 63 sectors/track, 833 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x7a4c7a4c

Device Boot Start End Blocks Id System
/dev/sda1 * 1 833 6297448+ 7 HPFS/NTFS

Disk /dev/sdb: 20.4 GB, 20409532416 bytes
255 heads, 63 sectors/track, 2481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x32cf32ce

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1163 9341766 7 HPFS/NTFS
/dev/sdb2 1164 2481 10586835 5 Extended
/dev/sdb5 1164 2419 10088788+ 83 Linux
/dev/sdb6 2420 2481 497983+ 82 Linux swap / Solaris
brian@brian-desktop:~$
Linux is NOT on sda1 it is on your second hard drive - which is sdb - fdisk shows linux is on sdb5 and the swap file is sdb6. sdb1 contains an ntfs file system - which is probably the data you are looking for.

Windows is on sda - the first hard drive, which has only one partition - sda1, and is bootable.

The mount command you ran, shows that sdb1 is mounted to a folder in /media. The blank in the first position presents a small problem

Boot linux; make sure that ntfs or ntfs-3g is installed on your system; open the "/media" folder. in it you should see a folder named something like " HDD DISK 2" - this should be the one you are looking for.
What concerns me is that in the list of mounted files, sdb1 shows a "type fuseblk" not ntfs; (I do not know what fuseblk is)

OK, did some research, I now know what "fuseblk" is

Last edited by garyg007; 08-09-2008 at 08:22 PM.
 
Old 08-12-2008, 07:31 AM   #11
Brian RW
LQ Newbie
 
Registered: Jul 2008
Posts: 12

Original Poster
Rep: Reputation: 0
SOLVED
Data recovered. Thanks GaryG for pointing out that Linux was on sdb not sda, I was not conscious of that until you pointed it out.
It's amazing what can be achieved when you look in the right place.
Now my data is backed up to CD I am going to format the drive and start again from a clean HDD!! (and only use one of them until I know what I am doing).
Can someone advise how to format the HDD from Linux please.
Also, will using the 'use complete drive' option format the HDD cleanly (including any legacy Windows bits)if I do a full re-install?
Once again, Thanks to everybody in this thread. This forum is brilliant!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
finished clean install of xp, best method for installing Ubuntu 7.10 J23 Linux - Laptop and Netbook 12 04-22-2008 03:15 AM
Installing Ubuntu on External HDD; PC has no internal HDD 449 Ubuntu 2 11-28-2007 05:12 PM
Ubuntu changed hdd TOC, cannot revert synchronous0987 Ubuntu 4 06-04-2006 04:50 AM
Installing ATA/IDE HDD on SATA HDD System Drahcir Linux - Hardware 10 05-31-2006 02:32 AM
Installing a CLEAN Debian System questions terfy Debian 31 01-08-2005 03:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration