LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-30-2003, 09:53 PM   #1
andrew001
Member
 
Registered: Nov 2002
Distribution: Slackware 9.0
Posts: 321

Rep: Reputation: 30
about to do some involved partition work: need confirmation


Hello~

One of my linux machines has an old 1.8 gig FAT partition on it, and I want to open that space up to /var so that my ftp server will have a little more breathing room. I know what to do, but I wanted to check to make sure it was safe, as partition work is dangerous and quite tricky.

First I'll make a tar.bz2 out of the contents of /var and move it to home. I'll then delete /var from fdisk (now on hda6), and use add that extra space do hda4, now formatted as FAT. I then plan to format hda4 using mkfs, and then change /etc/mtab from

/dev/hda6 /var ext3 rw 0 0

to

/dev/hda4 /var ext3 rw 0 0

Is everything here OK, or is there a safer way to do it?

Thanks,
Andrew
 
Old 06-30-2003, 10:01 PM   #2
fancypiper
Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 57
Don't edit /etc/mtab, you want /etc/fstab.

# Clone a distro to another drive or move directories around
Install drive in box (assuming IDE1 slave for examples) and ensure BIOS can detect it. Boot into Linux and login to your user's account. Open an x terminal and partition and format the new drive as you wish
Code:
[phil@fancypiper phil]$ su -
Password: 
[root@fancypiper root]# fdisk /dev/hdb
Exit with w to write the partition table.

Format the partitions with the chosen filesystems:
mke2fs /dev/hdbX -> ext2
mke2fs -j /dev/hdbX -> ext3
mkswap -> swap
mkreiserfs -> reiserfs
mkfs.xfs -> xfs

Make directories for source and destination mount points. You need these to keep out of an endless loop of copying itsself over and over.
Code:
[root@fancypiper root]# mkdir /mnt/source
[root@fancypiper root]# mkdir /mnt/destination
Mount your os partitions that you want to clone on /mnt/source
Mount your partitions on the new drive, making directory entries for your separate partitions (/boot, /home, /var etc.). If you are just copying a directory such as var, just cd to the directory you wish to copy instead of mounting partitions on /mnt/source.

Now, cd to /mnt/source and pipe it over with tar
Code:
[root@fancypiper root]# cd /mnt/source
[root@fancypiper source]# tar cf - . | (cd /mnt/destination && tar xBfp -)
Edit /etc/fstab as needed, install the boot loader if you moved a whole distro, and it should work when it is installed in it's final position.
 
Old 07-01-2003, 12:18 PM   #3
andrew001
Member
 
Registered: Nov 2002
Distribution: Slackware 9.0
Posts: 321

Original Poster
Rep: Reputation: 30
Whew, good think I asked.

Thanks,
Andrew
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Does the mounting of a *BSD partition on linux work work well when rw ? kloss *BSD 3 10-08-2005 02:21 PM
Newbie... confirmation Bu3Nix Programming 5 09-15-2005 08:00 PM
Ctrl+C Confirmation pjpeter Linux - Newbie 2 09-25-2004 05:49 PM
what's with all the confirmation screens? andredude LQ Suggestions & Feedback 1 05-07-2004 03:56 PM
What sort of work is involved in k3b? robhargreaves Programming 5 05-04-2004 02:08 PM


All times are GMT -5. The time now is 11:38 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration