LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (http://www.linuxquestions.org/questions/ubuntu-63/)
-   -   How to view/mount separate disk -- move /home to second disk (http://www.linuxquestions.org/questions/ubuntu-63/how-to-view-mount-separate-disk-move-home-to-second-disk-593263/)

Spearhead40 10-20-2007 10:48 AM

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.

Here is a my fstab and mtab

/etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=7f8817ee-08e9-454c-b82f-4102d8f53e0a / ext3 defaults,errors=remount-ro 0 1
# /dev/sda5
UUID=791f399a-4b89-4587-aef9-a4dc64c5632b none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec 0 0
/dev/sdb1 /home ext3 defaults, errors=remount=rw 0 1

/etc/mtab
/dev/sda1 / ext3 rw,errors=remount-ro 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
/sys /sys sysfs rw,noexec,nosuid,nodev 0 0
varrun /var/run tmpfs rw,noexec,nosuid,nodev,mode=0755 0 0
varlock /var/lock tmpfs rw,noexec,nosuid,nodev,mode=1777 0 0
udev /dev tmpfs rw,mode=0755 0 0
devshm /dev/shm tmpfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
lrm /lib/modules/2.6.22-14-generic/volatile tmpfs rw 0 0
securityfs /sys/kernel/security securityfs rw 0 0


Can I use Dolphin to view what is on the sdb1 disk? If so how?

What in either fstab or mtab (maybe both?) needs to be changed so that the /home directory on the sdb disk is one that is always used?

Pearlseattle 10-20-2007 06:00 PM

First of all, a question: the line in fstab which is supposed to mount your root filesystem from sda1...
Quote:

# /dev/sda1
UUID=7f8817ee-08e9-454c-b82f-4102d8f53e0a / ext3 defaults,errors=remount-ro 0 1
...is commented out. How is it possible that your root is actually mounted (mtab)...
Quote:

/dev/sda1 / ext3 rw,errors=remount-ro 0 0
?
Then, if the line...
Quote:

/dev/sdb1 /home ext3 defaults, errors=remount=rw 0 1
...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?

syg00 10-20-2007 06:07 PM

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.

Pearlseattle 10-21-2007 06:44 AM

Ah, sorry, now I got it - I thought there was no newline after "/dev/sda1" :D

Spearhead40 10-26-2007 02:55 PM

syg00 -- as you requested here is the results of df -h and fdisk -l:

Is it necessary to mount the disk to see what may or may not be on sdb2?


jon@jon-desktop:/$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 53G 3.6G 47G 8% /
varrun 633M 84K 633M 1% /var/run
varlock 633M 0 633M 0% /var/lock
udev 633M 80K 633M 1% /dev
devshm 633M 0 633M 0% /dev/shm
lrm 633M 34M 599M 6% /lib/modules/2.6.22-14-generic/volatile



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:/$

Spearhead40 10-26-2007 03:03 PM

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.

fstab now reads as follows:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=7f8817ee-08e9-454c-b82f-4102d8f53e0a / ext3 defaults,errors=remount-ro 0 1
# /dev/sda5
UUID=791f399a-4b89-4587-aef9-a4dc64c5632b none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec 0 0
/dev/sdb2 /home ext3 defaults, errors=remount=rw 0 1

syg00 10-26-2007 06:55 PM

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.

Spearhead40 10-27-2007 07:34 AM

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.

syg00 10-27-2007 07:33 PM

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.

Spearhead40 10-29-2007 04:52 PM

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?

syg00 11-02-2007 05:51 PM

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.

Spearhead40 11-03-2007 12:31 PM

syg00 -- Yes, I realize the data will be lost. It's not a big deal... nothing critical was on there -- just possibly some music.

I reformatted the disk so it is now set up like so:

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 19214 154336423+ 83 Linux
/dev/sdb2 19215 19457 1951897+ 5 Extended
/dev/sdb5 19215 19457 1951866 83 Linux

The only difference I see between sda and sdb is the last partition. sda5 is designated "Linux swap/Solaris"

sdb5 is just "Linux" will that cause me problems?

Disk identifier is 0x00000000. Is that a problem?

syg00 11-03-2007 03:37 PM

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.


All times are GMT -5. The time now is 12:58 AM.