Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]hard drive crashing. need to copy /tmp correctly
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
chidychi
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2004
Posts: 82
Location: Canada

PostPosted: Fri Feb 01, 2008 12:53 am    Post subject: [SOLVED]hard drive crashing. need to copy /tmp correctly Reply with quote

Hey, so like the topic says, one of my hard drives are crashing and the /tmp directory is on it.
I tried to make a new /tmp on a different hard drive by using the command:
Code:
cp -a oldtmp newtmp
but, for some reason random files were skipped.
I managed to track them down, and now i am in a permission nightmare. Does anyone know of the proper command to use to clone this partition?
thanks
chi


Last edited by chidychi on Fri Feb 01, 2008 2:34 am; edited 1 time in total
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Fri Feb 01, 2008 1:36 am    Post subject: Reply with quote

What's in there? A tmp directory shouldn't contain any data that's important, at least not if it's in between reboots. So there is no need to backup / copy them.
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Fri Feb 01, 2008 1:37 am    Post subject: Reply with quote

you shouldn't need to save anything from temp at all, I've never seen anything in /tmp taht was needed after a reboot, and a lot of people (including myself) completely wipe /tmp upon boot, the settings for which are in /etc/conf.d/bootmisc.

My point is you probably don't need to save/recover anything from this partition anyway.
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
chidychi
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2004
Posts: 82
Location: Canada

PostPosted: Fri Feb 01, 2008 1:39 am    Post subject: Reply with quote

hey Hopeless and frostschutz

I figured that /tmp didn't matter either. yet when i try to boot into kde with the new partition it complained of missing files. Firefox also had an issue (fluxbox worked fine).
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Fri Feb 01, 2008 1:43 am    Post subject: Reply with quote

You don't have /usr/tmp symlinked to /tmp, by any chance?

kde seems to cache stuff in /usr/tmp.

What files were kde and firefox complaining about?
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
chidychi
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2004
Posts: 82
Location: Canada

PostPosted: Fri Feb 01, 2008 1:50 am    Post subject: Reply with quote

/usr/tmp is symlinked to /var/tmp

firefox was asking for orbit-"username" which is a directory; one that didn't copy the first time.

Kde right now is giving me permission errors. can't write to /tmp. I just figure that if i can't log in with kde what other problems might arise?

Do you figure if i start with an empty /tmp it might fix itself? or will i need to emerge -e world to fix permissions?

thanks
Back to top
View user's profile Send private message
chidychi
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2004
Posts: 82
Location: Canada

PostPosted: Fri Feb 01, 2008 1:52 am    Post subject: Reply with quote

BTW
kde was complaining about missing something in tmp. copying over /tmp/ksocket-"username" fixed it to the point of bad permissions now being the problem
Back to top
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Fri Feb 01, 2008 1:59 am    Post subject: Reply with quote

Ah, the so you were trying to change /tmp while the box was in use?

You should have just rebooted after setting the new /tmp, but if that's not an option then you should close down and restart the programs which are complaining (which includes kde and preferably the X server and/or the diaplay manager itself).

You should also kill off all the various gnome and kde daemon processes before starting the applications again.
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
jstead1
Guru
Guru


Joined: 01 Aug 2003
Posts: 427
Location: Oswego, NY where the snow is deep

PostPosted: Fri Feb 01, 2008 2:01 am    Post subject: Reply with quote

you need to make sure to have the correct permissions on /tmp
should be writable by all users
if it isn't, kde may be trying to write something there, failing, then later crashing when it can't find what it couldn't write.
just a thought.

edit
just in case you have the wrong permissions, or just want to set it to the correct permissions
Code:
#chmod 1777 /tmp

the 1 is for the sticky bit
without the sticky bit, well, it just isn't sticky ;-)
_________________
jim


Last edited by jstead1 on Fri Feb 01, 2008 2:07 am; edited 1 time in total
Back to top
View user's profile Send private message
chidychi
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2004
Posts: 82
Location: Canada

PostPosted: Fri Feb 01, 2008 2:03 am    Post subject: Reply with quote

