xboxscene.org forums

Author Topic: Xlinux And The 'mv' Command  (Read 160 times)

animous

  • Archived User
  • Newbie
  • *
  • Posts: 3
Xlinux And The 'mv' Command
« on: September 29, 2003, 05:35:00 AM »

So I do the hotswap trick, mount /dev/hdc51 and start using 'cp' and 'rm' to manage exploit files.  I've done this many times without any problems.

At some point I used 'mv':
>mv evoxdash.xbe.fonts evoxdash.xbe

This was supposed to overwrite the existing, audio-signed evoxdash.xbe with a copy of a font-signed one.  evoxdash.xbe.fonts is renamed, but I wind up with two evoxdash.xbe files!  Deleting one deletes both.  After this, doing 'ls' lists evoxdash.xbe as missing.  I don't have screen shots but it would look something like this:
>ls evox*
evoxdash.xbe
evoxdash.xbe
>rm evoxdash.xbe
>ls
evoxdash.xbe: No such file or directory
Audio
Skins
[and the rest of the files are listed]

Copying a new evoxdash.xbe will get the file to show up twice again doing an 'ls'.  Deleting it again just brings back the same error message doing an 'ls'.

At this point I think maybe boxplorer can do a better job at erasing the file.  So I boot using the font exploit, go into boxplorer and delete the file.

The end result is that I can still mount the hard drive in Xlinux, but upon booting the xbox goes straight into the multi-language error message (even without the font exploit).  I'm thinking upon bootup the FAT is checked and seen as corrupted.

Has anyone used 'mv' and not gotten this problem?  If not I guess this is a warning not to use it.  Any ideas on how to fix my HD (other than "Use that backup you made!") are more than welcome.

Thanks.
Logged

xboxwannabe

  • Archived User
  • Jr. Member
  • *
  • Posts: 54
Xlinux And The 'mv' Command
« Reply #1 on: September 29, 2003, 09:39:00 AM »

dont know anything about linux ...but a few things come to mind

i have seen this kind of thing when ftping files back and forth ... ive deleted files and they go but if i use boxplorer they are sometimes still there ,,and some times i get duplicates but ive never really worried about it that much


the green service screen may be because you forgot to lock the drive ..( stab in the dark)


ph34r.gif
Logged

animous

  • Archived User
  • Newbie
  • *
  • Posts: 3
Xlinux And The 'mv' Command
« Reply #2 on: September 29, 2003, 04:56:00 PM »

Hmm so you're saying you've also got the double FAT entries but it doesn't cause any problems?  Weird.

The lock thing I've never done.  I've hotswapped many, many times and it has always worked.  Thanks anyways!
Logged

rocketeer

  • Archived User
  • Newbie
  • *
  • Posts: 19
Xlinux And The 'mv' Command
« Reply #3 on: September 29, 2003, 11:53:00 PM »

Not much help maybe, but I can confirm this same behaviour. Last night I went for the hot-swap again after success with another box some while ago.

My problems actually started with the 'cp -R' command from a CD where I had put all files for the font exploit. To verify that the copy went fine I did a 'ls -l' on my hdc51 mount. Yay, one of the file names was corrupted. Instead of "XBox Book.xtf" it was "XBox Boo" - cut at 8 chars! All other files seemed ok. Piece of cake, I thought, let's just do an 'mv' to sort it. Now things started to get really confusing and I ended up with not just 2 identical files, but 3!

The file(s) could not be removed (No such file or directory error), not renamed to more than 8 chars, and not deleted (No such file or directory error again). Also, 'echo "" > ' to the err file resulted in 3(!) identical files with 1 byte length. Just as if the old filehandles where "ghosting" somehow after the 'mv' command. I tried 'cp', 'mv' and 'rm' on other files afterwards with no errors.

My conclusion: looks like the fatx drivers in XLinux are buggy. Mostly they work fine, but sometimes they screw things up, just like the "welcome" text says when booting XLinux: This will probably mess things up - use at own risk, or something like that...

Please post if you get around these issues!
Logged

schampy1

  • Archived User
  • Newbie
  • *
  • Posts: 16
Xlinux And The 'mv' Command
« Reply #4 on: September 30, 2003, 09:50:00 AM »

Mmmm Xlinux also screwed my xbox Itjust wont unlock sad.gif this really is sad becuase if I would have to delete my hdd totaly than I would lose my pron  unsure.gif  sad.gif  mad.gif
Logged

TOOGAM

  • Archived User
  • Newbie
  • *
  • Posts: 26
