fstab - change from by-id to by-path Can system do this for me?

I am in process of transitioning my laptop to two new drives, see http://forums.opensuse.org/english/get-technical-help-here/install-boot-login/472783-laptop-ssd-migration-strategy-comments-please.html?highlight=fstab if interested.

I realize that fstab must be changed, as the disk IDs will change.

Is there a robust mechanism to convert the current /etc/fstab from by-ID to by-path or by-device?
I would refer that as a starting point than having to type in the new disk ID’s manually.

Using this “simpler to edit” fstab, I can enter the new partition configuration, get up and running, then probaboly convert to the more reliable (?) by-id scheme.

The current fstab is already backed up, thanks for reminding me in advance :slight_smile:

You could either edit the fstab manualy, where you can make it yourself easier to avoid errors by using the names that are e.g. in /dev/disk/by-path/ wit copy/paste.

You could also use YaST > System > Partitioner IMHO. Of course you should not change any partitioning there. nor let any file system be recreated (no formatting), but you can indicate there what naming should be used.

BTW, please think over the usage of by-path. I can not realy see all the implications, but it could be that hardware pathes are interpreted differently at a boot up (similar to disk sequence in sda,* sdb*, …). I would go for* by-uuid*. But I repeat that I am not 100% here.

I agree with hcvv about not using YaST or any other partitioning tool to do this. If you do it by editing fstab, you would need to reboot for it to take affect. Make sure you have a live CD on hand in case things don’t go as planned and do a full back up.

On 2012-02-27 16:56, cmcgrath5035 wrote:
> I realize that fstab must be changed, as the disk IDs will change.

Use a text editor and copy paste the strings you want. There is no
difficulty on this.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Don’t use by-path! It’s even worse than by-ID. It will change anytime a disk is plugged in into another SATA port. If you use findgrub -M](http://forums.opensuse.org/english/get-technical-help-here/install-boot-login/472811-grub-not-booting-after-reboot-2.html#post2443362) to display the by-id/by-path to BIOS name and kernel device mapping, you will see that this is not very reliable. It also may vary from one mainboard to another and depending on the number of SATA controllers. I recommend using UUIDs or labels. You can use partinfo -V](http://forums.opensuse.org/english/other-forums/development/programming-scripting/461462-partinfo-displaying-partition-infos.html#post2353213) to display both disk IDs and UUIDs and edit /etc/fstab manually. You may also choose how to mount partitions at installation time in the fstab options of the expert partitionner. I always choose “UUID”.

On 2012-02-27 23:46, please try again wrote:
> Don’t use by-path! It’s even worse than by-ID. It will change anytime a
> disk is plugged in into another SATA port

I have never used by path, but it is interesting to know that. Saved for
reference :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Thanks for the comments.

I understand, at least some of, the issues with by-path and it’s unpredictability.

After contemplating hcvv’s comment (#2), I realized I could get most of what I wanted from YAST-Partitioner by using it to establish a mount point for a newly configured (mostly with Parted Magic live disk) hdd/ssd.
For example, mounting the new root drive to /newroot gave me a properly configured entry in fstab with ID and other settings which became the easier basis for editing the final new fstab.

My transition is nearly complete, I’ll be updating http://forums.opensuse.org/english/get-technical-help-here/install-boot-login/472783-laptop-ssd-migration-strategy-comments-please.html?highlight=fstab
once I sort out a couple more things.

SuSE12.1 running with “renewed vigor” from the ssd.
Clearly hdd performance was slowing SuSE somewhat, but WinXP and Win7 a whole lot.
Moving my vbox Win7VM virtual disk to the ssd makes it as good(or better) as the former direct boot Win7 from hdd.

I am still having some issues getting my Win7 to boot directly(dual boot) from the ssd.
Grub is OK, Windows starts to boot then has issues.