Click to See Complete Forum and Search --> : Need help replacing an "hdc" mounted as \home
rcrosier
02-01-2001, 01:20 PM
I installed RH linux on an old machine for testing. The machine has a 1.2GB hda, 500MB hdb, and HAD a 340MB hdc. I found an old 3GB drive, and now want to replace the hdc (it only has /home mount point with a lost+found, a public and an application directory in it).
I have no clue how to do this, but THINK it shouldn't be that hard.
I have copied all the data from those directories to a W98 workstation attached to the Linux box via SAMBA.
Thanks
------------------
Creative Consulting Services
159 Rt 67W
North Bennington, VT 05257
802-447-8801
:david:
02-01-2001, 01:33 PM
the only problem that i see is that you don't have the space for it, as hdd is probably your cdrom.
if this is the case, log in only as root and try not to use anything connected to /home, comment out the line for your /home in /etc/fstab, shutdown and replace the old drive with the new drive, boot up (notice, if you have no line for it in /etc/fstab - you commented it out, the system won't try to mount it). use mkfs to build an ext2 filesystem on it, then mount it as /dev/hdc, copy all the files to, creating the directory structure on it, uncomment the /home line in /etc/fstab, reboot. you should be fine. to be as safe as possible do everything from single user mode until you're ready to test the live system.
you can get into single user mode with lilo like this at the lilo prompt:
LILO: linux single
------------------
david@us.aduva.com
http://www.aduva.com
MBMarduk
02-01-2001, 01:37 PM
Here's something I learned from a friend...
Migrating Mountpoints
Need some extra space? Here's one way: Let's migrate e.g. [/usr/local], ok?
1. Make your new partition using [FDISK] or [CFDISK] (on the 3GB new disk)
2. Format it with [MKE2FS]
3. Mount the new partition on [/mnt]
4. [cd /usr/local]
5. [tar pcf - * | tar xpcf - /mnt/] (this places all the files in '/mnt/')
6. Edit the file [/etc/fstab] to include the line [/dev/XXX /usr/local ext2 defaults 1 1], where 'XXX' is the new partition.
7. Reboot and run some programs to make sure everything is ok.
8. [umount /usr/local]
9. [rm -rf /usr/local] (*f*orces a delete of the OLD '/usr/local' *r*ecursively)
10. [mkdir /usr/local]
11. REBOOT!!
Hope this helps you...
-Mike
rcrosier
02-01-2001, 02:24 PM
Thanks for the replies:
I have successfully (I think) created (FDISK) and formatted (MKFS) the partition. It shows up in DMESG as /dev/hdc... but also shows unknown partition table under the other hard drives (hdb: [PTBL] [528/32/63] hdb1 hdb2
I don't know/understand the commands to recreate the /home directory.
When it reboots, I get a message: No such file or directory while trying to open LABEL=/home.
I'm REAL new to this, so sorry if it sounds dumb.
ssadams
02-01-2001, 03:19 PM
did you by chance fdisk and format /dev/hdb instead of hdc? to check your partitions the commands for fdisk are
fdisk /dev/hdx replace x with a,b,c,d etc
"p" prints partition info
"t" changes the type of partition eg dos,ext2
"w" write changes and exit
"m" print list of menu commands
there are more put you get the drift of it
rcrosier
02-01-2001, 03:24 PM
Nope, I fdisk'd and formatted /dev/hdc.
Everything else seems to be there fine.
rcrosier
02-01-2001, 04:08 PM
MYSTERY SOLVED!
I needed to do this:
e2label /dev/hdc1 /home
After finding this command, and entering it at the root prompt, I was able to reboot Linux, and the new 3.2GB volume was /home!
Thanks to everyone!