[Sussex] partitions and the like ??

Steve Dobson steve at dobson.org
Sat Jan 1 19:30:13 UTC 2005


John

On Sat, Jan 01, 2005 at 06:51:35PM +0000, John D. wrote:
> On Wed, 2004-12-29 at 20:58 +0000, John D. wrote:
> <snip>
> > So, I need to backup before anything else :-P ?
> > 
> > Actually there's nothing that I can't afford to loose if I screw up,
> > just the inconvenience of re-applying the customisations etc, Ok that
> > certainly sounds like extremely sensible advice.
> > 
> > With that in mind, if I read correctly, I can be root and then do the 
> > 
> > # cd /home
> > # tar cvfz /home-backup.tar.gz
> > 
> > bits ? Plus as I don't follow all the stuff that is included in "man
> > tar" does the cvfz /home-backup.tar.gz actually make the backup and
> > place it in the root partition (presuming that I've read things
> > correctly) ?
> > 
> </snip>
> 
> Ho hum, this linux lark is sometimes rather tiresome.
> 
> bash-2.05b# cd /home
> bash-2.05b# tar cvfz /home-backup.tar.gz
> tar: Cowardly refusing to create an empty archive
> Try `tar --help' for more information.
> bash-2.05b# tar -cvfz /home-backup.tar.gz
> tar: Removing leading `/' from member names
> tar: /home-backup.tar.gz: Cannot stat: No such file or directory
> tar: Error exit delayed from previous errors
> bash-2.05b#
> 
> I can't do that!, I haven't really got much of a clue as too how I'd
> backup /home to cd anyway.

When creating a TAR file you need to tell tar(1) which files/directories
to backup.  By adding a "." as the last argument you tell tar to back
up the current working directory and all it's children.

> I seem to have cfdisk in the system:-
> 
> 
>            cfdisk 2.12i
> 
>                               Disk Drive: /dev/hda
>                        Size: 120000000000 bytes, 120.0 GB
>              Heads: 255   Sectors per Track: 63   Cylinders: 14589
> 
>     Name        Flags      Part Type  FS Type          [Label]
> Size (MB)
> 
> ------------------------------------------------------------------------------
>     hda1        Boot        Primary   NTFS             [^B]
> 21056.72
>     hda2                    Primary   Linux ext3
> 1052.84
>     hda3                    Primary   Linux swap / Solaris
> 1579.26
>     hda5                    Logical   Linux ReiserFS
> 20974.47
>     hda6                    Logical   Linux ReiserFS
> 75335.34
> 
>      [Bootable]  [ Delete ]  [  Help  ]  [Maximize]  [ Print  ]
>      [  Quit  ]  [  Type  ]  [ Units  ]  [ Write  ]
>                    
> 
> but I'm not sure why it's not showing the fact that I previously
> "scrunched" up the /hda6 file system

That is because you "scruched" the file system, not that partition
in which it lives.
 
> bash-2.05b# df /home
> Filesystem           1K-blocks      Used Available Use% Mounted on
> /dev/hda6             42111064   1395076  40715988   4% /home
> bash-2.05b#
> 
> I checked on Rupert S's suggestion of QParted, but I get this
> 
> bash-2.05b# emerge QParted
> Calculating dependencies
> emerge: there are no ebuilds to satisfy "QParted".
> 
> bash-2.05b#

That's for an gentoo expert, but I don't think you need QParted for 
what you are trying here as you backup of the /home partition first
will bed used to resore the files.
 
> I sort of realise that the inconvenience of re-installing all the stuff
> that's in the /home so obviously need to follow the wisdom of Steve D
> and John Crowhurst - but how ?

# cd /home
# tar cvfz /home-backup.tar.gz .
                               ^ Note the dot, it's important
# cd 
# umount /home
# cfdisk
     Selecte hda6 
     [ Delete ]
     [ New ]
         Type:      Logical   (it may not ask this as you already have three
                               primary partitions and the fourth is assigned
                               to the area holding the logical partitions)
         Size:      35000     (Or whatever size you want)
         Placement: Beginning 
     { Down Arrow; to select Free Space }
     [ New ]
         Type:      Logical
         Size:      The rest of the disk
     [ Write ]
# mkfs -t reiserfs    /dev/hda6  (Check the device names are the same as 
# mkfs -t msdos -F 32 /dev/hda7   the ones seen when you ran cfdisk)
# mount /home
# cd /home
# tar xcfz /home-backup.tar.gz   (no dot need this time)
# mkdir -p /mnt/msdos
# mount /dev/hda7 /mnt/msdos

That should do it for you.

Note: I have assumed the device names and that everything works, check, check
and check again.  It at all unsure don't continue, but report back.

Steve





More information about the Sussex mailing list