LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-26-2006, 02:09 AM   #1
-=Graz=-
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora, Slackware, RHEL, AIX, HP-UX
Posts: 358

Rep: Reputation: 31
How do i , backup data? Resize partition


Hey all,
I have a dillema where by i have installed ubuntu onto this machine and it has taken all 80GB of my HDD. I a preparing to put Slackware 10.1 back on here and would like to 1) backup the current system & 2) resize the partition to 40GB(ext3) + 40GB(ext3)

I have only sucessfully backed up my system using 'partimage' before. I beleive if i make an imge on a 80GB volume i cannot restore it back to a 40GB one.. Is this correct? If so this is not the option for me this time

I have resized partitions using many programs including the nice GUI of G/QTParted...
Last time i resized a partition that had a linux system on it, it was not very happy at all and the system would not boot anymore afterwards..

questions: 1) Is it safe to resize/create new linux partition/s in Gparted whilst there is a system currently on the disk ?
2) what are my other options for backup other than partimage ? What is the the command to simply tarball the entire partition..??

** Really all i want to do is backup my system/create the desired partitioning (above) and then Install Slackware and restore backed up system... Any help would be appreciated
Ive stuffed up too may times so wanna get it right this time

Last edited by -=Graz=-; 05-26-2006 at 02:12 AM.
 
Old 05-26-2006, 02:32 AM   #2
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Quote:
Originally Posted by -=Graz=-
Hey all,
I have a dillema where by i have installed ubuntu onto this machine and it has taken all 80GB of my HDD. I a preparing to put Slackware 10.1 back on here and would like to 1) backup the current system & 2) resize the partition to 40GB(ext3) + 40GB(ext3)

I have only sucessfully backed up my system using 'partimage' before. I beleive if i make an imge on a 80GB volume i cannot restore it back to a 40GB one.. Is this correct? If so this is not the option for me this time

I have resized partitions using many programs including the nice GUI of G/QTParted...
Last time i resized a partition that had a linux system on it, it was not very happy at all and the system would not boot anymore afterwards..

questions: 1) Is it safe to resize/create new linux partition/s in Gparted whilst there is a system currently on the disk ?
2) what are my other options for backup other than partimage ? What is the the command to simply tarball the entire partition..??

** Really all i want to do is backup my system/create the desired partitioning (above) and then Install Slackware and restore backed up system... Any help would be appreciated
Ive stuffed up too may times so wanna get it right this time
I think I recall your other thread and I think some mistakes were made during resizing. It would be easier if you had a second drive but if not you'll have to split the tar amongst several CDs if it's too large to fit on one.

The last time I checked, it was indeed true that partimage does not allow you to restore into a smaller partition even if your filesystem was smaller than the partition.

Depending on how many partitions you have, this is very simple to accomplish.

1- boot a live CD and mount its /tmp on the /tmp of your ubuntu system. we do this step because the cd burner will need space to work.

2- tar the root (of your real system, not the live CD!) using bzip2 (-cj switches) and exclude /tmp from the tar (I would tell you how to do this but last time I tried it goofed and did tmp anyway, so someone else should help)

3- burn the tar to a cd or cds as required by the size of the tar file

4- check the tar to make sure it's good by using tar -t and anything else you can do (although tar and bzip are reliable)

5- fdisk or cfdisk the drive to your liking

6- make an ext3 filesystem in the partition for ubuntu

7- untar ubuntu back into its place

8- boot ubuntu and make sure it works

9- install Slackware into its partition
 
Old 05-26-2006, 02:49 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I used tar to produce a backup of a dvd image and a very large directory onto an externel usb harddrive. Since the tar files would exceed the 2GB limit for filesize, I piped the output of the tar command to the split command to break up tar. ( Note: a huge tarfile was never created ). I used a slice size of 200MB. Then I used par2 to create parity files incase some of the files became damaged.

It is possible to restore straight from the USB drive this way:
cat /media/usbdrive/basename.tar.gz.??? | tar xvzf -
 
Old 05-26-2006, 03:08 AM   #4
-=Graz=-
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora, Slackware, RHEL, AIX, HP-UX
Posts: 358

Original Poster
Rep: Reputation: 31
Hey thanks for the info mate!

I love this forum!! ..
Okay all makes sense an i have a gentoo live CD here that i can do all this on...
Yes, it was me that made a similar post last time.. hehe..

.
 
Old 05-26-2006, 03:28 AM   #5
-=Graz=-
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora, Slackware, RHEL, AIX, HP-UX
Posts: 358

Original Poster
Rep: Reputation: 31
Actually, i have not used this 'bzip2' before.. I cannot see switch -J ? Only -c is available..
also, im not quite sure about mounting the /tmp of the live CD on the /tmp of my ubuntu system..

Whilst using the CD i can mount the entire /dev/hda1 to /mnt/temp1 (which im sure is not what you mean)

I have a 4GB USB laptop drive in a caddy which might suffice instead of using CD's -
I might go have a read about bzip2 and come back if i have problems.. Thanks again!
 
Old 05-26-2006, 03:51 AM   #6
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Quote:
Originally Posted by -=Graz=-
Actually, i have not used this 'bzip2' before.. I cannot see switch -J ? Only -c is available..
also, im not quite sure about mounting the /tmp of the live CD on the /tmp of my ubuntu system..

Whilst using the CD i can mount the entire /dev/hda1 to /mnt/temp1 (which im sure is not what you mean)

I have a 4GB USB laptop drive in a caddy which might suffice instead of using CD's -
I might go have a read about bzip2 and come back if i have problems.. Thanks again!
it's lower case j, not upper case J. Do man tar and look for -j, I have it on my man page for GNU tar, perhaps your distro isn't using that version. Bzip2 offers the most compression of the normal compression apps.

I meant to do

rm -r /tmp from the live CD's filesystem
mkdir /tmp
mount /tmp /dev/hdan/tmp

What we are trying to do is to use the /tmp from your existing installation as /tmp for your live CD because the /tmp on the live CD isn't going to be big enough to make a big tar or burn CDs. It's very nice that you have the 4G drive. If that's big enough, then disregard what I wrote earlier about /tmp since I didn't see from your post that you had another drive.

Instead, just tar your root filesystem directly onto your backup drive with bzip2. If you have other partitions make sure to tar them as well.
 
Old 05-26-2006, 06:33 AM   #7
-=Graz=-
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora, Slackware, RHEL, AIX, HP-UX
Posts: 358

Original Poster
Rep: Reputation: 31
Ahhh okay - makes sense...
The 4GB drive may be enough once the backup is compressed... (i forgot to mention i had this drive)

So after creating the backup i should use the command line to burn to CD/DVDR (if i choose to use discs) ?

I had better check the man page for bzip2 - when doing 'bzip2 --help' however it did not list the -j for some reason...
Ill be back

Last edited by -=Graz=-; 05-26-2006 at 06:47 AM.
 
Old 05-26-2006, 06:57 AM   #8
-=Graz=-
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora, Slackware, RHEL, AIX, HP-UX
Posts: 358

Original Poster
Rep: Reputation: 31
I just checked the man page for bzip2 - there is no -j or -J in my version =)

What are the best switches to use if i was to tarball the entire partition? Is this an option??
I thought i could just make a series of say 4 x 1GB .tar files and back these up to the drive or burn to DVD ..

What would i type to tar all of /dev/hda1 to either the virtual system on the CD or directly back to /dev/hda1/something ??
can this be done??

Maybe i should just update bzip2 to a newer version... It looks very powerful from the man page.
 
Old 05-26-2006, 10:31 AM   #9
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
tar -cjf mywholesystem.tar.bz2 /
 
Old 05-26-2006, 10:32 AM   #10
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Quote:
Originally Posted by -=Graz=-
Ahhh okay - makes sense...
The 4GB drive may be enough once the backup is compressed... (i forgot to mention i had this drive)

So after creating the backup i should use the command line to burn to CD/DVDR (if i choose to use discs) ?

I had better check the man page for bzip2 - when doing 'bzip2 --help' however it did not list the -j for some reason...
Ill be back
j is not a switch for bzip2; it's a switch for tar to tell it to use bzip2
 
Old 05-27-2006, 11:23 PM   #11
-=Graz=-
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora, Slackware, RHEL, AIX, HP-UX
Posts: 358

Original Poster
Rep: Reputation: 31
Oh my... looking through my post i really was sick yesterday
Have had the flu the last few days.... a bit more with it today though ..lol
stll having some issues though i think

I have booted live CD.
cd /
rm -r /tmp
mkdir tmp
mount /dev/hda1 /tmp -t ext3 (i cannot obvuisly mount straight to /tmp on the ubuntu system... just the divice/fs)
cd /tmp
tar -cjf systembackup.tar.bz2 /tmp/ --exclude=systembackup.tar.bz2

Now if i 'alt-f2' i can see in /tmp the new file is being created... which is in / of the other system.

problem is after it gets to about 3GB in size it starts spitting out errors about 'permission denied' when trying to open files in the /sys directory
there is nothing in this area untill the system is booted anyway...
 
Old 05-28-2006, 01:58 AM   #12
-=Graz=-
Member
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora, Slackware, RHEL, AIX, HP-UX
Posts: 358

Original Poster
Rep: Reputation: 31
Okay this thread can be marked resolved now - i have been doing a bit of reading and found out about the errors i was receiving...

Managed to get a nice backup by simply excluding /mnt /sys and the backupfile.tar.bz2

All is looking rosy for the re-install of Slackware! YES!
 
Old 05-28-2006, 03:55 AM   #13
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Glad to hear you have it working!
 
  


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
partition resize, loss of data? MetalStorm Linux - General 4 05-12-2006 09:05 PM
how to resize partition with no data loss? jonohana Linux - Newbie 3 11-15-2005 08:20 AM
resize existing partition w/o losing data rebelscum Slackware 8 07-21-2005 05:44 PM
Can i resize my partition without loosing data? byen Linux - General 4 05-25-2005 07:39 PM
Resize / partition without loss of data techsimian Linux - Hardware 6 03-19-2005 12:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:07 PM.

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