WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Command line core to salvage Windows files?  (Read 6854 times)

Offline someguy201

  • Newbie
  • *
  • Posts: 9
Command line core to salvage Windows files?
« on: May 14, 2013, 09:37:33 AM »
Hi all,

This question is basically due to my unfamiliarity with Linux, but I would like to be able to interact with the Windows partition using only the TinyCore command line.

I want to be able to run TinyCore from a USB stick, access the Windows partition BCD and transfer a copy of that to the same USB drive. I also want to be able to perform actions such as replacing "C:/windows/system32/winload.exe" with "C:/windows/system32/boot/winload.exe". I know some basic linux commands, but I couldn't work out how to access the Windows files from command line.

Any help is appreciated.  :)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: Command line core to salvage Windows files?
« Reply #1 on: May 14, 2013, 10:04:34 AM »
Depending on which windows file system you want to access, you may need the ntfs-3g extension.

Once you've figured out the file system, it's just a matter of mounting the partition and copying the file(s)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11629
Re: Command line core to salvage Windows files?
« Reply #2 on: May 14, 2013, 10:17:28 AM »
Hi someguy201
Here is a basic outline of what to do:
1. Burn a CorePlus CD and boot it
2. Use the install utility to install to your USB drive (Caution, make sure you select the USB drive and not your Windows drive)
3. Boot the USB drive
4. Use the Apps utility to install  ntfs-3g.tcz, ntfsprogs.tcz and  gparted.tcz
5. Click on the desktop and then Applications->gparted
6. Shrink the Linux partition and then add a second partition formating it as NTFS
7. Click on the Mount Icon to mount the Windows partition and the NTFS partition on the USB drive
8. Click on the Aterm icon to open a terminal, that gives you a command line interface
9. You should now be able to copy files using the cp command. Linux uses / not \ in paths.
If you get stuck, ask questions.

Offline someguy201

  • Newbie
  • *
  • Posts: 9
Re: Command line core to salvage Windows files?
« Reply #3 on: May 14, 2013, 10:49:18 AM »
Thanks for your replies. Can I do this command line only, with the smallest build? I don't need to copy a large number of files to a new partition, but get a small number onto a USB drive - additionally I'd like to move around files in the Windows partition.  (E.g. move system32/boot/winload.exe to system32/winload.exe and overwrite the existing file.

@Juanito - can I add the ntfs-3g extension to the Core only, or will I need a larger build? How should I install it? Once I've got the correct filesystem extension installed, what command should I use to mount? Something like this?

mount /dev/sda1/ /media/win -p
cd /media/win


@Rich - The CorePlus build is too big, I want the build to be as portable as possible, preferably able to run from a USB drive.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11629
Re: Command line core to salvage Windows files?
« Reply #4 on: May 14, 2013, 10:56:36 AM »
Hi someguy201
How big is your USB drive?

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Command line core to salvage Windows files?
« Reply #5 on: May 14, 2013, 10:58:04 AM »
You do not need to burn CD (if you have any). Just downlod Core, the basix .iso and create a bootable USB stick with core2usb, the official USB installer. Than load necessary extensions, like ntfs-3g.tcz from the repositiore and you are ready to go.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Command line core to salvage Windows files?
« Reply #6 on: May 14, 2013, 12:02:51 PM »
mount /dev/sda1/ /media/win -p


You mustn't append a slash to a device node.
What exactly do you intend to achieve with '-p' option?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Command line core to salvage Windows files?
« Reply #7 on: May 14, 2013, 12:09:54 PM »
Per the ntfs3g info file:
$ sudo ntfs-3g /dev/hda1 /mnt/hda1

Offline someguy201

  • Newbie
  • *
  • Posts: 9
Re: Command line core to salvage Windows files?
« Reply #8 on: May 14, 2013, 12:14:12 PM »
Thanks for all the replies - I still have a lot to learn about linux. Can I pre-load the ntfs3g file into the ISO? I'd ideally like to be able to use this again, on any computer regardless of an internet connection.

Quote
What exactly do you intend to achieve with '-p' option?

That was just a mistake from something I was confused by - I think it was an option I saw for mkdir, to create the parent folder if it doesn't exist.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Command line core to salvage Windows files?
« Reply #9 on: May 14, 2013, 12:19:24 PM »
Please spend some time in the wiki.
Then re-read post #5.

Offline someguy201

  • Newbie
  • *
  • Posts: 9
Re: Command line core to salvage Windows files?
« Reply #10 on: May 14, 2013, 01:42:44 PM »
Hi gerald_clark,

Could you be more specific? What exactly am I looking for on the wiki? I appreciate you're trying to help, but I wasn't looking to be chastised for being new to something.  ;)

Am I right in thinking I can remaster the ISO with the ntfs3g app included? I did read post 5 before - I understand I can install it, but I want to end up with just one ISO file. Slightly different to the original intention of the thread, but I do a lot of malware removal and general PC support for people online - I'm interested in using tinycore as a lightweight tool for unbootable computers. Just simple stuff - interacting with Windows files, moving/copying/renaming/replacing them etc.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11629
Re: Command line core to salvage Windows files?
« Reply #11 on: May 14, 2013, 01:48:51 PM »
Hi someguy201
You said you wanted to boot from a USB stick. How do plan on doing that if you won't install Tinycore to the stick?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Command line core to salvage Windows files?
« Reply #12 on: May 14, 2013, 02:01:45 PM »
The wiki is there for a reason.
It is to help new members understand and use Core.

You need to understand persistence, and how extensions are stored on the USB drive so you don't have to be connected to the internet.

http://wiki.tinycorelinux.net/wiki:persistence_for_dummies
from
http://wiki.tinycorelinux.net/wiki:start
and
http://tinycorelinux.net/

Offline someguy201

  • Newbie
  • *
  • Posts: 9
Re: Command line core to salvage Windows files?
« Reply #13 on: May 14, 2013, 05:58:04 PM »
Hi Rich - I do intend to run the TinyCore from a USB. I'll use core2usb once I've sorted some other stuff out.

@gerald_clark - I don't think Persistence is the problem. I only need it to boot once, not multiple times. I might just not be understanding, or maybe not clear enough. An example of how I would want to use it is this: someone I know, e.g. a friend/family member, with an unbootable PC. I want them to then just be able to download one ISO file, and run that either from a CD drive or a USB drive. They then boot into the command line, and type out a couple of commands to interact with their Windows files.

I need it to save files to a USB drive, and edit files directly on the hard drive, but it doesn't need to save any of it's own settings or applications. So, I need a copy of ntfs3g on the ISO right from the start. I think to create a slightly customized version and remaster it? I've read through a decent amount of the wiki, so I think that's what I'm trying to do. Alternatively, with xPud I know files can be transferred directly to the USB drive which will run as necessary. However, I would like this to work for anyone booting just from a CD as well. I guess I'm trying to create a custom tiny rescue disc that's simple to use. I'm good with Windows, just bear in mind I'm relatively new to Linux so a lot of the stuff that's obvious to you isn't to me.  ;)

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Command line core to salvage Windows files?
« Reply #14 on: May 14, 2013, 07:21:53 PM »
On a CD, the cde directory performs the same function as the tce directory on a thumb drive.  Put your extra extensions in
cde/optional, and the create an appropriate cde/onboot.lst.
There are several remastering programs available. such as ezremaster.