Page 1 of 1 [ 11 posts ] 

kip
Veteran
Veteran

User avatar

Joined: 13 Mar 2007
Age: 32
Gender: Male
Posts: 1,387
Location: Somewhere out there...

11 Feb 2009, 8:06 am

So I've been trying to do the LFS project lately... key word trying. I cannot seem to get my computer to quit eating the bloody folders I make in the new partition... and it's annoying.

I'm supposed to format the drive, yea, got that down. Then... I need to make a few directories, throw some files in them, and start compiling. That's where it all goes south. Every time I make the directory, it's there, I can echo it a million times if I want... but the moment I cd to it, it's gone. Doesn't exist. I'm running Ubuntu, running as root when I do this... it should work.

Anyone else had a problem making linux... well, remember things is the best way to put it?

*Sorry if this is a bit nonsensical... I ought be sleeping.


_________________
Every time you think you've made it idiot proof, someone comes along and invents a better idiot.

?the end of our exploring, will be to arrive where we started, and know the place for the first time. - T.S. Eliot


Dussel
Veteran
Veteran

User avatar

Joined: 19 Jan 2009
Age: 55
Gender: Male
Posts: 1,788
Location: London (UK)

11 Feb 2009, 12:32 pm

In a first step you may should check that the HDD is really OK: Boot the computer from an extrenal Linux-CD and run a badblocks. I assume that the HDD is on /dev/hda1 than run:

Code:
badblocks -n /dev/hda1


This will take some tome, but it will check each sector on the HDD (something format e.g. does not do).



kip
Veteran
Veteran

User avatar

Joined: 13 Mar 2007
Age: 32
Gender: Male
Posts: 1,387
Location: Somewhere out there...

12 Feb 2009, 11:46 pm

Dussel wrote:
In a first step you may should check that the HDD is really OK: Boot the computer from an extrenal Linux-CD and run a badblocks. I assume that the HDD is on /dev/hda1 than run:

Code:
badblocks -n /dev/hda1


This will take some tome, but it will check each sector on the HDD (something format e.g. does not do).


The HD checks out. It's... I cannot keep the folders there. Right after I make them is fine... but after a few mins it's gone again. Like short term memory loss for my computer or something.

It's really bumming me out cause I'm quite excited about this, LFS seems like an excellent way to learn linux.


_________________
Every time you think you've made it idiot proof, someone comes along and invents a better idiot.

?the end of our exploring, will be to arrive where we started, and know the place for the first time. - T.S. Eliot


Dussel
Veteran
Veteran

User avatar

Joined: 19 Jan 2009
Age: 55
Gender: Male
Posts: 1,788
Location: London (UK)

12 Feb 2009, 11:57 pm

kip wrote:
Dussel wrote:
In a first step you may should check that the HDD is really OK: Boot the computer from an extrenal Linux-CD and run a badblocks. I assume that the HDD is on /dev/hda1 than run:

Code:
badblocks -n /dev/hda1


This will take some tome, but it will check each sector on the HDD (something format e.g. does not do).


The HD checks out. It's... I cannot keep the folders there. Right after I make them is fine... but after a few mins it's gone again. Like short term memory loss for my computer or something.


I am more than just a bit surprised ...

You are really saying if would do:

Code:
mkdir ~/Dummy.Dir


a few minutes later, without accessing the folder anyway, you would see:

Code:
ls -l  ~/Dummy.Dir
ls: cannot access /home/hartmut/Dummy.Dir: No such file or directory


8O



Last edited by Dussel on 13 Feb 2009, 12:53 am, edited 1 time in total.

Daedulus
Yellow-bellied Woodpecker
Yellow-bellied Woodpecker

User avatar

Joined: 13 Dec 2008
Age: 28
Gender: Male
Posts: 70

13 Feb 2009, 12:26 am

what kernel version is it?

uname -a will reveal that



pakled
Veteran
Veteran

User avatar

Joined: 12 Nov 2007
Age: 62
Gender: Male
Posts: 7,827

14 Feb 2009, 11:03 pm

silly question, but I messed this up when I was taking Red hat...

could it be creating the directories somewhere else? I kept doing commands that referenced folders other than the one I needed....but it's probably only me.



kip
Veteran
Veteran

User avatar

Joined: 13 Mar 2007
Age: 32
Gender: Male
Posts: 1,387
Location: Somewhere out there...

18 Feb 2009, 4:48 am

Dussel wrote:
You are really saying if would do:

Code:
mkdir ~/Dummy.Dir


a few minutes later, without accessing the folder anyway, you would see:

Code:
ls -l  ~/Dummy.Dir
ls: cannot access /home/hartmut/Dummy.Dir: No such file or directory


8O


Thats EXACTLY what it does. It's quite annoying.

And the kernel is 2.6.24-23-generic #1


_________________
Every time you think you've made it idiot proof, someone comes along and invents a better idiot.

?the end of our exploring, will be to arrive where we started, and know the place for the first time. - T.S. Eliot


TheKingsRaven
Deinonychus
Deinonychus

User avatar

Joined: 16 Feb 2009
Age: 31
Gender: Male
Posts: 306
Location: UK

18 Feb 2009, 5:38 am

Just to rule out the obvious stuff rather than trying to make folders in your home directory make them in the current directory:

Code:
mkdir dummy or mkdir ./dummy

