LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-17-2002, 05:53 PM   #1
w0rmh0l3
Member
 
Registered: Nov 2001
Distribution: Mandrake 8.1
Posts: 30

Rep: Reputation: 15
Mount Question..


I just installed a new hard drive (/dev/hdb1, ext2fs), and now I want to move /var over to it. I also then want to mount /home under /dev/hda6, which is the drive that was originally mounted to /var.

Here's my df -h:
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 4.9G 3.9G 851M 83% /
none 125M 0 124M 0% /dev/shm
/dev/hda6 14G 11G 2.4G 81% /var
/dev/hdb1 113G 20k 106G 1% /newdrive

Here's /etc/fstab:
/dev/hda1 / ext2 defaults 1 1
none /dev/pts devpts mode=0620 0 0
none /dev/shm tmpfs defaults 0 0
/dev/scd0 /mnt/cdrom auto user,iocharset=iso8859-1,umask=0,exec,codepage=850,ro,noauto 0 0
/dev/fd0 /mnt/floppy auto user,iocharset=iso8859-1,umask=0,sync,exec,codepage=850,noauto 0 0
none /proc proc defaults 0 0
/dev/hda6 /var ext2 defaults 1 2
/dev/hda5 swap swap defaults 0 0

Is there a way that I can just somehow have /var mount to /dev/hdb1, without having to copy /var to the /newdrive temporary mount point and then remove /var and rename /newdrive to /var?
 
Old 08-17-2002, 11:19 PM   #2
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
mkdir /tmphd
mount /dev/hdb1 /tmphd
mv /var/* /tmphd/
umount /dev/hdb1
umount /dev/hda6
mount /dev/hdb1 /var
mount /dev/hda6 /tmphd
mv /home/* /tmphd/
umount /dev/hda6
mount /dev/hda6 /home

fix fstab

Last edited by DavidPhillips; 08-17-2002 at 11:22 PM.
 
Old 08-18-2002, 10:58 AM   #3
w0rmh0l3
Member
 
Registered: Nov 2001
Distribution: Mandrake 8.1
Posts: 30

Original Poster
Rep: Reputation: 15
Thanks for the help. I have it all setup now.

Somehow though in the process I seem to have screwed up X, as now the only way I can get into X w/ gnome is to delete .drakfw and .xinitrc from $HOME and have the mandrake configurator come up. When I try to run startx, it starts twm and it won't launch anything else.. and startgnome/startkde/startsawfish all can't seem to connect to the display.
 
Old 08-18-2002, 07:31 PM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
try gnome-session
 
Old 08-18-2002, 07:43 PM   #5
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
I think I see the problem
all the .files did not mv over
do this
mkdir /tmpdr
umount /home
mount /dev/hda6 /tmpdr
cp -dbR /home/* /tmpdr/
umount /tmpdr
mount /dev/hda6 /home


if you want to recover disk space from old home, make sure you have everything on the hda6 drive and with /dev/hda6 not mounted rm -rf /home/*
 
Old 08-19-2002, 08:27 PM   #6
w0rmh0l3
Member
 
Registered: Nov 2001
Distribution: Mandrake 8.1
Posts: 30

Original Poster
Rep: Reputation: 15
Yep, that was what happened. I had a tar backup of /home before I rm'd it, so I was able to piece back in the hidden files.
 
Old 08-22-2002, 08:10 PM   #7
mlp68
Member
 
Registered: Jun 2002
Location: NY
Distribution: Gentoo,RH
Posts: 333

Rep: Reputation: 40
the safest way to copy a whole tree is ( instead of mv /var/* /tmphd/ in your example )

cd /var
tar c . | tar --same-owner -xpC /tmphd/

that will take care of all hidden files etc.

mlp
 
  


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
Mount question? Jongi SUSE / openSUSE 10 10-29-2005 04:34 PM
mount question shanenin Linux - Software 1 03-16-2005 05:30 PM
Mount question and hot swap question Dr Gutiemouth Linux - Newbie 8 10-20-2004 12:30 PM
To mount, or not to mount - That is the question! eBopBob Linux - Hardware 4 08-01-2004 03:18 PM
Another Mount Question mac_casey Linux - Hardware 5 01-03-2003 11:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:03 AM.

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