Xlinux And The 'mv' Command
« Reply #5 on: September 30, 2003, 09:22:00 PM »

QUOTE (animous @ Sep 29 2003, 01:59 PM)
Has anyone used 'mv' and not gotten this problem?  If not I guess this is a warning not to use it.  Any ideas on how to fix my HD (other than "Use that backup you made!") are more than welcome.

I've found "mv" to be dangerous.  Yeah, I know, "now you tell me".

I've actually had quite a bit of problems when I first soft-modded my Xbox, with needing to format my E: due to hard drive corruption.  Thank Goodness that Evo-X has a hard drive formatter.  (All references to Evo-X in this article refer to EvolutionX's RemoteX dashboard build 1.8.3752, which is not the latest release now.) For a while I blamed the corruption on the mv command, then I started to question using rename when FTP'ing to EvoX.  So then I started to suspect that both mv and Evo-X's FTP server may call a common API in the kernel that is used when renaming files on a FATX drive.

Anyway, to this day I am pretty paranoid about hard drive corruption, especially when writing to the C: which I don't want to format, and I do almost all file maintanance using one of the following, in order, based on what is possible: 1) MS Dashboard.  2) Evo-X's copy ability using a copy line in the evox.ini file.  3) AvaLaunch's file manager.  4) If all else won't work, then AvaLaunch's ftp server.  (So to delete a file, I tend to avoid using the ftp server for the actual delete since that can be done with the file manager.) Results since I've started doing this: No hard drive corruption.