instead of
Code:
mkdir ~/dummy

I've never tried Linux from scratch before but I wonder if you actually have a home folder on the hard drive yet.

btw, .Dir? on Linux, that's unnecessary.



lau
Veteran
Veteran

User avatar

Joined: 17 Jun 2006
Age: 70
Gender: Male
Posts: 10,595
Location: Somerset UK

18 Feb 2009, 10:03 am

kip wrote:
...
Every time I make the directory, it's there, I can echo it a million times if I want... but the moment I cd to it, it's gone. Doesn't exist.

As I read this, I cannot understand what you mean by "I can echo it".

This seems to follow what you say above:

Code:
[email protected]:~# mkdir /home/freddy
[email protected]:/home/freddy# cd /home/freddy
[email protected]:/home/freddy/below# ls -l
total 0
[email protected]:/home/freddy# for i in a b c d; do touch $i;done
[email protected]:/home/freddy# ls -l
total 0
-rw-r--r-- 1 root root 0 2009-02-18 14:59 a
-rw-r--r-- 1 root root 0 2009-02-18 14:59 b
-rw-r--r-- 1 root root 0 2009-02-18 14:59 c
-rw-r--r-- 1 root root 0 2009-02-18 14:59 d
[email protected]:/home/freddy# mkdir below
[email protected]:/home/freddy# ls -l
total 4
-rw-r--r-- 1 root root    0 2009-02-18 14:59 a
-rw-r--r-- 1 root root    0 2009-02-18 14:59 b
drwxr-xr-x 2 root root 4096 2009-02-18 14:59 below
-rw-r--r-- 1 root root    0 2009-02-18 14:59 c
-rw-r--r-- 1 root root    0 2009-02-18 14:59 d
[email protected]:/home/freddy# cd below
[email protected]:/home/freddy/below# ls -l
total 0
[email protected]:/home/freddy/below#


_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports." Kamran Nazeer


kip
Veteran
Veteran

User avatar

Joined: 13 Mar 2007
Age: 32
Gender: Male
Posts: 1,387
Location: Somewhere out there...

20 Feb 2009, 1:56 pm

lau wrote:
kip wrote:
...
Every time I make the directory, it's there, I can echo it a million times if I want... but the moment I cd to it, it's gone. Doesn't exist.

As I read this, I cannot understand what you mean by "I can echo it".


I mean I can type echo $Dummy and it will tell me the path, which indicates it does indeed exist.

I thought that I might be making them in the wrong directory, but I went thru and did this probably a dozen times before wanting to toss my laptop out a window. The directories are right, the folders are there... but then they aren't.

I even went so far as to run some destructive tests on my HD, thinking it was the problem. Not the drive, but I did manage to erase months of work in my haste... suppose that's why you back everything up.

I know it doesn't make sense... but it's what happens.


_________________
Every time you think you've made it idiot proof, someone comes along and invents a better idiot.

?the end of our exploring, will be to arrive where we started, and know the place for the first time. - T.S. Eliot


lau
Veteran
Veteran

User avatar

Joined: 17 Jun 2006
Age: 70
Gender: Male
Posts: 10,595
Location: Somerset UK

20 Feb 2009, 2:39 pm

kip wrote:
lau wrote:
kip wrote:
...
Every time I make the directory, it's there, I can echo it a million times if I want... but the moment I cd to it, it's gone. Doesn't exist.

As I read this, I cannot understand what you mean by "I can echo it".


I mean I can type echo $Dummy and it will tell me the path, which indicates it does indeed exist.

No.

"echo" is a command that prints out any parameters it is given. It accepts a couple of switches as well, such as one to prevent it appending a newline.

"$Dummy" is a request to the shell to substitute the current value of the shell variable "Dummy".

Hence "echo $Dummy" causes the current value of the shell variable "Dummy" to be output (to stdout, which is file descriptor 1), with an appended newline.

This has absolutely nothing to do with a "path". (Or the shell variable called "PATH")

Now, if the shell variable "Dummy" has a value which includes any of the file name expansion wildcards, then the shell might expand those (in the context of the current directory (usually "$CWD"). However, if there are no matches, "echo" will just display the unexpanded value from "Dummy".

kip wrote:
I thought that I might be making them in the wrong directory, but I went thru and did this probably a dozen times before wanting to toss my laptop out a window. The directories are right, the folders are there... but then they aren't.

I even went so far as to run some destructive tests on my HD, thinking it was the problem. Not the drive, but I did manage to erase months of work in my haste... suppose that's why you back everything up.

I know it doesn't make sense... but it's what happens.

So.... going back to what you are asking about, you need to tell us what you are doing in more detail.

The command to list out the files in the current directory is "ls".

To get information on commands, try "man". In particular, "man ls" will give you lots of help on what the "ls" command can do. "man bash" will tell you what the (bash) shell does.

Another source of information is the "info" command. Many commands will have both "man" and "info" help. The latter is usually more "chatty" and will more often give some good examples.

Yet another helpful command is "apropos", which can sometimes give you a hint as to what command(s) will do something that you want done. (It actually just knows to look in the "man" directories, to find any matching entries, and give their title lines.)

Before using the shell to do things, you have to be aware that the shell uses various characters for special syntax. That doesn't just include white space. It certainly includes lots of other characters. In particular, the dollar sign is very much used!


_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports." Kamran Nazeer