LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-11-2005, 08:42 PM   #1
sixerjman
Member
 
Registered: Sep 2004
Distribution: Debian Testing / Unstable
Posts: 180
Blog Entries: 1

Rep: Reputation: 32
HELP! Need FTP client after /usr/lib lost


Partition table woes, the bain of my existence. I was, once again (and finally) trying to rearrange my small (4 GB) hard drive so that it only had root and /usr on it. Here was my plan:

1) Tar all /usr subdirectories to preserve symbolic links and store on SAMBA connected Windoze XP machine which has plenty of disk space. OK

2) Test retrieve tar file from WinXP with /usr unmounted to make sure I could get the files back. OK

3) Run cfdisk to delete /usr partition and reallocate it using the slack space (700 MB) between the end of root and the beginning of /usr. The result would be a new /usr partition which would go to the end of the drive and have an extra 700 MB free space. Got the usual message about partition table re-write failed, must reboot. OK (sort of, so far).

4) Run tune2fs to make new /usr partition ext3 with journal_data and dir_index. This failed because the new /dev/hda2 starting point was not reflected yet so I had to reboot and this is where the trouble started.
At this point I wanted to do the EXT3 stuff and start copying the /usr subdirectory tars back over the LAN and extracting the files to repopulate /usr.

5) Reboot and of course SAMBA FAILS TO COME UP (as well as other daemons) because /usr/lib/libldap.* etc. are not there. I had the foresight to copy the /usr/bin and /usr/sbin tar files to root and extract them before I blew away the original /usr, anticipating there would be some executables needed to get the basic system and some daemons up. But I didn't have enough slack space to copy /usr/lib back so
I didn't. I thought at the time that was going to lead to trouble, and it did.

6) EXT3 enabling stuff worked, so I had that going for me lol

7) Backup plan formulated: Try and get an FTP client going on the limp-noodle system and then FTP the tar files from the Windoze machine but IFCONFIG is missing and so is /usr/bin/ftp. Route is where it should be (/sbin/route) but ifconfig is inexplicably not. Neither is /usr/bin/ftp there.

This is killing me. I need to somehow get IFCONFIG and FTP from the Debian Installer diskettes (I don't have a working CDROM), which will load but seem to want to do a whole install including the dreaded "Partition Hard Drive" which I WILL NOT DO AGAIN. I am able to exit to a shell prompt and find ifconfig from the installer "fake root" system but don't know how to mount my real root file system to put things where they need to be.

I am using SARGE on top of kernel 2.4.27-2-686 and am on the verge of a psychotic break. Please advise, your expertise is sorely needed and greatly appreciated.

Thank you.
 
Old 12-11-2005, 09:25 PM   #2
cyberjun
Member
 
Registered: Mar 2005
Distribution: Gentoo kernel 2.6.14
Posts: 96

Rep: Reputation: 15
Hi,
For mounting your hard drive (after booting from your rescue disk), you can try the following:

Code:
fdisk -l /dev/hda (assuming hda is your harddrive)
This will give you the partition names for your / and /usr.

Next make directories /mnt/root_part and /mnt/usr.

Code:
mkdir /mnt; mkdir /mnt/root_part; mkdir /mnt/usr
Now mount your / and /usr partitions:

Code:
mount /dev/hda1 /mnt/root_part; mount /dev/hda2 /mnt/usr
Now you have your partitions mounted. For the rest, I will think. Hopefully someone will comeup with better ideas.

good luck!
--cyberjun

P.S.: Yesterday I planned to interchange my /home and /var partitions and fortunately escaped death of my perfectly working system by millimeters :O. Let me know if you want to know the whole story.
 
Old 12-11-2005, 10:17 PM   #3
sixerjman
Member
 
Registered: Sep 2004
Distribution: Debian Testing / Unstable
Posts: 180

Original Poster
Blog Entries: 1

Rep: Reputation: 32
THanks cyberjun, those seem like sensible suggestions so I can get to both my real root and /usr partitions as well as the installer root.bin, which I can see has IFCONFIG. If I can copy that to the real /sbin directory then I can run it to get the ethernet up and add some routes. If I can find out where FTP is in the installer that will be the final piece of the puzzle. Unfortunately I think the installer uses WGET to download the components, and WGET needs /usr/lib/etc...sigh

Anyway, thanks again and I'm going to sleep on it for the night, better not try anything after 10pm lol
 
Old 12-12-2005, 10:20 AM   #4
sixerjman
Member
 
Registered: Sep 2004
Distribution: Debian Testing / Unstable
Posts: 180

Original Poster
Blog Entries: 1

Rep: Reputation: 32
FTP needed after lost /usr/lib

I may have found salvation in a little thing called "/bin/busybox" that is used by Debian-installer to set up the network and do the network installs. It includes IFCONFIG and FTPGET. I copied it to a floppy with DD then did a LS on the floppy and it saw it so...so far so good.

ALso I found out/remembered about the different consoles you could get during debian-installer (LEFT ALT/Fx) so that was a help, not being trapped in the install script.

I've still avoided messing with the current partition table and will continue to do so at all costs lol
At the point during the install I tried to do FDISK but it was not found, used PARTED instead and both it showed I have a current partition table with / and /usr all set up, that's fine, but the installer won't just let me use that and mount the partitions (during the install process the root is mounted in tmpfs).

I'll keep you posted, thanks.
 
Old 12-12-2005, 01:59 PM   #5
sixerjman
Member
 
Registered: Sep 2004
Distribution: Debian Testing / Unstable
Posts: 180

Original Poster
Blog Entries: 1

Rep: Reputation: 32
Success!

BUSYBOX RULES! Minor trouble getting the file onto the diskette under the installer system (Do /bin/mountfloppy then cp /bin/busybox /floppy) and getting the ethernet adapter up (apparently boot time scripts failed because of missing /usr/lib files or whatever - remedied with modprobe tulip, busybox ifconfig eth0 inet up etc.).

After the network was up, tweaked some parms on the FTP server on Win9x machines to allow anonymous login (the only kind wget allows) and transferred the usrxxx.tar files to root on the Linux box, then tar -xvf usrxxx.tar to rebuild the subdirectories. WOrked like a CHAMP!

Thanks again!
 
Old 12-12-2005, 06:04 PM   #6
cyberjun
Member
 
Registered: Mar 2005
Distribution: Gentoo kernel 2.6.14
Posts: 96

Rep: Reputation: 15
Thats good nooz indeed!!
cheers,

--cyberjun
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Relocat /usr/lib and /usr/lib64 to a different path schokshi Fedora 3 08-30-2005 09:14 PM
Compromised? Files "/usr/lib.hwm", "/usr/lib.pwd", "/usr/lib.pwi" Klaus Pforte Linux - Security 4 09-28-2004 11:33 PM
Installing software, /usr/lib directory and /usr/local millertime Linux - Software 2 07-10-2004 09:21 AM
/usr/lib and /usr/local/lib doxxan Slackware 5 06-15-2004 12:58 AM
Lost /usr/lib wapcaplet Mandriva 2 02-17-2004 11:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration