LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-11-2008, 11:24 PM   #1
VeganBikePunk
LQ Newbie
 
Registered: Jun 2008
Posts: 9

Rep: Reputation: 0
file storage while switching distros


I'm about to switch from BLAG (a fedora spin) to ubuntu. Is there any way to keep everything in my home folder, or is there a place where I can store like 50 gigs of music and videos for a couple hours while I switch? Or do I have to burn like 60 CDs?
 
Old 06-11-2008, 11:44 PM   #2
jpwigan
LQ Newbie
 
Registered: Jun 2008
Distribution: RHEL, Fedora, Gentoo, Slackware
Posts: 27

Rep: Reputation: 16
Depends on whether or not you have /home on a separate partition. If /home has its own entry in 'mount', then you have it on a separate partition. In that case, when you install Ubuntu, you can tell the installer that that partition is /home and that it should NOT be formatted. This should preserve all of your data.

If you don't have /home on a separate partition, things get trickier. If you have an external hard drive, you could always dump it there. :P If not, you *might* be able to resize some other partitions and make a new partition for /home, then follow the above suggestion. That depends on a number of variables, though, and it's potentially dangerous even if its possible. To advise you more on that, I'd need to see the output of 'fdisk -l', 'mount', 'pvs', 'vgs', and 'lvs'.
 
Old 06-12-2008, 12:01 AM   #3
VeganBikePunk
LQ Newbie
 
Registered: Jun 2008
Posts: 9

Original Poster
Rep: Reputation: 0
I don't think I have a seperate /home partition (though next time I may). I do have a windoze partition. And no external HD (or I'd use that of course)

Code:
[thirtysix@localhost ~]$ sudo /sbin/fdisk -l
Password:

Disk /dev/sda: 164.6 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        2550    20482843+   7  HPFS/NTFS
/dev/sda2            2551        2563      104422+  83  Linux
/dev/sda3            2564       20023   140247450   8e  Linux LVM

Disk /dev/sdb: 4026 MB, 4026531840 bytes
220 heads, 32 sectors/track, 1117 cylinders
Units = cylinders of 7040 * 512 = 3604480 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        1118     3932143+   c  W95 FAT32 (LBA)

Disk /dev/dm-0: 142.5 GB, 142505672704 bytes
255 heads, 63 sectors/track, 17325 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-1 doesn't contain a valid partition table
Code:
[thirtysix@localhost ~]$ sudo /sbin/pvscan 
  PV /dev/sda3   VG VolGroup00   lvm2 [133.75 GB / 32.00 MB free]
  Total: 1 [133.75 GB] / in use: 1 [133.75 GB] / in no VG: 0 [0   ]
 
Old 06-12-2008, 12:30 AM   #4
jpwigan
LQ Newbie
 
Registered: Jun 2008
Distribution: RHEL, Fedora, Gentoo, Slackware
Posts: 27

Rep: Reputation: 16
Well, looks like your Volume Group is fully used. You could try shrinking the root partition and creating a separate /home, if you've got the free space. You'd have to do it from a LiveCD, of course (I'd recommend the rescue mode on the Install CD, if BLAG has a rescue mode), and you need the available space. What's the output of these two commands?

lvs
df -h
 
Old 06-12-2008, 02:34 AM   #5
VeganBikePunk
LQ Newbie
 
Registered: Jun 2008
Posts: 9

Original Poster
Rep: Reputation: 0
Code:
[thirtysix@localhost ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      129G   65G   58G  54% /
/dev/sda2              99M   19M   76M  20% /boot
tmpfs                 252M     0  252M   0% /dev/shm
/dev/sdb1             3.8G  1.6G  2.3G  41% /media/disk
Code:
[thirtysix@localhost ~]$ /usr/sbin/lvs
  No volume groups found
I'm going to need to be walked through this resizing partition tabling jazz.
 
Old 06-12-2008, 11:52 AM   #6
jpwigan
LQ Newbie
 
Registered: Jun 2008
Distribution: RHEL, Fedora, Gentoo, Slackware
Posts: 27

Rep: Reputation: 16
Strange that there are no volume groups found - you clearly have a volume group mounted. Make sure you run these commands as root.

Anyway, LogVol00 has 58 GB of free space. Assuming that's enough, we can shrink it and move /home to a new Logical Volume. I will admit now that I'm not sure how elegantly Ubuntu's installer handles LVM, though. I've only installed Ubuntu twice, and only used it for a couple months... never did anything too fancy. Hopefully someone else can attest to whether this will result in something Ubuntu can use without clobbering.

Also, I'm assuming your partitions are ext3. Throw the output of 'mount' up here on your normally running system if you're not sure whether this is true.

To do this, get the machine booted into a rescue mode or LiveCD (if the install disc has a rescue mode, that's preferable. It will help ensure that the tools are all versions that are compatible with your installation).

When you boot, make sure you choose NOT to mount your filesystems, if prompted. Once you're at a shell, you may need to scan for lvm devices. These commands may vary a bit from distro to distro, but this will typically work:

lvm.static pvscan
lvm.static vgscan
lvm.static lvscan
lvm.static vgchange -ay

Now, 'lvm.static lvs' should show your volume group. Shrink it with these commands:

e2fsck -f /dev/VolGroup00/LogVol00
resize2fs /dev/VolGroup00/LogVol00 69G
lvm.static lvm.reduce -L 70G /dev/VolGroup00/LogVol00
resize2fs /dev/VolGroup00/LogVol00

Notice the 3-step process there: shrink FS, shrink partition to something slightly larger, then re-grow FS. This is a sanity check that helps avoid a potentially bad situation where your FS extends past the end of your partition.

Now, you can create a new Logical Volume and put a filesystem on it:

lvm.static lvcreate -n home -L100%FREE VolGroup00
mkfs.ext3 /dev/VolGroup00/home

Now you can mount /dev/VolGroup00/home on a temp directory, copy everything in /home over to it, and you have everything from /home on a new partition. If you're going to keep using this install for a while, I'd recommend adding an entry to /etc/fstab to have /dev/VolGroup00/home mount on /home at boot, so any changes you make go to the correct partition.
 
Old 06-12-2008, 11:13 PM   #7
VeganBikePunk
LQ Newbie
 
Registered: Jun 2008
Posts: 9

Original Poster
Rep: Reputation: 0
Code:
[thirtysix@localhost ~]$ sudo mount
Password:
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda2 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
/dev/sdb1 on /media/disk type vfat (rw,nosuid,nodev,uhelper=hal,shortname=lower,uid=500)
 
Old 06-12-2008, 11:22 PM   #8
VeganBikePunk
LQ Newbie
 
Registered: Jun 2008
Posts: 9

Original Poster
Rep: Reputation: 0
and so, the commands starting at lvm.static pvscan should be typed in during rescue mode of the ubuntu CD?
 
Old 06-12-2008, 11:31 PM   #9
VeganBikePunk
LQ Newbie
 
Registered: Jun 2008
Posts: 9

Original Poster
Rep: Reputation: 0
also, can I get specific instructions for mounting the partition to a temp directory, and copying everything from home over to it. And I'm not going to be using BLAG for much longer at all, so the FStab alteration shouldn't be necessary, but I'm wondering if the ubuntu install will just know that /home is mounted there or if I'll have to add something to fstab there.
 
Old 06-14-2008, 10:42 PM   #10
jpwigan
LQ Newbie
 
Registered: Jun 2008
Distribution: RHEL, Fedora, Gentoo, Slackware
Posts: 27

Rep: Reputation: 16
Yes, those commands are all from rescue mode. I thought the previous paragraph said so

In the Ubuntu install, you'll probably have to specify that the partition is /home, and tell it NOT to format the partition. I've never worked with the Ubuntu partition setup during install (always just accepted the defaults), so I don't know the exact procedure there. Like I said before, I don't even know how Ubuntu deals with LVM...

To mount & copy the data, though, I'd do something like this:

mkdir /tmp/root
mkdir /tmp/home
mount /dev/VolGroup00/VolGroup00 /tmp/root
mount /dev/VolGroup00/home /tmp/home
cp -pR /tmp/root/home/* /tmp/home/
umount /tmp/root
umount /tmp/home
 
  


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
Switching to other distros... cyberbuff Linux - Newbie 10 12-31-2006 12:59 AM
Switching Distros naraht Linux - Newbie 3 08-03-2005 04:37 AM
Switching distros..... AudioMechanic Linux - Distributions 5 09-05-2004 07:02 PM
Switching Distros thcmwz Linux - Software 1 11-27-2003 10:45 AM
Switching distros pmehta1613 Linux - Newbie 1 11-08-2003 06:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:44 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