Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: someguy201 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. :)
-
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)
-
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.
-
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.
-
Hi someguy201
How big is your USB drive?
-
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 (http://sourceforge.net/projects/core2usb/), the official USB installer. Than load necessary extensions, like ntfs-3g.tcz from the repositiore and you are ready to go.
-
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?
-
Per the ntfs3g info file:
$ sudo ntfs-3g /dev/hda1 /mnt/hda1
-
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.
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.
-
Please spend some time in the wiki.
Then re-read post #5.
-
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.
-
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?
-
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/
-
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. ;)
-
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.
-
Also Remastering topics (http://wiki.tinycorelinux.net/wiki:start#remastering) for various techniques.
The idea you present is rather intriguing (enough so that I may consider making another personal remaster). However, I'd also add this advice:
1) Due to your "unfamiliarity with Linux", I'd suggest you become familiar first. You don't want to accidentally do something wrong, especially to make an already strenuous situation worse.
2) If I were fixing machines like this, I wouldn't trust an end-user to perform command line tasks and I'd likely do something like a reverse SSH to do it myself.
-
@someguy201: It seems to me that maybe you should better state your goal. Maybe what you want to achieve can be done an easier way…
Now, as gerald_clark said, as things look right now, you indeed only have to remaster with the additional packages. Then maybe you’ll want to create a simple bash menu script that will handle the operations you want to achieve.
By the way, did you know that installing TinyCore, without any extensions, is just a matter of putting 2 files on a drive and pointing to them with a Linux-aware boot-loader? Maybe it would be simpler for you to just put TinyCore and a couple of extensions right into your Windows drive…
tYY.
-
@theYinYeti - My goal is as stated. I originally wanted to repair a specific PC, but I'd like to use TinyCore more generally as a lightweight tool to repair Windows boot or malware issues. I help out a fair bit on various online tech forums - if a user has an infection and can't boot, I'd like them to be able to download a small tool onto a USB drive or CD, and run a couple of commands. A bash script is a good idea - I've used xPud before with some scripts someone else wrote to do something similar. Things like enumerate Windows drivers etc and replace files etc.
Thanks for all the replies and help with TinyCore.
-
I'd like to use TinyCore more generally as a lightweight tool to repair Windows boot or malware issues. I help out a fair bit on various online tech forums - if a user has an infection and can't boot, I'd like them to be able to download a small tool onto a USB drive or CD, and run a couple of commands.
Note that if you mount an unclean ntfs partition in read-write mode under Linux before having attempted to run chkdsk on it from the win recovery console you take a good chance of creating more damage and in worst case rendering it irreversibly unbootable...
:o
-
Whys that? Is there not any way to mount the partition safely in Linux? Larger distro's seem to safely access Windows files without issue.
The intended use for this would be when a computer is unable to access the Windows Recovery Console and can't boot - the only option for a user at this point is generally a full reinstall anyway.
-
Did you read the ntfs3g info file?
Is says to use at your own risk.
-
I know, that's not what I'm asking. If there is no open source equivalent to chkdsk available, is there any way to safely mount a "dirty" partition? Larger distros are frequently used to access Windows files from unbootable PCs - particularly after hard drive failures or malware. Are these larger distros doing something different that makes the operation safer, or is the risk not as high as suggested?
-
I know, that's not what I'm asking. If there is no open source equivalent to chkdsk available, is there any way to safely mount a "dirty" partition? Larger distros are frequently used to access Windows files from unbootable PCs - particularly after hard drive failures or malware. Are these larger distros doing something different that makes the operation safer, or is the risk not as high as suggested?
It is about ntfs-3g version used, not the distro itself. There were issues with older ntfs-3g versions in the past mounting dirty partitions. Using a proper ntfs-3g Tiny Core Linux do not impose higher risk than thes so called 'big' distros.
BTW, current upstream version is 2013.1.13
-
Are these larger distros doing something different that makes the operation safer, or is the risk not as high as suggested?
The rescue distros will only mount read-only, which is completely safe. You want to mount RW, which has some risk with NTFS, in all distros.
-
Thanks for the info - I've seen xPud used fairly often to write to the ntfs partition without issue. I'll bear in mind that it may damage the partition, but I would generally only be using this as a "last resort" option.
Thank you all for the replies.
-
Whys that?
Because specs of ntfs are not known better...
Is there not any way to mount the partition safely in Linux?
Not with ntfs in read/write mode unless the fs is clean. There is with msdos/vfat in any case (dosfsck).
Larger distro's seem to safely access Windows files without issue.
The only difference could be that larger distros may include ntfs-3g by default which with Core needs to be loaded as extension, there is no black magic...
The intended use for this would be when a computer is unable to access the Windows Recovery Console and can't boot - the only option for a user at this point is generally a full reinstall anyway.
If win recovery console can't be accessed on hdd, then it might still be accessed on cd.
-
Almost my first venture into linux was to try and copy files from a windows machine that wouldn't boot.
Since that time, I've used dsl/tinycorelinex five or six times to rescue various windows machines that wouldn't boot and, in every case, it has fixed what was a seemingly insurmountable problem to windows in 5 minutes flat.
Typically windows complains something.dll is missing/corrupted, the windows "rescue" disk does nothing at all, you copy something.dll from a different windows installation onto a tinycorelinux usb stick, boot from it, mount the windows partition with ntfs-3g and copy the file over. On reboot, windows automatically runs chkdsk and you're back in business.
-
Almost my first venture into linux was to try and copy files from a windows machine that wouldn't boot.
Since that time, I've used dsl/tinycorelinex five or six times to rescue various windows machines that wouldn't boot and, in every case, it has fixed what was a seemingly insurmountable problem to windows in 5 minutes flat.
Typically windows complains something.dll is missing/corrupted, the windows "rescue" disk does nothing at all, you copy something.dll from a different windows installation onto a tinycorelinux usb stick, boot from it, mount the windows partition with ntfs-3g and copy the file over. On reboot, windows automatically runs chkdsk and you're back in business.
While this prucedure is OK for a geek, it wil not work with an ordinary WINDOWS user, as it is planned at the beginning of the thread.
-
If there is no open source equivalent to chkdsk available, is there any way to safely mount a "dirty" partition?
Yes, in read-only mode.
Or in read-write mode after first having made an image of the partition to keep an option to reverse potential damage.
Larger distros are frequently used to access Windows files from unbootable PCs - particularly after hard drive failures or malware. Are these larger distros doing something different that makes the operation safer, or is the risk not as high as suggested?
The risk is exactly the same with ntfs-3g under any Linux system.
The question is, frequently by whom? Certainly not by anyone caring about avoiding unnecessary risks of data loss.