Jump to content

incripshin

Active Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by incripshin

  1. So it didn't *actually* work. Apparently I had left both disks plugged in, and the new hard drive's windows started the old hard drive's windows transparently. Just booting into the new hard drive's copy doesn't work ... the drive letter is not C: so it doesn't know what to do. Apparently there is a builtin way to get Windows to copy itself to another disk, which I find acceptable. Unfortunately, Windows somehow borked itself ... maybe I was screwing around too much. Anyway, I will reinstall soon and make a proper backup. I don't know why I didn't do that earlier. Can you believe all I had to do to migrate Linux was xfs_dump/dd the partitions? Man ... WAVE OF THE FUCKING FUTURE RIGHT THERE. I will not come back to this thread ever again.
  2. And now for a less hasty message. Thanks, all, for your responses. I usually tend to deal with terrible problems with terrible solutions, but I was still happy not to hear an echo. First some individual problems, then my solution: Thanks Jason for that first nice reply. Grub looked like it was doing its job properly, but Windows didn't show even the smallest hint of starting. I saw that part of the man page shortly after I made the topic. Why do they have to be so vague about it, really? I prefer to use open source software whenever possible. And look, paying for packaged software is not 'the only way of making an exact image'. I mean, dd makes an 'exact' image. I also used xfs_dump to transfer my Linux partitions. Does any packaged software give a shit about xfs? It isn't made for people like me. I don't know if dd would have worked, but ntfsclone is at least as good (i.e. it may handle the migration better than dd). It will also allow you to create images of partitions that aren't sector-for-sector copies, which is what you want a lot of the time. I am swapping out disks because I want to, really. The specifics is that I give system Alpha the metric terabyte disk, move the 466 GB drive from Alpha to Beta, and move that 186 GB drive from Beta to Alpha. Now for the new steps, step 4 being the magic part: 1) Create partition on new disk that is at least as large as the old (at least as many sectors and cylinders, I don't know which). 2) Clone (sdb1 -> sda1) # ntfsclone --overwrite /dev/sda1 /dev/sdb1 3) Enlarge # ntfsresize /dev/sda1 4) Reset the filesystem start sector (http://osdir.com/ml/linux.file-systems.ntfs.devel/2006-09/msg00073.html; also pasted at the end of this reply to ensure this wonderful program's survival) # ./relocntfs /dev/sda1 # just show what would happen NTFS Start Sector: partition=2048 filesystem=63 # ./relocntfs -w /dev/sda1 # make the change NTFS Start Sector: partition=2048 filesystem=63 Filesystem start sector altered to 2048 5) Install bootloader (you can dd this if you don't use Grub; I installed Grub by booting with the Gentoo install disk, chrooting, using the 'grub' CLI) 6) Use Windows again and despair. I should also mention that at no point after (2) should you run the Windows startup repair with both disks plugged in. I think this is what caused my migrated Windows to switch to F: and refuse to start; this was after I ran relocntfs, and I just ended up going back to step (1). Now excuse me while I write a love letter to relocntfs' author :). Here's the relocntfs source: /* relocntfs - deals with braindeadness with moving NTFS filesystems. Copyright (C) 2006 Daniel J. Grace I don't claim any major knowledge of the NTFS filesystem. This program is merely an implementation of the process documented at Michael Dominok's website: <http://www.dominok.net/en/it/en.it.clonexp.html> Like any other program that tinkers with the contents of your HD, this program may cause data corruption. USE AT YOUR OWN RISK. You have been warned. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <linux/hdreg.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> unsigned long fliplong(unsigned long v) { /* Flip a long value -- if the architecture depends on it */ unsigned long rv; char buf[4], t; int iter; /* Determine system architecture */ rv = 1; memcpy(&buf, &rv, 1); if(buf[0]) return v; /* If we reach here, byte-swapping is neccessary */ memcpy(&buf, &v, 4); for(iter = 0 ; iter < 2 ; ++iter) { t = buf[iter]; buf[iter] = buf[3-iter]; buf[3-iter] = t; } memcpy(&rv, &buf, 4); return rv; } int usage(char *progname) { fprintf(stderr, "ntfsreloc - adjust filesystem start sector of an NTFS partition" "\nUsage: %s [-s start] [-w] [-b] [-f] device" "\nwhere device points to an NTFS partition" "\n" "\nOptions:" "\n-w\n\tWrite new start sector to the partition." "\n-s start\n\tNew start sector to write. If omitted, determined via ioctl." "\n\tMust be specified if -b option is used." "\n-b\n\tProceed even if the specified device is not a partition (e.g. a" "\n-b\n\tregular file)" "\n-f\n\tForce the operation to occur even if device does not look like a valid" "\n\tNTFS partition." "\n" "\nThis utility displays the current starting sector as defined by the" "\nthe filesystem. No change will actually be made without the -w" "\noption." "\n" "\nExit status is 2 if an error occured, 1 if a change was made or is needed" "\nor 0 if the filesystem already has the correct values." "\n", progname ); return 0; } char *optDeviceName = NULL; int device = 0; char optSpecifyStartSector = 0, optWrite = 0, optPrint = 0, optBlock = 0, optForce = 0; unsigned long optStartSector = 0, geomStartSector = 0, useStartSector = 0, fsStartSector = 0; char haveGeomStartSector = 0; int main(int argc, char **argv) { int i; int readopts = 1; if(argc <= 1) { usage(argv[0]); } for(i = 1 ; i < argc ; ++i) { if(argv[i][0] == '-' && readopts) { /* -s is special */ if(argv[i][1] == 's') { optSpecifyStartSector = 1; char *sizePtr, *endPtr; if(argv[i][2]) { sizePtr = &argv[i][2]; } else if(i+1 < argc) { sizePtr = argv[++i]; } else { fprintf(stderr, "ERROR: Size must be specified for option -s\n"); usage(argv[0]); return 1; } optStartSector = strtoul(sizePtr, &endPtr, 10); if(endPtr == sizePtr || *endPtr) { fprintf(stderr, "ERROR: Invalid size specified for option -s\n"); usage(argv[0]); return 1; } continue; } if(argv[i][1] && argv[i][2]) { fprintf(stderr, "Unknown option '%s'\n", argv[i]); usage(argv[0]); return 1; } switch(argv[i][1]) { case '-': readopts = 0; break; case 'w': optWrite = 1; break; case 'p': optPrint = 1; break; case 'f': optForce = 1; break; case 'b': optBlock = 1; break; default: fprintf(stderr, "Unknown option '%s'\n", argv[i]); usage(argv[0]); return 1; } continue; } /* If we reach here, we're reading a device name */ if(optDeviceName) { fprintf(stderr, "Only one device may be specified\n", argv[i]); usage(argv[0]); return 1; } optDeviceName = argv[i]; } if(!optDeviceName) { fprintf(stderr, "No device name specified\n", argv[i]); usage(argv[0]); return 1; } /* If we reach this point, we can actually do work */ /* Verify that we can open the device in readonly mode */ if(!(device = open(optDeviceName, (optWrite ? O_RDWR : O_RDONLY) | O_SYNC))) { perror("open"); return 2; } /* Check to see if it's a partition */ struct hd_geometry geom; if(ioctl(device, HDIO_GETGEO, &geom)) { if(!optBlock) { fprintf(stderr, "Failed to read disk geometry. Perhaps this is not a partition?\n"); fprintf(stderr, "Verify that you are using the correct device or use the -b option.\n"); fprintf(stderr, "The exact error was:\n"); perror("ioctl"); return 2; } else if(!optSpecifyStartSector && optWrite) { fprintf(stderr, "Failed to read disk geometry, and -s option was not specified.\n"); fprintf(stderr, "No update can be made without this information.\n"); fprintf(stderr, "The exact error was:\n"); perror("ioctl"); return 2; } } else { geomStartSector = geom.start; haveGeomStartSector = 1; if(!optForce && !geomStartSector) { fprintf(stderr, "This looks like an entire disk (start=0) instead of a single partition.\n"); fprintf(stderr, "I won't modify this without the -f (force) option.\n"); if(optWrite) { return 2; } } } /* Determine if it's an NTFS partition or not */ if(lseek(device, 3L, SEEK_SET) < 0) { perror("lseek"); return 2; } /* Read "NTFS" magic, or at least what should be */ char ntfsMagic[4]; if(read(device, &ntfsMagic, 4) != 4 || memcmp(ntfsMagic, "NTFS", 4)) { if(!optForce) { fprintf(stderr, "This device does not appear to be a real NTFS volume.\n"); if(!optWrite) { return 2; } } } /* Determine partition's start sector */ if(lseek(device, 28L, SEEK_SET) < 0) { perror("lseek"); return 2; } if(read(device, &fsStartSector, 4) != 4) { fprintf(stderr, "Unable to read filesystem start sector.\n"); return 2; } fsStartSector = fliplong(fsStartSector); printf("NTFS Start Sector:\n"); if(haveGeomStartSector) { printf("partition=%lu\n", geomStartSector); useStartSector = geomStartSector; } if(optSpecifyStartSector) { printf("specified=%lu\n", optStartSector); useStartSector = optStartSector; } printf("filesystem=%lu\n", fsStartSector); if(useStartSector == fsStartSector) { printf("No changes are neccessary.\n"); return 0; } if(!optWrite) return 0; if(lseek(device, 28L, SEEK_SET) < 0) { perror("lseek"); return 2; } fsStartSector = fliplong(useStartSector); if(write(device, &fsStartSector, 4) != 4) { perror("write"); return 2; } if(fsync(device)) { perror("fsync"); return 2; } if(close(device)) { perror("close"); return 2; } printf("Filesystem start sector altered to %lu\n", useStartSector); return 1; }
  3. 1) screw imaging software 2) dd had the same trouble 3) I have a solution, and I will post it when I get more time. Basically, the partitions had different starting sectors (63 vs 2048) and this is written in the NTFS superblock. gotta go. PCHOOOOO
  4. SOLVED See my third comment. I don't know if it's possible to change the topic title, so I am just adding this note here. ONLY SORT OF Apparently I can boot, but it still doesn't work for shit. See last message. I have had it with this. I recently bought a new hard disk and I was having trouble transferring my Windows 7 partition, and I don't know what I'm missing. The trouble is that it won't boot, though I got all the data across fine (seemingly). When I select Windows in GRUB, it just hangs. The steps I took were pretty simple: 1) use Linux fdisk to create a larger partition on the target disk, setting partition ID to HPFS/NTFS and enabling the boot flag 2) the following (sda: target, sdb: source) from a Gparted live disk (Anglican spelling; deal with it): # ntfsclone --overwrite /dev/sda1 /dev/sdb1 # ntfsresize /dev/sda1 I also tried using dd the first time. 3) install grub on /dev/sda with same configuration 4) attempt repair with Windows 7 install disk; nothing doing And that's it. /dev/sdb1 is 75 GB while /dev/sda1 is 100 GB. Mounting /dev/sda1 shows that it did resize the filesystem to fill the partition: # df Filesystem 1K-blocks Used Available Use% Mounted on ... /dev/sda1 104857596 60125040 44732556 58% /media/c ... Here are relevant excerpts from fdisk: # fdisk -l /dev/sda Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00008f19 Device Boot Start End Blocks Id System /dev/sda1 * 1 13055 104857600 7 HPFS/NTFS ... # fdisk -l /dev/sdb Disk /dev/sdb: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders ... Device Boot Start End Blocks Id System /dev/sdb1 * 1 9791 78646176 7 HPFS/NTFS ... (Yeah, it's a minor upgrade, but I also have another computer which could really use the 466 GB drive). Here's my grub config, but there's nothing strange about it; I'm just trying to head off a request for it: default 0 timeout 8 title Gentoo Linux root (hd0,1) kernel /boot/vmlinuz ro root=/dev/sda2 vga=794 splash=verbose,theme:livecd-2007.0 fbcon=scrollback:128K title Windows 7 Professional rootnoverify (hd0,0) chainloader +1
  5. I wasn't aware of that. I see there are also Windows ports of .NET. Let me say, then, that I simply don't trust Microsoft technology, but that's mostly politics. I also think that their software is typically too complicated. By association I put their languages and APIs in the same category. I've used the Windows API a bit, and I much prefer POSIX. The C++ Programming Language (Bjarne Stroustrup) is the best reference to the language. I didn't use it to learn the language, though.
  6. I want to join the 'promote your favorite language thread' too! First I would start with COBOL. When you're comfortable with that, you can move over to Ada or Fortran. Top it off with some Eiffel and ML and you'll be unstoppable. Seriously, though? I started with C, reading The C Programming Language (Kernighan and Ritchie), the only C book you'll ever need or could want, though I would like a third edition with C99 updates. Personally, I would prefer it over Python since Python's object-oriented, and therefore more complicated. I know that some universities use Python for the introductory programming courses. This is for people who don't know what to expect from programming. You have enough motivation to work on your own, so I don't think you need that shortcut. During my time in university, I found that I had a much better understanding for how things worked than my classmates, who seemed clueless. To this day, I don't know what's so hard about preventing memory leaks and using pointers. Plus, I love computers, and the closer of a connection I can have with the hardware, the more enjoyable it is. My favorite language is C++. Gaining a full understanding of this language takes a lot of work. The C++ Programming Language is a very large book in comparison to The C Programming Language, but it's full of great examples and insights from the language's creator, Bjarne Stroustrup. Reading Effective C++ is also helpful. The level of control that it gives makes it really enjoyable for me to work with. I do like Python a lot, though. I count it as my second favorite language. There's a lot of documentation online, though it is very nonuniform and can be hard to navigate (a good reason to buy Python in a Nutshell). It's open source and cross-platform, which I love. I don't think writing DOS batch files is helpful. The only batch files I ever wrote just sequentially executed programs. For political reasons, I will never use proprietary languages like VB or C# (Microsoft's Java), unless I absolutely need to. I don't like the idea of pigeon-holing my code into a single environment. Especially one that's closed off to inspection like Windows is. In summary: C first. Python & C++ second.
  7. IE's FTP client works on most servers, but not all. It gives really weird directory listings when connecting to a publicfile FTP server. This specific issue isn't related, but it's an example of where mozilla and filezilla follow the (screwy) FTP spec more closely. My guess is that IE and most other clients you've tried are not using active mode. I would check what the default is, except that I'm in linux. See KB323446 for how to enable active mode. If this is the case, I'm guessing that your FTP server is running both active and passive, but passive doesn't work because the firewall isn't FTP-aware. The solution then is to get your firewall to work properly with FTP. A good idea if I'm wrong is to run wireshark/tcpdump while connecting with the CLI client that worked and some other client that doesn't work. See how the connection phase is working. Wireshark should make this pretty easy if you can filter well enough, since it parses common protocols like FTP. Filter for tcp.port==21. What you should be looking for are PORT or PASV commands. This will tell you what kind of connection is being made, and probably why one client works while another doesn't. Edit - The default for IE7 is to use passive FTP. Switch it off and see if FTP works.
  8. All you need: $ man 7 socket $ man 7 ip $ man 7 tcp
  9. AVI is just a container format. It holds video, but it is not a video format. This is why the media player can know about the sound but not the video. OGM is another, superior container format, though not as widely supported (I'm looking at you, Windows Media Player).
  10. Just defragment it. Oh wait, that's if you want the hard drive to be deader. I think you should upgrade your RAM if you can. This will decrease the page faults a lot. SATA and PATA drives are the same in terms of speed. The bus that SATA uses just has more potential for growth. I could be totally wrong here, but I would suppose that upgrading to 7200 (if that's possible with notebook drives) is not a good idea. It will make your laptop faster, but also hotter than it was designed for, louder, and the battery life will be shorter. It may also be that the power supply can't take that much power and end up going 'pop'. I don't think the performance record of lithium ion batteries is very good, so I wouldn't push it.
  11. In Linux, and probably other unixes, a good ripper is dvd::rip (http://exit1.org/dvdrip). It's written in Perl of all languages and it works really well. The only thing I didn't like is how it ripped subtitles. They had to be compressed with rar2 for some reason. I imagine that subtitles are screwy any way you look at them, though. I think that's because they're actually images that need to be interpreted by some text recognition code. Other features are that it can give you pure open source files. You can have XviD video, multiple Vorbis audio tracks, and an OGM container. Who doesn't like that? This is by option, of course. You can still do x264/MP3/AVI if you like.
  12. See ftp://ftp.openwall.com/pub/wordlists for Openwall's free word lists and http://www.openwall.com/wordlists for slightly better, but not free, word lists (read the page to find out how they're better). Openwall is also home of John the Ripper, popa3d (a simple POP3 daemon), and Openwall Linux (a security-oriented Linux w/a 2.4 kernel).
  13. Wow. I had some firewall issues getting here, myself. I had to use tor, but the port was being blocked by the corporate firewall. I switched 8118->8119 and presto. You mentioned adding port 20 to the exception list. Port 20 is not used by passive FTP. With passive FTP, the client should be saying PASV, and the server should choose a high port number that is random, responding with PORT x. The firewall needs to be FTP-aware so that port x is accessible from the client's IP address. I'm not sure how this gets accomplished with Windows 2003 as I'm more of a unix person. I don't use no stinkin' firewall, though I don't need it to do very advanced stuff except run sshd, public ftp, and samba. Nothing else is enabled. Some day I'll make the switch to OpenBSD and try to figure out pf, but until then, my Gentoo is running exposed.
×
×
  • Create New...