oh nonono
:)
what i did was try to do a exact copy from one drive to another
like this

i made a partition on a new drive to match the old one
then copied over the files like so
cp -a /tmp /newtmp (after mounting of course)
then i went into fstab and changed the device to point to the new partition
then i restarted the computer and it looked fine. until i tried to log into kde.

thanks
Back to top
View user's profile Send private message
chidychi
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2004
Posts: 82
Location: Canada

PostPosted: Fri Feb 01, 2008 2:04 am    Post subject: Reply with quote

hey jstead1

I intended to do so by using the -a flag through copy. Does this not work in the way i intended?
thanks
Back to top
View user's profile Send private message
chidychi
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2004
Posts: 82
Location: Canada

PostPosted: Fri Feb 01, 2008 2:09 am    Post subject: Reply with quote

hey jstead1
I just noticed your edit.
Best damn description of the sticky bit i have seen!
Back to top
View user's profile Send private message
jstead1
Guru
Guru


Joined: 01 Aug 2003
Posts: 427
Location: Oswego, NY where the snow is deep

PostPosted: Fri Feb 01, 2008 2:14 am    Post subject: Reply with quote

it may not, especially if you created the new directory and then copied the contents to it.
you can fix it by changing the permissions (or just make sure it is right, chmod 1777 /tmp isn't going to hurt anything).
i don't know if you can reboot, it may be that some of the files in tmp are corrupted, (from the bad drive)
there is not anything in tmp that you need between reboots
_________________
jim
Back to top
View user's profile Send private message
jstead1
Guru
Guru


Joined: 01 Aug 2003
Posts: 427
Location: Oswego, NY where the snow is deep

PostPosted: Fri Feb 01, 2008 2:15 am    Post subject: Reply with quote

chidychi wrote:
hey jstead1
I just noticed your edit.
Best damn description of the sticky bit i have seen!

maybe i should write man pages.
_________________
jim
Back to top
View user's profile Send private message
chidychi
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2004
Posts: 82
Location: Canada

PostPosted: Fri Feb 01, 2008 2:21 am    Post subject: Reply with quote

well i can definitely reboot.
The drive housed two windows partitions a "media" partition my swap and the /tmp
what happened is the windows partitions started acting wierd. I tried to reformat, but windows died on trying to format the partitions. Thats when i knew there was a problem.
I downloaded the diagnostic tools from the manufacturer but came up with no errors. Gentoo still runs fine on the drive, but with windows not being able to format a partition..... better not take chances.
So i bought a drive made identical partitions and tried to reboot . thats when these errors came about.
If i can clear out the /tmp then its worth trying.

I will delete the "new" /tmp and reboot and see if any errors persist.
cheers
Back to top
View user's profile Send private message
chidychi
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2004
Posts: 82
Location: Canada

PostPosted: Fri Feb 01, 2008 2:33 am    Post subject: Reply with quote

Thanks for the help guys.

I removed everything from /tmp and changed the permissions to 1777
this solved all problems.

I am still confused as to why i would have to change permissions anyway.

Where do the permissions for the root of the drive come from?

/ and /tmp are two different drives. Each time I change a physical hdd for /tmp will i have to reset the permissions??

thanks
chi
Back to top
View user's profile Send private message
aronparsons
Tux's lil' helper
Tux's lil' helper


Joined: 04 Oct 2004
Posts: 117
Location: Virginia

PostPosted: Fri Feb 01, 2008 6:03 am    Post subject: Reply with quote

chidychi wrote:
Thanks for the help guys.

I removed everything from /tmp and changed the permissions to 1777
this solved all problems.

I am still confused as to why i would have to change permissions anyway.

Where do the permissions for the root of the drive come from?

/ and /tmp are two different drives. Each time I change a physical hdd for /tmp will i have to reset the permissions??

thanks
chi


/tmp exists on your root partition and has mode 1777. However, when you mount something over /tmp, the permissions come from the new filesystem. So mount the drive you want at /tmp and then set the mode to 1777. It will stay the same every time you mount it (unless you're passing it options via /etc/fstab or with your mount command).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum