You are not logged in.
Hi, all.
I was trying Arch on a spare machine and my partitioning looked like this (I think):
/dev/hda1 /boot
/dev/hda2 /
/dev/hdb1 /home (empty)
/devhdb2 swap
My hdb was very old and had huge read/write errors. I did some tests on it and decided to bin it.
I have put a spare HDD in its place, but obviously my /home and swap no longer exist.
My /home was empty, apart from a couple of files from when it was created.
Now that I have my replacement HDD in position, what is the best way to check my /etc/fstab to see how my old disk was partitioned, and then recreate a swap and /home partition that can be mounted at boot time? I know I should have noted this information before I removed the disk, but that's all part of learning about recovery :-).
Any help appreciated.
Cheers,
Chris.
Last edited by chris_debian (2009-07-15 16:58:56)
Offline
Your /etc/fstab is still where it always was, in the root filesystem on /dev/hda2. Just set up the new hdb to match it.
Offline
tomk,
Thanks for that. My post was poorly worded. What I need to do is:
0) Find a way or reading my /etc/fstab (from a LiveCD?)
1) Format/ apply filesystems to my new disk (as specified in my /etc/fstab).
Can anyone advise me?
Cheers,
Chris.
Offline
0) Simply boot into your system, log in as root and adjust your fstab
1) parted or gparted live CD or partedmagic live CD
Personally I'd go for parted, i.e. you can do steps 0 and 1 and log in aftertwards in one go without rebooting.
never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::
Offline
My boot drops to a shell, probably because my swap has disappeared. It will have to be a LiveCD.
When I boot from a LiveCD (sysresccd), would I mount my / and then look at the /etc/fstab?
I'm thinking something like:
sysrescue CD boots
mount /dev/hda? /
cat/ more /etc/fstab
Once partitions confirmed, use gparted or something to create the new /home and swap?
umount /
Any advice appreciated.
Cheer,
Chris.
Last edited by chris_debian (2009-07-14 12:47:09)
Offline
<bump> Just edited my last reply.
Chris.
Offline
Yeah, sounds fine.
If you're still interested, you might be able to boot your existing install in single user mode, but if you're happy with the Live CD approach, go ahead with it.
Offline
In the old days I'd type Linux single (I think) at the LILO prompt. Is something similar available with GRUB?
Chris.
Offline
Maybe this is what you are looking for...but i'm not sure. Link
Last edited by miau (2009-07-14 15:46:09)
Offline
When I dropped to a shell, I mounted the /. My /etc/fstab no longer uses /dev/hda etc, it has unique ID's for the disks. Very helpful......
Downloading the systemrescuecd.
:-(
Offline
You _can_ use old style hdx/sdx instead of UUIDs in your fstab. To find out UUIDs you can chroot into / from a live system and use the blkid command.
never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::
Offline
toad,
When it drops to a shell, I can use the command prompt. Could I gain the same information this way. My Gentoo dealings have taught me that chrooting confuses me.
I'll boot the spare box and see. Looking at blkid man page, next.
Chris.
EDIT 8< I can use the blkid, but I don't understand how to manipulate the data. the UUID's are a huge string of characters, that I can't copy. Is it possible to | (pipe) them somehow. Failing this, when my rescuecd has downloaded, I can just guess which partition comes first, and if I'm wrong, do it again. Only two options for the partitioning.
Nice to do this from my Arch install though, and keep it in-house :-)
Last edited by chris_debian (2009-07-14 19:09:47)
Offline
Oh, you got proper command line, no need for a live cd then. Use hdx/sdx for now. You could of course pipe with awk but you've got to work it out for yourself
never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::
Offline
I dabbled wit Sed a long time ago.
I'll look-up some
Mkdir /home
Mkswap sort of stuff. Not sure about creating ext4 /home. I think mke2fs -j may not be good for ext4.
Cheers,
Chris.
Offline
The gparted live cd worked like a dream.
I now have:
hdb1 /home
hdb2 swap
Unfortunately Arch doesn't agree. I can only think it's because /etc/fstab has these unique UUID codes, which don't match my new drives. I'm starting to wonder whether it's worth just starting from scratch?
Positive: I get my system working.
Negative:
0) It takes a while to get to a state I'm happy with.
1) I don't learn about fixing my system.
If anyone can help, I'd really appreciate it.
Cheers,
Chris.
Last edited by chris_debian (2009-07-14 22:20:54)
Offline
Having slept on this, I think the blkid man page said something about an option that checked for blkid's and flushed invalid ones.
What I probably need to do then is flush/ replace my /etc/fstab blkid's with whatever the ID's of my new partitions are. So I need to investigate how I do that. On a Windoze box right now (work), so can't test until this evening.
Offline
Even though i've been tortured in my experiences with puppy linux and it's various idiosyncrasies etc etc. I currently have it installed on a 128 meg USB stick and because my skills are hit and miss and I'm attempting (successfully) to do all kinds of stuff (repo-add ofline repo installs etc)
Anyways... I hope I understood this thread... I'm saying puppy seems to make a quick and effective live cd/usb entity.
Offline
Many thanks for the recommendation. I hope to be able to run from the shell that my boot drops into, and then use blkid to sort my problems. Fingers crossed.
Cheers,
Chris.
Offline
How pleased am I?
Due to the problems cutting and pasting UUID numbers in a non-X terminal, I did the following:
cp /etc/fstab /etc/fstab.old ### back-up original /etc/fstab
blkid -c /dev/null >> /etc/fstab ### get partition ID's for /etc/fstab, using only real ID's and not old no longer available ones (-c /dev/null). The >> /etc/fstab puts this information at the end of your /etc/fstab which makes it really easy to edit.
My Arch boots :-). I can't start a graphical session because I don't have a config in my /home, but this should be easy to recreate. I'll look-up the xfce docs.
Looking good :-)
Cheers,
Chris.
Offline
Coolie, forget awk Didn't know you could do it like that, am a mere user myself... Perhaps mark the thread as solved?
never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::
Offline
Roger, roger.
Offline