1828214 Members
2486 Online
109975 Solutions
New Discussion

Device path

 
SOLVED
Go to solution
peterchu
Super Advisor

Device path

because the /tmp have problem when boot up , so I disable it in /etc/fstab , after bootup , the /tmp is disappeared , if I want to mount it back , what is the device path ( eg. /dev/sda2 ) of /tmp , how can I know it ? thx.
9 REPLIES 9
Mark Grant
Honored Contributor
Solution

Re: Device path

IT depends entirely on how it was set up. One way to guess would be to see which of your partitions seems not to be mounted with "df". Then try and mount it. It won't do any harm trying to mount a device if it doesn't exist. Test it on /mnt and then, if you find the right one, then put the entry back in fstab and re-boot.

You might be able to look through previous boot logs to see which devices have been mounted in the past. You can also use "fdisk" on your drives to see which partitions have linux filesystems on and compare this with what you already have mouned.

Don't expect to easily be able to mount it back on /tmp easily without a re-boot.
Never preceed any demonstration with anything more predictive than "watch this"
peterchu
Super Advisor

Re: Device path

thx Mark,

this is my /etc/fstab

LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
LABEL=/home /home ext3 defaults,usrquota 1 2
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
#LABEL=/tmp /tmp ext3 defaults 1 2
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/var /var ext3 defaults 1 2
/dev/sda5 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
~

because the /tmp can't be mount when boot , so i disable it ( as above ) ,
I tried to find it on the boot.log , but can't find it ,
besides the /users path also disappear after I have modified the /etc/fstab , is it possible mount it back without reboot ? thx.
Mark Grant
Honored Contributor

Re: Device path

Oh, OK,

If you are using the LABEL thing then you don't need to know what the device name is. You should be able to uncomment it and try "mount -a".

Two things though. Why did it stop working? and, on a running system, you may well find that /tmp (on the root filesystem) is in use and you therefore won't be able to mount anything on to it. You can try it but if it fails, you'll have to track down every process that has /tmp open and stop it before you will be able to mount /tmp again. A re-boot makes this task easier.
Never preceed any demonstration with anything more predictive than "watch this"
Stuart Browne
Honored Contributor

Re: Device path

Compare the output of 'mount' with your running system, and the output of 'fdisk -l /dev/sda'.

All the filesystems created as 'Linux' should have a mount point somewhere.
One long-haired git at your service...
peterchu
Super Advisor

Re: Device path

thx reply ,

may be my /tmp have problem , I tried to run fsck but fail , could suggest what can I do ?

# /sbin/fsck /tmp
fsck 1.27 (8-Mar-2002)
e2fsck 1.27 (8-Mar-2002)
fsck.ext2: Is a directory while trying to open /tmp

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193
Stuart Browne
Honored Contributor

Re: Device path

Show us the output of the following two commands:

cat /etc/fstab
mount

We'll say where to go next.
One long-haired git at your service...
V.Tamilvanan
Honored Contributor

Re: Device path

Hi,
Currently your /tmp is not a FS it is a directory in the / FS (root FS). Because at the booting time the entry for /tmp was commented in /etc/fstab. So fsck will definitely fail.
You need to find the unmounted /tmp FS device file by comparing the fdisk, df and
mount outputs.
Shaikh Imran
Honored Contributor

Re: Device path

Hi,
First of all remove the # from the /tmp filesystem in fstab.
Go to single user mode via init 1
try to come in multiuser mode vi init 2 and then init 3 and see all the filesystems are getting mounted or not
if you are stuck at bcheckrc for /tmp then
use:
e2fsck -b 8193 /tmp

Regs
I'll sleep when i am dead.
Kiyoshi Miyake
Frequent Advisor

Re: Device path

Hi,

You should find the device name of /tmp by using follow command.

- find linux file system device

fdisk -l /dev/hda ( if you use SCSI disk, /dev/sda, etc. )

- find label=/tmp device

e2label /dev/hda1
e2label /dev/hda2 ...(result of fdisk ...)
:::

- fsck

e2fsck -y /dev/hda2 ( device name that you find bellow steps )


or recreate /tmp by mke2fs command.

Thanks.