Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Aug 10, 2008 11:37 pm 
Offline
Senior Newbie
User avatar

Joined: Wed Aug 06, 2008 4:06 pm
Posts: 11
can anyone tell me how to mount separate partitions and not loose data?

i have a new debian installation with separate partitions (images) for:
/ /swap /home /usr /var and /tmp

/ and /swap are created automatically when you install a new linode image.

the problem occurs when i add the partitions i create to fstab and restart.

they mount, but there is no data.

so the question is:

how can i mount partitions without loosing the data?
pr
how can i have separate partitions in one setup?

(what is the correct procedure)


Last edited by anubix on Mon Aug 11, 2008 2:09 pm, edited 3 times in total.

Top
   
PostPosted: Sun Aug 10, 2008 11:52 pm 
Offline
Senior Member

Joined: Tue Jan 22, 2008 2:10 am
Posts: 103
You'll need to mount them at a different location, first, copy data over, then overmount the real location. eg:

Code:
## assuming /dev/xvdc is your new /usr
mount /dev/xvdc /mnt
cp -a /usr/* /mnt/
umount /mnt
mount /usr


Note that in the case of /var and /tmp, rebooting afterward is recommended. Also, once you're sure things are working fine, you can remove the unneeded copies in the root fs like so:
Code:
mount --bind / /mnt
rm /mnt/usr/* -rf  ## don't remove /usr itself!
umount /mnt


Be sure to copy everything, and make sure it comes back on a reboot, first, of course :)


Top
   
 Post subject: wow thanks...
PostPosted: Mon Aug 11, 2008 9:12 am 
Offline
Senior Newbie
User avatar

Joined: Wed Aug 06, 2008 4:06 pm
Posts: 11
i was slowly thinking that this was the solution but had no idea how to go about it correctly. Will give it a try today and post the results here shortly. thanks a bunch.


Top
   
 Post subject: worked like a charm...
PostPosted: Mon Aug 11, 2008 11:41 am 
Offline
Senior Newbie
User avatar

Joined: Wed Aug 06, 2008 4:06 pm
Posts: 11
that worked like a charm, thanks!!


Top
   
PostPosted: Mon Aug 11, 2008 2:04 pm 
Offline
Senior Newbie
User avatar

Joined: Wed Aug 06, 2008 4:06 pm
Posts: 11
when the old data was removed you kept the empty folders there, is this a requirement for the system to work or can i delete these empty folders?


Top
   
 Post subject:
PostPosted: Mon Aug 11, 2008 2:16 pm 
Offline
Senior Member

Joined: Tue Jan 22, 2008 2:10 am
Posts: 103
The empty directories are needed - when you mount a partition, it must be attached to an already-existing directory.


Top
   
 Post subject: the results
PostPosted: Mon Aug 11, 2008 4:47 pm 
Offline
Senior Newbie
User avatar

Joined: Wed Aug 06, 2008 4:06 pm
Posts: 11
So here are the results:

Code:
:~# quotaon -avug
/dev/xvda [/]: group quotas turned on
/dev/xvda [/]: user quotas turned on
/dev/xvdc [/usr]: group quotas turned on
/dev/xvdc [/usr]: user quotas turned on
/dev/xvde [/var]: group quotas turned on
/dev/xvde [/var]: user quotas turned on
alpha1:~#                                              #i hit tab to show available programs here
Display all 702 possibilities? (y or n)


If it didnt work my list of available programs would have been 152 instead of 702 or something like that.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 6 guests


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group