Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


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

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


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


/dev/hda4 /var ext3 rw 0 0

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

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

Rep: Reputation: 58
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
[phil@fancypiper phil]$ su -
[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.
[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
[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
Registered: Nov 2002
Distribution: Slackware 9.0
Posts: 321

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



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 > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:41 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration