# Solved: Get Windows files using Ubuntu live CD



## ljbirns (Mar 16, 2006)

My wife's laptop ( XP SP) crashed. Machine will not boot. Tried several window remedies to no avail. I loaded a Ubuntu Live CD. That boots. I can " see "
the HD ( 18.6GB Vol ) when I look in places. I put a thumb drive in and the Ubuntu sees it fine and I can access it but I cannot acces the HD. I tried to mount it but it 
says 'unable to Mount Selected Volumne " 
I tried to install the Ubuntu on the HD but the install says " Not Enough Room ' when it goes to partition the HD. I used 12 % as a partition amount .
It is very possible the HD is shot but if there is a way for me to get some files off it using the Ubuntu live CD that would be great. I ( obviously ) know little about linux
so any help will be appreciated.

screenshots attached

Lew


----------



## lotuseclat79 (Sep 12, 2003)

What version of Ubuntu Live CD are you using?

What kind of disks do you have: IDE or SATA (scsi)?

-- Tom


----------



## ljbirns (Mar 16, 2006)

6.06
IDE

Lew


----------



## saikee (Jun 11, 2004)

You can have all your Windows files if the partition is still healthy and not corrupted. This should be the majority case if Windows fails to boot due to possibly just one failed system file.

Ubuntu has a good security feature and protects the XP partition from unauthorized access by a normal user. You can access it as a super user in terminal.

This is what you have to do, click terminal

```
sudo su
```
Ubuntu will change you status to a root user. As root you can access all files but only in the terminal. So if you have USB hard disk with a fat32 partition bigger than the XP 18.6 Volume partition and it has been mounted as /media/diskA you can copy the content of the XP drive to it by command

```
cp -R /media/18.6 GB Volume/*   /media/diskA/
```
If you find terminal in Ubuntu tough going you can download the current version of Slax 6.0.0. and burn it into a bootable CD. It allows you to boot to the desktop as root, mount all your partitions and loaded with ntfs-3g so that you can drag and drop every files in any ntfs partition.

--------------------------
Lastly I would in your case clone the XP into another hard disk, put away the original for safe keeping, install the clone into its position and start doing whatever I need with it knowing there is a good copy to go back to. Cloning details are in here


----------



## ljbirns (Mar 16, 2006)

This is what you have to do, click terminal

```
sudo su
```
Ubuntu will change you status to a root user. As root you can access all files but only in the terminal. So if you have USB hard disk with a fat32 partition bigger than the XP 18.6 Volume partition and it has been mounted as /media/diskA you can copy the content of the XP drive to it by command

```
cp -R /media/18.6 GB Volume/*   /media/diskA/
```
I have an 80 GB external USB drive. I have used it to BU my computer. I created a Directory called Tootsie then I attached it to wife's computer. Ubuntu called it 74.5 GB volume I could access the files that were already on it in Ubuntu. Tried the above copy.
using 74.5 GB Volume as destination It ran for about 20 seconds and completed and now the external drive is unreadable on both Ubuntu and on my windows computer.
Windows says " Unable to access drive."

Lew

I


----------



## lotuseclat79 (Sep 12, 2003)

When you tried to mount the HD from your wife's laptop, what was the full mount command you used - did you try to issue a mount command from a terminal window or did you use the Ubuntu System>Disks graphical interface?

In this mount command, I assume that the mkdir /mnt/hda2 command has previously been given from the root account user. Was it something like: 
# mount -t ntfs /dev/hda2 /mnt/hda2

Have you tried doing this? I assume your wife's file system for WinXP is an NTFS file system. Is it in fact an NTFS file system or a FAT32 file system?

As I recall, by default, Ubuntu 6.0.6 LTS will mount the first disk it sees, however, you may not have the proper partition. The System>Disks selection will take you through a graphic disk browser, and if the data partition is not mounted, it will guide you through creating a directory and mount details, i.e. the equivalent of the mount command I have used above.

Using the Ubuntu Live CD, you should be able to mount your wife's laptop HD using the above mount command, and given that you have created a Tootsie directory (I presume on your USB drive), the Ubuntu environment should see your USB drive.

I prefer using the tar command myself, but let's use Saikee's cp command, and this is how I would have tried to copy the contents of the laptop computer to the USB assuming Saikee's USB mount and my mount of the HD (if I got all of the facts straight?).

cp -R /mnt/hda2/* /media/diskA/Tootsie

That said, what windows remedies did you try? A console recovery? A Reinstall?

-- Tom


----------



## ljbirns (Mar 16, 2006)

In my previous post I said that I can no longer access the 80 GB:down: external drive that I tried to copy to.( Neither in Ubuntu or using Windows on my good computer )
When I try to mount the 18.6 GB Volume ( dev/hda2 ) using # mount /mnt/dev/hda2
I get :" mount: can't find /mnt/dev/hda2 in /etc/fstab or etc/mtab "
I tried to edit filesystem table to add /dev/hda2 but can't figure out how to edit the file (even from sudo su ) File system is FAT 32

Screeshot 5 shows error message when trying to mount the external 80 GB HD using the interface not terminal which gives message as above
Screenshot 6x is the error message for the HD I am trying to access ( wife's Windows FAT 32) labeled 18.6 Gb Volume

Appreciate the help

Lew


----------



## lotuseclat79 (Sep 12, 2003)

The command: # mount /mnt/dev/hda2 is not a proper mount command.

From the Ubuntu 6.0.6 LTS Live CD:

If the file system on the laptop for WinXP is FAT32, then do (as root - i.e. sudo -i):
$ sudo -i
# mkdir /mnt/hda2
# mount -v -t fat32 /dev/hda2 /mnt/hda2

-- Tom


----------



## saikee (Jun 11, 2004)

Current Ubuntu on 2.6.20 or newer kernel has abondoned Pata disk names and call the old hda as sda now. So forget hda, hdb etc. If you are nor sure read the output from

```
sudo fdisk -l
```
If the partition didn't get copied I think it was because you didn't create a fat32 partition or format it. To write on a ntfs partition you need to load ntfs-3g and mount it as type ntfs-3g.

If Ubuntu mounted it automatically then you will not be able to write it because Ubuntu only allows you to read the USB disk partitioned in ntfs filing system.

Follow loyuseclat79 steps and adjust hda2 for sda2 if necessary. You can then write the data out.

The writing speed should be about 20Mb/s for an external USB disk.


----------



## ljbirns (Mar 16, 2006)

lotuseclat79 

Thanks. Your instructions worked and the drive mounted. However, when I go to look
at the drive ( click on the icon ) the circle in use thing ( Hourglass in XP ) goes and goes and the computer freezes up. I had to unplug it and remove the battery to quit. Tried three times. I think I'm done. And as I said I still have problem now with the external HD
which shows completely full and I can't access that either. ( my post # 5 above )
( Did the copy WORK and it filled the drive ?)

Thanks for all your help. You too saiklee.

Lew


----------



## lotuseclat79 (Sep 12, 2003)

Hi ljbirns,

I would solely use commands from the terminal window in this case. If by looking at the drive after mounting it means you used the graphic interface - my advice would be not to use any graphical software to do what needs to be done - i.e. as in your click on the icon which probably contributed to the software hanging.

The idea of using a Live CD with Ubuntu allowed you to successfully mount the HD which is one step in the process.

Now, if the external HD filled up (but as I understand it you cannot read it currently), then try at least the following:
1) verify with the HD in the laptop after you mount it successfully, cd to /mnt/hda2 and issue an ls command which would be equivalent to a dir command of the C:\ folder in WinXP - can you do that? Was it successful? If so, this verifies that you can read the HD and if you can read it, logic dictates that you can also read it and write what you read to another drive - do you see where I am going with this?
2) If the ls command was successful, then the next thing is to decide that if you currently cannot read anything in the external drive - the idea is to once again make it read/writeable by destroying everything on it, if that is ok and works for you. To do that, I think it could be reformatted as a FAT32 drive to be compatible with the HD in the laptop. I am only suggesting this only if there is nothing on the external drive that you need - it can't be read anyway - and what I am suggesting is that now that we can mount the HD in the laptop (hopefully also verifying that we can read it as demonstrated by the ls command), then if we can reformat the external HD, and then mount it properly - we have another chance at either doing a copy or a tar with compression to store the data on the HD in the laptop to the external HD - and come away with an external HD that can be read thus preserving the data you are trying to get off of the laptop's HD.

Let me know if you follow this and we will take it one step at a time command by command.

-- Tom


----------



## ljbirns (Mar 16, 2006)

lotuseclat79

Ok I followed your excellent suggestions and the " ls" command on the HD ( /mnt/hda2)
brought up a dir> see screenshot. I follow your logic with the external HD. I will attach it to my good laptop and re- format.
BTW drive is ntfs not fat32 my fault for screwing that info up.
Will let you know when I have completed ( Also putting in a new Kitchen countertop today )

Thanks for NOT giving up when I was ready to do so.

Lew


----------



## ljbirns (Mar 16, 2006)

lotuseclat79

OK I formatted the external HD, using my good windows laptop, to NTFS.

I copied one of my directories ( using Karen's Replicator ) to the External HD as a test. Worked fine.

Attached external HD to my wife's laptop and low and behold it is MOUNTED without my doing anything.
The directory that I made ( Lew ) is there and Ubuntu reads it and I can view the files. I now have great expectations !

I will await your giving me step by step instructions .

Thanks

Lew


----------



## lotuseclat79 (Sep 12, 2003)

Hi Lew,

Where there is a will, there is a way, so never give up unless it is already lost.

Ok, so - what we have now is that you have reformatted the external HD to ntfs, and the laptop is an ntfs file system HD.

Previously, we mounted the laptop HD with the mount command as follows:
$ sudo -i
# mkdir /mnt/hda2
# mount -v -t ntfs /dev/hda2 /mnt/hda2 (note: I substituted ntfs)

And, since you have attached the external HD to the laptop and it mounted we should have the following:
1) A running Live CD booted up and running with a Linux file system built in RAM of the laptop
2) An external HD mounted to the laptop with a reformatted ntfs file system
2) The laptop with an ntfs file system on its HD - not booted but spinning

From a terminal window in the Live CD environment, run the mount command:
$ mount
It should tell you all of the mounted drives with the proper device names for them
What do you see? You should see:
1) the laptop HD mounted to a directory in the Live CD Linux file system in RAM
2) the external HD mounted to a directory in the Live CD Linux file system in RAM
And since you have already verified that both HDs are readable, we now need to verify that both HDs are both readable and that your external HD is writable:

In the mount command above, I used the -v parameter to output a notification that the mount command worked and it will also tell you that the drive is (r,w) -
what I want you to do now is that using the umount command, i.e. umount, please unmount each drive separately and remount them separate as follows:
$ sudo umount /dev/hda2
$ sudo umount /dev/extrn ?????? I do not know the device name, /dev/hd?? of the external HD - the mount command should have supplied it
Now, remount each HD on the /mnt/hda2 and the /mnt/extrn directories (I am assuming the directory that the external HD is mounted on is /mnt/extrn - meaning that you have already issued the $ sudo mkdir /mnt/extrn command)
$ sudo mount -v -t ntfs /dev/hda2 /mnt/hda2
$ sudo mount -v -t ntfs /dev/extrn /mnt/extrn

Now, verify that the mount command for the external HD showed the (r,w) attribute, and since the ls command can read the C:\ root directory of the laptop HD we are set to go. Do the ls command again to make sure.

With the terminal window of the Live CD environment:
1) issue the cd command to locate to the C:\ directory of the laptop's HD
$ sudo cd /mnt/hda2
2) If your external HD is larger than the laptop HD, and you want to save the entire laptop HD, you can do so, but it is probably better to decide what you want to save in terms of the directory structure on the laptop HD starting from C:\
You do not need to save everything, but can if you want to.

As I understand it, you want to save items that can be restored back to a reconstituted WinXP laptop - is that correct?

I have to go run some errands and will be back by about 5PM.

Let me know what you decide and have done of what I have asked in this msg and we will take it from there. The local time here now is about 2:45PM EDT.

-- Tom


----------



## saikee (Jun 11, 2004)

I haven't time to go through the various posts here but a Ubuntu out of the box does not support writing to a ntfs partition. Therefore while the ntfs partitions can be read nothing can be written on the external had disk unless the filing system is fat32.

One can "apt-get install ntfs-3g" but I don't think it will work on a Live CD which cannot store information. In any case to write on a ntfs partition the partition must be mounted as a type ntfs-3g and not ntfs.

I honest believe the best way out of this is to clone the disk. Since the output of "fdisk -l" was never shown but the existing disk is recognised as hda and first USb disk seen by Ubuntu is always sda there if the USB disk is connected I would execute the cloning in the following manner

(a) In Ubuntu terminal obtain the root privilege by issuing the command

```
sudo su
```
The prompt should change slightly signifying you are now in root.

(b) Issue the command

```
fdisk -l
```
I would go over the information like a hawk, make sure my source disk is hda and hda2 is Type 7 for being ntfs filing type. My target disk is sda with 80Gb. This serves a final check to ensure which is the "source" and which is the "target".

(c) Having satisfied the source is hda and the target is sda I then cloning the disk by one line of command in dd

```
dd if=/dev/hda  of=/dev/sda bs=32768
```
The above means the input file device is hda and the output file device is sda. The transfer is 32768 bytes which is one track of 64 sectors by 512 bytes per sector. The cloning starts from the first sector of hda and will terminate when the last sector has been reached. The excess capacity in the target sda is simply empty hard disk space. Note that I did not create partition or do any formatting with sda because there is no need. The first sector copied from hda onto sda is the MBR and contains the partition table, meaning the sda will have identical partitions therefore no need to do anything. I often cut the wtapping from a newly purchase raw disk as a target and it works everytime.

(d) dd clones an external hard disk at about 20Mb/s. This thread does not tell me how big the source disk is except the hda2 is about 20Gb, say say it is a 30Gb hard disk. The time taken should therefore be 30000/20 =1500 seconds or about 42 minutes. dd on completion shows nothing except one can use the terminal again.

Prove me wrong that you cannot get the entire hard cloned in less than one hour!


----------



## lotuseclat79 (Sep 12, 2003)

Saikee must have read my mind - uh, no he didn't, but I was having 2nd thoughts while I was away just now and thinking the same thing as he mentioned.

Saikee is correct. However, I can tell you that when I mounted my unbootable WinXP Pro SP2 disk onto my Linux Fedora Core 3 ext3 file system, I was able to read my WinXP disk and copy every file of interest onto my Linux ext3 HD, saving every file but one that was in a protected folder that was not readable anyway. It was no longer important, so that is what I have done to save my WinXP data, and it still resides just where I put it to this day. I do go back and reference some documents, but not all that often anymore - not that I won't get back to it at some point, but that is where it stands today.

I would suggest that the crucial issue is to not only get the data off, but get the data back onto the WinXP disk when it is rebuilt.

That said, I think if the external HD is at least the same size as the WinXP HD, then the dd command is the way to go provided you know the data you want to save - i.e. you still do not have to do a full sector by sector clone as the above dd command Saikee has shown in his msg. For example, you only want the data - not the broken WinXP OS. So, you need to identify the folders on the WinXP laptop HD that you want to save.

When the WinXP disk is either rebuilt or reinstalled with an OEM disk, then is when the data will need to be copied back to the WinXP HD in the laptop.

Ok, so it looks like Saikee recommended to reformat the external HD as FAT32, and write the data to it then.

-- Tom


----------



## ljbirns (Mar 16, 2006)

Tom

It appears that USBDISK ( /dev/sda1) is not rw. If I look at permissions it says read only.
BTW unmount said no such command so I rebooted.
Screenshots 999 of mounting

screenshot Fdisk is the fdisk

I could re format the external to FAT 32 if we need to.

Lew


----------



## saikee (Jun 11, 2004)

My post #15 does not require any formatting. Cloning a hard disk by dd will always work if the target is the same size or just larger.

The USB hard disk is read-only because Ubuntu does not shipped ntfs-3g with the Live CD!!!!!!!

Cloning the hard disk is a better way because it is done at a hardware level when the filing system is not involved. dd just copies the "1" and "0" of the hard disk!!!!!!!!!!!!!!!! You cannot get anything simpler and more reliable than this.

dd is better because if there is corruption in the filing system the copying command with break down whereas at the hard ware level dd will stop only when part of the hard disk is not readable and that has to be in a pretty bad condition.

dd is faster and more reliable than files copying.


----------



## lotuseclat79 (Sep 12, 2003)

Hi ljbirns,

Have you looked at the folders in the WinXP laptop HD and decided whether or not to get a subfolder of importand documents only or something else? Where are the important files you need to save - i.e. full path name on the WinXP drive in the laptop from C:\?

If you cd to that folder (assuming only one) in the Ubuntu environment from the mount point, then you can issue the command:
$ sudo du -s to find out how large in 1k blocks the folder's contents are.

-- Tom

P.S. Any command I have give with $ sudo can also be done as root by first doing the sudo -i command to become the root user, and then the prompt is #.


----------



## ljbirns (Mar 16, 2006)

Tom
Saiklee

Ok I tried the clone dd if=/devhda of=/dev/sda bs=32768

it took about 22-25 minutes. Said it copied 2678851 bytes BUT when I looked at the the External drive it was completely full and unreadable > same as yesterday.

So I reformatted it to FAT 32. Permissions are now R W.
I have mounted hda2 as before and I did a ls and show the directories and the files as before. HOWEVER, if I click on that drive 18.6GB in Places > Computer I get a BLANK GUI and at the lower left corner it says 0 items 18.6 Gb free spacei

From terminal [email protected]:/mnt/hda2# ls I got as before:

802Money Backup.mbf I386 * Program Files*
AUTOEXEC.BAT IO.SYS RECYCLER*
AVG7QT.DAT MSDOS.SYS System Volume Information*
BOOT.INI Money Backup.mbf VolStp.log
BOOTSECT.DOS Money.mny WINDOWS*
CONFIG.SYS My Money Backup 0.mbf aolconnfix.exe
DELL * My Money.mny aolconnfix.txt
DELL.SDR My Music * hiberfil.sys
DRIVERS * NTDETECT.COM hph7350.log
Documents and Settings* NTLDR pagefile.sys
Food Pantry Holiday List * Palm *
The * asterik notes that those items are in BLUE
I cannot cd to Documents and Settings or any other of the listings

What do you suggest next.? If I ever get to Ricky Dr I'll buy you a beer.

I copied a screenshot from Ubuntu to the 80GB External just to see if I could. Then I plugged d the 80 GB external into my windows machine. Suddenly it is an 18.5 GB drive. The screenshot is there but that is all. The clone must have done something to it since the source drive ( hda2 ) is an 18.6 drive., but there is nothing on it.

I am now very confused. Have anice evening. I'm going to bed.

Lew

Lew


----------



## saikee (Jun 11, 2004)

I don't think the cloning has failed . It may be the way you looked at it.

When you started the cloning operation the Bios has a record of the the partition details of hda and sda. It is obvious to me that there are at least 2 partitions in hda as your XP is in hda2.

The external disk is less clear but it cannot have the same 2 partitions in exactly the same positions.

Upon the completion of the cloning process the operating system may have changed sda to have exactly the same partition table as hda but the Bios may not know that and could be still working to the old partition table before the cloning. Therefore to usea newly cloned disk the system must be rebooted first.

Does this make sense to you?

For all we know you could be just looking at the previously mounted partition held possibly in the swap. That information could be before the disk was cloned.


----------



## lotuseclat79 (Sep 12, 2003)

When you say you cannot cd to Documents and Settings - how are you trying to do that?

Have you tried to do: cd Documents* in the Live CD Ubuntu environment?

It should work.

Also, by doing the dd command the way you did it, you'll notice that you got a lot of system files that are not of interest to you in saving your files of interest.

Have you determined yet what files you want to save, for example:
Everything under Documents and Settings/My Documents

The way you would cd to that folder before issuing the dd or copy commands would be to do: cd Documents*/My*

Give it a try to see if it works.

Also, what Saikee probably meant in how you looked at the drive was that since you used the graphical interface (by clicking on the drive icon) instead of using the command line terminal window interface - you were foiled by using the graphical interface. Stick to the terminal window command line interface to look at things when doing these procedures.

-- Tom


----------



## ljbirns (Mar 16, 2006)

Good afternoon

Screenshot.png = mounting of /mnt/hda2 which is the Xp corupt HD we are trying to salvage files off of. I would like Documents and Settings, Food Pantry List if possible

Screenshot 1.png = Places > Computer. The 18.6 GB Volume usbdisk is the EXTERNAL
HD previously 74.6 GB now after the clone shown as 18.6. If I attach this drive to my good Win XP it shows total of 18.6 empty with only a screenshot file 
which I took last night off the Ubuntu. Wife's bad XP drive ( /dev/hda2 ) does not show up
but it must be there if I can mount it and list it. 

Screenshot 2.png is the Dell Utility ( see desktop shot ) opened by graphical interface double click in the Ubuntu file browser. All files in this can be opened. This Dell Utility is from wife's bad XP HD and now resides on the EXTERNAL HD 

Ignore USB DISK 28X that is a thumb drive I use to transfer the screenshots to my computer to send to you

Needless to say I am confused .

saiklee
You may be correct because the drive has changed. But HOW do I look at it
I have re booted with the external drive plugged in. It mounts but nothing shows 
anything. It shows as empty except for the one file I wrote to it.

Tom

I tried to cd to Documents*/My* Documents* Document and Settings
none worked.

Lew

Ok 2:15 PM

[email protected]: /mnt/hda2# cd I386 AND IT CAME UP (screenshot I 386 )
So if I can do that it would seem to me that the other directories and files are readable.
I tried cd Documents and Settings but I get; bash: cd Documents : No such file or directory. 

Lew


----------



## lotuseclat79 (Sep 12, 2003)

Hi Lew,

From the root account (i.e. from ubuntu account issue sudo -i)
# cd /mnt/hda1 (which should position you at the C:\ folder if you then do an ls command to verify that)
# cd Document*
# cd My*

The problem with the way you tried previously is that you included the space character, which in my examples above will probably get you to the My Documents folder.

In other words go one folder at a time and verify with an ls command to see its contents to make sure that is where you are for current working directory/folder on the corrupt WinXP disk.

Let me know if that works.

Do not use the graphical user interface, i.e. do everything with the command line terminal window.

-- Tom


----------



## ljbirns (Mar 16, 2006)

Ok !

CD Documents* got me to> [email protected]:/mnt/hda2/Documents and Settings#   
LS then gives; All Users Default User Local Service Mary Lou Birns Network Service Owner
Owner.log

next cd My* gets to My Documents which has > My Music and My Pictures
next cd My* gets to My Music Then ls gets her music. How would I get to My Pictures
since MY is My ?
Now comes the test can we copy to the external ?

Thanks 

Lew


----------



## lotuseclat79 (Sep 12, 2003)

Hi Lew,

Great!

Ok, now to get to My Pictures from My Documents issue the following command:
# cd My*Pictures
and as you might be able to guess, in order to get to My Music:
# cd My*Music

Yes, regarding the external's ability to receive copied data via Linux from WinXP.

As I understand it you have reformatted the external HD as fat32 - is that correct?

One thing I wanted to mention about the previous use of the copy (i.e. cp) command in Linux is that it should be given with the -p parameter also to preserve the original user and permissions on the file(s). So, the command would be after locating to My*Pictures, for example:

cp -rp ./* <receiving directory Lew on the external drive> or
you could try from the Documents folder:
cp -rp ./* <receiving directory Lew on the external drive>
in order to copy recursively both the My Music and My Pictures folders and contents with owner and permissions (original).

If that works and you are able to reconnect the external drive to your working laptop and read them - then you are all set.

If that does not work, we are not done by a long shot at saving your files, so don't despair.

-- Tom


----------



## ljbirns (Mar 16, 2006)

Hi Tom

Believe me no despair here. Two quickies: 

You said: in post 24
From the root account (i.e. from ubuntu account issue sudo -i)
# cd /mnt/hda1 (which should position you at the C:\ folder if you then do an ls command to verify that)
# cd Document*
# cd My*

Did you mean hda1 or should it be hda2 ?

How do I go BACK a directory ? eg I am in >
[email protected]:/mnt/hda2/Documents and Settings/Owner/Desktop 
and I want to go BACK to Owner ?

Lew


----------



## lotuseclat79 (Sep 12, 2003)

Hi Lew,

Looks like it should be /mnt/hda2 according to post#25, sorry about that.

To get back a directory or folder you simply do:
# cd ..
which will take you up a directory/folder from your current location.

The Owner can be gotten to under Documents and Settings, so go there and:
# cd Owner
# ls

-- Tom


----------



## lotuseclat79 (Sep 12, 2003)

How many files do you need to get off of the WinXP drive? Can you determine their size in total?

Try issuing the command: free -k and list the output here for the amount of free space in your RAM.

Try creating a directory in RAM: $ mkdir /home/ubuntu/Desktop/Lew
Try copying one of the files you plan to save from the WinXP drive into the new Lew directory in RAM.
# cd <to Owner or My Pictures on WinXP drive>
# cp -p <file> /home/ubunut/Desktop/Lew
# cd /home/ubuntu/Desktop/Lew
# ls -lt

Is the file the same size? What kind of file is it? A .jpg file? See if you can load it into Firefox by using File>Open File and go to the Desktop/Lew directory and click on the file. Did it display ok?

Now, try to copy the file to the external drive's Lew directory from the Lew directory in RAM, then cd to the Lew directory on the external drive and try the ls -lt command. Did it work?

-- Tom


----------



## ljbirns (Mar 16, 2006)

Hi Tom
I created the directory in RAM. then> 
[email protected]:/mnt/hda2/Documents and Settings/All Users/Documents# ls
AOL Downloads DESKTOP.INI My Music My Pictures testfile

[email protected]:/mnt/hda2/Documents and Settings/All Users/Documents# cp -p testfile /home/ubuntu/Desktop/luigi
TESTFILE was COPIED sucessfully to luigi
Then I did an image file copied but they are locked, I think, because I copied them while in ROOT ??? 

Can't seem to save to the External HD. I mounted it tried this:>
[email protected]:/mnt/hda2/Food Pantry Holiday List# cp -p /mnt/sda1/Tootsie
Where Tootsie is a folder on sda1 (which is external HD)
i got this :
cp: missing destination file operand after `/mnt/sda1/Tootsie'

But I see PROGRESS although strangley I have been unable to find the files
my wife really wants. 
I must have mis understood how to go back ONE directory When i do CD
i go right to the root.

Thanks for everything
Have a good night tomorrow is another day.

Lew


----------



## lotuseclat79 (Sep 12, 2003)

Always issue the copy command with the -p parameter to preserve permissions and ownership.

If you issue: cp -p /mnt/sda1/Tootsie
you forgot the destination directory

The syntax of the copy command is: cp [params] [source files or dir] [destination directory]

Yes, its getting late, so I'll pick up the thoughts I have tonight in the AM.

-- Tom


----------



## lotuseclat79 (Sep 12, 2003)

Note: Issuing the cd command without any parameters gets you back to the home directory for the account. So, from the root account with th # prompt, if you are located at the My Pictures folder and want to go up a directory the
parameter to give is ".." without the quotes, as in:
# cd ..

Assuming the following, i.e. both drives are mounted under Ubuntu Live CD:
Please verify that the external hard drive is writable when the mount command
is given - I assume it is mounted by a mount command? Isn't it? Or, is it just
plugged in and automatically detected by the Live CD Ubuntu environment?

1) usb device name = /dev/sda1; mount dir = /mnt/sda1 (fat 32 formatted)
2) WinXP device name = /dev/hda2; mount dir = /mnt/hda2 (ntfs formatted)

The following example is to ascertain whether a file can be written to the usb
device and read afterwards:
$ sudo -i
# cd /mnt/hda2/Document*/My*Pictures
# ls -lt

(choose one file, e.g. assume it is named birthday.jpg for this example, i.e.
choose any file you want and substitute its real name for birthday.jpg)
# cp -p birthday.jpg /mnt/sda1/Tootsie/
# pushd /mnt/sda1/Tootsie
#ls -lt

Did the copy work or not, i.e. did the ls -lt command list the file?

If that did not work, try the following (substituting the real file name again):
# popd
# dd if=birthday.jpg of=/mnt/sda1/Tootsie/birthday.jpg
# pushd
# ls -lt

Did that work, if necessary to try?

If it did work, it gives you a mechanism to copy one file at a time if there
are only a handful of files instead of multiple 10s or 100s.

If at this point we are not able to write to the usb external drive formatted
as a fat32 disk, then if I am not mistaken, there is a set of msdos tools -
mtools - that can be used to write to an msdos formatted disk from Linux.
We would have to import them into the Live CD environment (in one session)
using the Synaptic Package Manager (i.e. be connected to the Internet) and
then use them to write to the external drive. Its been a while since I have
used them, so I would need to import them myself and test them initially, but
they just might do the job if we need them (I hope they do at any rate).

-- Tom

P.S. While you do this stuff, I'll be taking a break for lunch and then updating my Live CD environment with mtools to give them a tryout.


----------



## lotuseclat79 (Sep 12, 2003)

I found out that Linux can read/write to FAT32 partitions, so you should be able to accomplish either using the cp -rp <source file|dir> <destination dir> or the dd command to the external drive - so, no need for mtools or dd command variant.

Let us know how things are going that you try.

-- Tom


----------



## saikee (Jun 11, 2004)

I really can't believe how long this thread has dragged on.

Can the OP download the current version of Slax and burn it into a CD?

This distro automatically mounts every NTFS partition with ntfs-3g and allows you to log in as root to the desktop. *Copying XP files out is just a simple drag and drop in the desktop.*

Absolutely nothing is needed to be done and you don't even need to see a text terminal! Just drag files from one ntfs partition to another one.


----------



## ljbirns (Mar 16, 2006)

lotuseclat79

Had a long day on other stuff. Ok I followed your very clear instruction and I CAN copy
a file from hda2 ( NTFS ) to sda1 ( FAT). My biggest problem now seems to be that the files I think I need are in hda2/Documents and Settings/Mary Lou Birns. ls (list) gives input / output error Also I cannot find a listing for the MY DOCUMENTS directory whichi is where I would think the majority of the files she wants would have been.

How can I READ or look at the contents of a file ?

Thanks
Lew

saikee
Tried to burn SLAX as you suggested,( although the external is now FAT32.) from
http://www.slax.org/download.php. download was ok but niether ImageBurn
( which I used to burn the Ubuntu ) or Nero made me a good live CD. Tried it twice.