I read on some discussion (the minutes of the 3rd developer's meeting of some guys at the Xbox-Linux.SourceForge.net, if I recall correctly) and the result of the discussion was a consensus that yeah, they really need to be finding out what's going on with the problems with the FAT-X driver.  Because of that, perhaps unjustifiably (especially if this is old), I haven't trusted ANY Linux on my Xbox.  (I ESPECIALLY do not trust the 1,316,895 byte DEFAULT.XBE using the 4,112,384 byte BOOTKERNEL and 885,961 byte BOOTKERNEL, 3 files included in the 4,964,708 byte 007 Agent Under Fire Linux package called 007linux-xbsaves.zip.)

I am not the only person I know to have had hard drive corruption.  Fortunately my friend also was paranoid about writing to his C:.  He did not want to lose his E:, but he did wisely back up just in case, and ended up formatting and restoring it.  If I recall correctly, he was using Linux, but originally thought that the problem was with Evo-X's FTP server's mkdir and/or rename (he was using a different ftp client, my ftp client couldn't mkdir with Evo-X's FTP server, but at that time I was pretty afraid of using rename), and that he then started from scratch but later had problems and eventually concluded that he didn't trust the current Linux FAT-X driver.

I have found that hard drive corruption results in duplicate files or directories, and other files not showing (noticable in Linux ls, and also in Evo-X one Skin would show up twice in the list of Skins while another Skin wouldn't show up at all), files becoming undeletable, and often dozens of directory entries with NULL (basically non-existant) names which are undeletable.  When a file or directory is undeletable, all parent directories are undeletable in Linux or AvaLaunch's File Manager or any FTP server I found, the only cure was Evo-X's formatting the drive.

If hard drive corruption wasn't noticable right away, further disk activity (reading and writing) on the drive often made the corruption become more noticable.

I've been eagerly awaiting evolution of the hard disk checker built into the most recent versions of AvaLaunch.  Meanwhile, if anybody has noticed any corruption on the E:, I would immediately back up any and all files that you can, then format the drive with Evo-X, then copy all the files back.  To copy files to my hard drive, so that I don't have to tediously make all kinds of directories using AvaLaunch's File Manager and the XPad instead of a keyboard (even though I am borrowing a USB keyboard I could use), I often create a zip file on my PC, making sure the Zip File has the right directory structure I want, and then I have AvaLaunch extract that Zip file.  Based on my experience, this works with no problem, except that due to laziness I often don't copy as many files back to the E:.

If I *had* to make a directory without using AvaLaunch, I would make E:Backup using Evo-X's HDD Backup option, then use Evo-X's FTP server and rename the E:Backup directory.  I would call it E:Media, then make E:Backup and then rename it to E:Backupwidgets, etc., as needed to install AvaLaunch.  I would then put the files into those directories as needed, as well as Phoenix BIOS Loader 1.3 (since the older version didn't require the Bioses subdirectory) and put Evo-X on the C: (and evox.ini) so I could boot a signed Phoenix BIOS Loader which could then boot C:evoxdash.xbe which could then execute E:avalaunch.xbe (using Evo-X's ftp server and the literal command "execute E:avalaunch.xbe", see the "literal" command in Win9x's FTP.EXE or QUOTE in WS_FTP or who-knows-what in other clients), then use AvaLaunch to delete all the extra hard drive files that got placed in any directory that was made by renaming E:Backup.  I've resorted to this a few times, fortunately I haven't noticed any C: corruption, thank goodness I was very paranoid about writing to my C: during those earlier days when I had a lot of hard drive corruption.

I don't see why there would be any problem with the F: either, I don't know about the C: or any LBA drive like a G: drive though.  If I had problems on my C: I would... uh... worry, and probably just avoid making any writes to the C: (except to go into Evo-X's settings and tell it to stop using Items.txt, thinking that would help prevent Evo-X from writing to that file more often) until I had an opportunity to restore my hard drive from a known, good, working image or until some HDD fixing tools come out.
Logged

animous

  • Archived User
  • Newbie
  • *
  • Posts: 3
Xlinux And The 'mv' Command
« Reply #6 on: October 01, 2003, 11:45:00 AM »

Ok I'm gald to hear I'm not the only one with this problem (although I wouldn't wish this to anyone!) and that the xbox-linux folks are working on bettering the fatx module.

Here's an update on my situation (the end result being a thouroughly corrupted drive):
* I restored root files of the C drive from a backup and got the Xbox booting again.  So the xbox refused to boot because of messed up system files, not the corrupted FAT.
* I notice my E: looks wiped out.  With bigfonts I boot into EvolutionX and decide to check if I can still see saved games from the MS dashboard.  I launch the [xft modified and known to work] MS dashboard from Evox.
* All hell breaks loose.  Box reboots once and then can't boot.  I can still mount hdc51, but doing an ls doesn't do a directory listing - it displays what seems to be parts of evox.ini along with garbage characters.

At this point I'm thinking I should just zero the drive out and start from scratch.

* I boot in 98SE (don't have 2k or XP) and try to zero out the entire drive using xhdprepare.  Doesn't work (just hangs + not accessing the disk).  However, zeroing out the first 4096 works.
* I mount hdc51 in xlinux.  No luck, corruption still present.
* Since xhdprepare doesn't seem to be working for me, I decide to use 'dd if=/dev/zero of=/dev/hdc bs=512k' in xlinux to zero out the drive.  Seems to work, although it finished with an "Out of space" error message.
* Now that the drive is zero'ed out (not possible to mount partitions anymore), I use xhdprepare on the first 4096 to put the partition info back in there.
* Mount hdc50 and hdc51 in xlinux (for some reason hdc52,53,54 are unmountable).  Doing an ls on either partition now shows A BUNCH (exactly 256, in fact.. interesting) of "No such file or directory" entries.

Trying to copy files from my backup is unsuccessfull because I get a "No space left on device" error message.  Which is weird because 'df' clearly shows the drive is empty.

Filesystem           1k-blocks      Used Available Use% Mounted on
[others left out]
/dev/hdc51              511904         0    511904   0% /xbox51
/dev/hdc50             4998768         0   4998768   0% /xbox50

So I end up with a seriously corrupted hard drive. :(

I want to start from scratch, but xhdprepar "entire drive" doesn't work for me (anyone else?), 'dd' didn't work, I have no low level format option in my BIOS and I cannot format using the Evox format command because I can't boot into Evox (or anything else that runs on the xbox for that matter).

Any ideas?  I'm starting to think about using winhex or ghost to copy an original HD bit for bit.  Another solution is to give up and buy a mod chip so I can boot in evox and format the drive, but I've worked so hard so I wouldn't have to buy a chip..

I think it should be written somewhere in big bold red letters that pretty much only 'cp' and 'rm' are "safe".

Thanks.
Logged

TOOGAM

  • Archived User
  • Newbie
  • *
  • Posts: 26
Xlinux And The 'mv' Command
« Reply #7 on: October 02, 2003, 09:52:00 AM »

QUOTE (animous @ Oct 1 2003, 08:09 PM)
the xbox-linux folks are working on bettering the fatx module.


I didn't say that they are.  I didn't get that impression from the discussion I read.  I got the impression that they decided it is necessary for someone to work on bettering the fatx module.  That's different than saying that anybody volunteered to actually do this necessary work.

"He explained that the old FATX driver caused very bad cluster chains, usually broken and not restoreable."  This was said at http://xbox-linux.sourceforge.net/docs/minutes3.html ("Minutes of the Third Developer Meeting").  Also said is that some software that was being made to help fix errors "is not ready" and other software to check for errors "is cool, but there are moments when it crashes too."

QUOTE
but doing an ls doesn't do a directory listing - it displays what seems to be parts of evox.ini along with garbage characters.


This is false, ls IS showing you a directory listing, and is looking at your FAT in order to do so.  Your FAT includes pieces of your evox.ini and possibly other files.  Consider, if a FAT said there was a file called C:xboxdash.xbe and its file size was UseFDrive = Yes, then ls would show the filesize of C:xboxdash.xbe is UseFDrive = Yes.  The fact that it's not showing a number isn't the fault of ls, it is the fault of the FAT that ls is using as a reference for everything it shows you.

QUOTE
* I restored root files of the C drive from a backup and got the Xbox booting again.  So the xbox refused to boot because of messed up system files, not the corrupted FAT.


I don't see why you think this wasn't due to a corrupted FAT.  The FAT may have been just barely not-screwed-up enough for your copy command to not notice a problem, but that it was still in pretty bad shape, so when the Xbox tried to boot, it was using a corrupted FAT which let it successfully find part of a file it needs, or even some files okay, but other parts of other files couldn't be read correctly, therefore couldn't be executed correctly, therefore appearing to be a messed up file.  I suppose a file should be considered messed up in the FAT doesn't point to it correctly, this doesn't indicate your FAT was over okay though.

QUOTE
* Mount hdc50 and hdc51 in xlinux (for some reason hdc52,53,54 are unmountable).  Doing an ls on either partition now shows A BUNCH (exactly 256, in fact.. interesting) of "No such file or directory" entries.


ls is probably seeing that there are zero directly entires when looking at a byte, but due to some logic doesn't believe so it thinks there are 255+1 directory entries.  Then it actually reports each ofthe 256 directory entires, but the names are null, and looking up a filename of null shows that it doesn't actually exist, so it reports that problem.  This indicates there are zeroes in your FAT where they shouldn't be.

QUOTE
Trying to copy files from my backup is unsuccessfull because I get a "No space left on device" error message.  Which is weird because 'df' clearly shows the drive is empty.


Drive has zero bytes free (no free space).  df tells you there are zero bytes free, the drive is zero percent used up.  It seems you have zeros in places that your linux is expecting to see FAT data.  No too surprising since you just tried to zero out your drive, obviously an attempt to re-create a valid FAT after that, though, failed.

QUOTE
Any ideas?  I'm starting to think about using winhex or ghost to copy an original HD bit for bit.


Great idea.  Just make sure the hard drive image you're using as a source is the proper size.  I wouldn't recommend ghosting a 10GB image created from a newer 10GB Xbox drive onto an older 8GB Xbox drive.

QUOTE
Another solution is to give up and buy a mod chip so I can boot in evox and format the drive, but I've worked so hard so I wouldn't have to buy a chip..

That may work, IF the FAT on each drive is the only thing messed up.  I've fixed corrupted E: FAT's by booting off C: and going into Evo-X's RemoteX dashboard software.  However, if your problem is above the drive level, such as a partition table messed up, Evo-X may not have enough valid partition information to *successfully* create a valid new FAT within the partitions you have.  I don't know what Linux's problem was with your drive, if it couldn't mount partitions because it couldn't find a valid file system (FAT) in the partition it was asked to mount, or if your partitions were in trouble.  (I don't have any information about xhdprepare to be able to offer any educated response about its effects.)

The rest of this post is complete speculation.  I could be completely wrong, but I believe that the partition table (which basically defines what drive letters you have and how big they are) are probably what comes first on the drive, and it sounds like you said you've zero'ed that out.  Which may mean your hard drive suggests it has zero drive letters, or maybe 256 drive letters each of which are 256 MB big but have zero bytes used and zero bytes available.
Logged

rocketeer

  • Archived User
  • Newbie
  • *
  • Posts: 19
Xlinux And The 'mv' Command
« Reply #8 on: October 07, 2003, 02:13:00 AM »

My solution was to 'dd' from my old modded/unlocked hd to the corrupted one. Yes, with Xlinux...'dd' doesn't care of filesystems, it just makes a raw copy.
CODE
dd if=/dev/hdb of=/dev/hda

with /dev/hdb being the working hd on primary slave, and /dev/hdb the corrupted drive on primary master (hot-swapped). Now the new drive is uncorrupted and hacked.  
Logged