LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Changing sda to sdb (https://www.linuxquestions.org/questions/fedora-35/changing-sda-to-sdb-630061/)

mickeyboa 03-23-2008 02:28 PM

Changing sda to sdb
 
FC 8 i386.

I'm making a slight change to a friends computer that lives about 700 miles from me, He now has a 40gb harddrive with Fedora 6 installed.
I'm installing FC 8 on a 120gb harddrive for him.
I want to take his 40gb drive and change jumpers to make it a slave or sdb,
and the 120 gb as sda , which is how it is being loaded with FC 8 .
On sda in /etc/fstab I have a line,

/dev/sdb3 /mnt/Backup ext3 defaults 1 2

sdb3 is where his home directory is on the 40gb drive.

I did a chmod 755 /dev/sdb3 /mnt/Backup and now I can read/write onto /mnt/Backup, but /home/tom on sdb3, needs permissions to allow him to read/write, and to retrieve files from his old /home/tom directory.

I was thinking, could I, before changing drive from sda to sdb is to do a
chmod 755 on /home/tom and then it will already have the permissions to rw on sdb ?

One last ??? on FC 6 the drives where labeled as 'hd' instead of 'sd'
how will that affect /etc/fstab on the 120gb as 'sda' ?

chakkerz 03-23-2008 05:05 PM

Last ??? first: the labeling of the disk like that sd vs hd is kernel / udev based. Sadly i can not find anything via the Google oracle that states that in definitive terms so here is what you should do:

man e2label and then run `e2label /dev/sdb3 /home/tom`

that way you can then change the line
/dev/sdb3 /mnt/Backup ext3 defaults 1 2
to
LABEL=/home/tom /mnt/Backup ext3 defaults 1 2

NOW here is the pickle of your original question: because you are mounting /home/tom and because the mount occurs by root at startup you are a little bit screwed (it can be fixed). Personally i prefer to have the partition as /home and then the underlying directory is /home/chakkerz which is on the drive so when it get's mounted it is already owned by me.

There is little you can do easily to get around the ownership issue, but you can do a couple of things:
1) move everything in /home/tom to /home/tom/tom , chown / chmod /home/tom/tom appropriately and mount it as /mnt/Backup again. Tom will be able to read/write from /mnt/Backup/tom no worries

2) you make the line:
LABEL=/home/tom /mnt/Backup ext3 noauto,users,rw,exec 1 2

That way /mnt/Backup won't be mounted automatically at boot, but users (such as tom) can mount the device and will be able to read and write as well as execute software on said device.

3) same as two, but you put something in ~tom/.profile to mount /mnt/Backup when he log's on

hope that gives you some ideas.

chakkerz

armanox 04-20-2008 10:58 PM

for the labeling question....I think that that's what UUID is supposed to solve, but, I'm not well versed on the material. I'd try sd? and hd? myself to see what works.

billymayday 04-20-2008 11:02 PM

It's be /dev/sdb from F8's perspective irrespective of what FC6 sees it as. The "labelling" you refer to is different from the naming/labelling of partitions.

Make sure his uid/gid are the same in F8 as FC6 and he should be right to read his home dir.

Edit -oops - pretty old thread - why did you responsd to this after a month?

armanox 04-21-2008 12:22 AM

I responded because it showed up on my list for "View new posts", and it's only been a since Friday that I was here. Must have been a glitch in the DB.


All times are GMT -5. The time now is 05:42 PM.