----------



## saikee (Jun 11, 2004)

Files not belonging to a user that doesn't own them are not shown in UBuntu desktop. That is the price you pay to use Ubuntu.

In root terminal you can see and use these files because as root you are the equivalent admin.

There you can see them by

"ls /media/hda2/Document\ and\ Settings/Username/My\ documents"

You can use the tab key to get you there because of there are a lot of spaces which need "\" in the terminal command.

Basically you type "ls /media" first to see all the choices inside /media directory.

You then hit the "upward direction" key to reproduce the last terminal command and add "hda2" to make the next command

"ls /media/hda2/"

You then repeat the same process but only add "docu" to make the command

"ls /media/hda2/docu" and hit the tab key. Bash will try to present to you choices available to continue with the command. Therefore you never need to type the full line because a space in bash shell has its own meaning.

I can see your problem can disappear if you either clone the whole disk or copy the whole partition. In the latter case it is just

```
cp -R /media/hda2/* /media/sda1/
```
Do adjust the device names as reported in your own circumstance.


----------



## ljbirns (Mar 16, 2006)

Hi Tom
saikee
Ok I got the files copied to the external and my win XP can read them.

There are apparently quite a number of files that are either corupted or missing from my wifes HD ( her E-Mail files in Thunderbird, her Pictures etc ) I believe the entire " My Documents " directory is gone or unreadable since I cannot find it anywhere.
Strangely Thunderbird resides in ( in Windows) Documents and Settings/Application Data
and it does not show up. Actually the Directory /mnt/hda2/Documents and Settings/Mary Lou Birns returns an Input/Output error when I try ls. That is where I believe the files should be.
However I did salvage what I could thanks to your time and efforts and I thank you very much. And I learned a bit about Linux and I am going to play with it and learn some more.

Without your help I would have gotten nowhere. Thanks for putting up with my lack of knowledge.

Lew


----------

