How to view/mount separate disk -- move /home to second disk
UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to view/mount separate disk -- move /home to second disk
I have two separate disk on my system. The goal is to have my /home directory on one disk and everything else on the existing disk. I believe I have copied my existing /home directory onto second disk, however I can't "see" it anywhere to verify what I think is there....really is.
...really means that your "/home" is on sdb1, it should have a "2" and not a "1" at the very end. Only the root filesystem is supposed to have a "1" - have a look at "man fstab".
Third, what happens if you create any kind of directory and manually mount the partition (if sdb1 is really the place were you have your /home files) manually with "mount -v /dev/sdb1 /yourdirectory"? Do you see the files you're looking for?
Before doing the last step, do you see by executing "df -h" that /dev/sdb1 is mounted on /home?
UUID is a valid alternative for the device specification - as is LABEL. The Ubuntu devs went with UUID to avoid issues with the libata change in 2.6.19 changing /dev/hd? to /dev/sd?
@Spearhead40, - as suggested try "df -h"; also "sudo fdisk -l",and post the results here.
Last edited by syg00; 10-20-2007 at 06:12 PM.
Reason: Arrhhh !!! - skipped mtab.
jon@jon-desktop:/$ sudo fdisk -l
[sudo] password for jon:
Disk /dev/sda: 60.0 GB, 60040544256 bytes
255 heads, 63 sectors/track, 7299 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4e434e42
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6996 56195338+ 83 Linux
/dev/sda2 6997 7299 2433847+ 5 Extended
/dev/sda5 6997 7299 2433816 82 Linux swap / Solaris
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000b3638
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 13 104391 83 Linux
/dev/sdb2 14 19457 156183930 8e Linux LVM
jon@jon-desktop:/$
Last edited by Spearhead40; 10-26-2007 at 02:58 PM.
Reason: add response text
Pearseattle was right, I had originally had sdb2 in my fstab. When things didn't work out I changed it to sdb1. Since Pearlseattle pointed out the error, I have changed it back to sdb2.
Yes you do have to mount to see the data.
Why did you choose to use LVM ??? - you need to mount the LV, not the physical device. I would expect all the Ubuntu derivatives to load the required support at boot, but I'm not a LVM user.
Installed sdb months and months ago, don't remember making a conscious decision to make the drive LVM (?) or not. If fact I had Kunbutu 6.06 on my system at the time. If having the two drive be different is problematic, can a change the LVM drive to extended (?) without losing the data on it? Or does it even matter?
I'll try to mount it, see what --if anything -- is on it. There should be a good deal of music on it that I would rather not lose if it can be helped.
Try a "pvscan" - it'll tell you if LVM is installed.
Drop in to tldp.org for the LVM how-to; it'll tellyou how to get the LV(s) mounted so you can see if the data is recoverable.
I would like to reformat the LVM disk so that is it the same as the "normal" one. Is there an easy way to do that? Short of making it the primary disk then loading linux on it?
You do realize you're going to lose any data on it - permanently ???.
Just delete the partition and create a new (Linux - type x'83') partition and do a mkfs on it. You *could* just mkfs straight over the top of it as it is, but that'll just lead to confusion later.
I use [c]fdisk and mkfs from a terminal, but if you prefer a GUI something like gparted should do it all for you I'd think.
Make a mountpoint (in need), and add it to fstab. Done.
Type Linux (x83) is used for all data partitions - ext2/3, reiser, jfs whatever.
Swap partitions are the exception - type x82; so no, there's no problem there.
Partition layout is always open to debate. There is no need to have sdb5 as a logical - no harm either. That layout (from sda) is typical of the Ubuntu installer - in your case you could have just one (or two) primary partitions (on sdb) as you have allocated the entire disk.
As for the id, I never bothered with it. It looks like the id bytes M$oft disk management puts in the MBR. Won't matter in your case, and if you ever format a NTFS partition (under Windoze) I think it gets set if needed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.