You are not logged in.

#1 2023-12-28 02:47:14

breadegg4
Member
Registered: 2023-12-28
Posts: 9

How to modify /etc/fstab from nvme1n1 to nvme0n1?

hello, I am window user and migrate to  arch linux last week and I search all related topic and tutorial like youtube, stackoverflow, and other forum related to my issue. I understand the theory but I can't backup it to external drive since it keep failing in clonezilla because of nvme1n1 need a root access.

here is the current output:


[root@arch ~]$  lsblk -f
NAME        FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
zram0                                                                              [SWAP]
nvme1n1     ext4   1.0         2a5269c3-623f-4f9e-a19e-f8420044f59c    1.7T     0% /alternative_e
nvme0n1                                                                            
├─nvme0n1p1 vfat   FAT32       6FB7-0EF9                             261.8M    49% /boot
└─nvme0n1p2 btrfs              d2d454dc-352e-4cdc-9ce1-2321bc323811    1.7T     5% /var/cache/pacman/pkg
                                                                                   /var/log
                                                                                   /home
                                                                                   /.snapshots
                                                                                   /
[root@arch ~]$ sudo blkid
/dev/loop1: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/nvme0n1p1: UUID="6FB7-0EF9" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="c79bae78-fc3a-4e8d-82c2-49b100af58f2"
/dev/nvme0n1p2: UUID="d2d454dc-352e-4cdc-9ce1-2321bc323811" UUID_SUB="2401a2da-6ec4-4b1e-828d-ffdf837b7903" BLOCK_SIZE="4096" TYPE="btrfs" PARTUUID="aeb1b786-6f4e-4ee3-a090-3c72d76d1e4f"
/dev/loop6: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/loop4: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/loop2: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/loop0: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/loop7: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/nvme1n1: UUID="2a5269c3-623f-4f9e-a19e-f8420044f59c" BLOCK_SIZE="4096" TYPE="ext4"
/dev/zram0: LABEL="zram0" UUID="4b1ca948-f862-4c1a-952e-65883e47619b" TYPE="swap"
/dev/loop5: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/loop3: BLOCK_SIZE="131072" TYPE="squashfs"
[root@arch ~]$ sudo fdisk -l
Disk /dev/nvme1n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: TS2TMTE250H                             
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/nvme0n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: TS2TMTE250H                             
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: FD246CAE-848F-4DBC-8B87-1FB36B4EF00A

Device           Start        End    Sectors  Size Type
/dev/nvme0n1p1    2048    1050623    1048576  512M EFI System
/dev/nvme0n1p2 1050624 3907028991 3905978368  1.8T Linux filesystem

here is my /etc/fstab

# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/nvme0n1p2
UUID=d2d454dc-352e-4cdc-9ce1-2321bc323811	/         	btrfs     	rw,relatime,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/@	0 0

# /dev/nvme0n1p2
UUID=d2d454dc-352e-4cdc-9ce1-2321bc323811	/home     	btrfs     	rw,relatime,ssd,discard=async,space_cache=v2,subvolid=257,subvol=/@home	0 0

# /dev/nvme0n1p2
UUID=d2d454dc-352e-4cdc-9ce1-2321bc323811	/var/log  	btrfs     	rw,relatime,ssd,discard=async,space_cache=v2,subvolid=258,subvol=/@log	0 0

# /dev/nvme0n1p2
UUID=d2d454dc-352e-4cdc-9ce1-2321bc323811	/var/cache/pacman/pkg	btrfs     	rw,relatime,ssd,discard=async,space_cache=v2,subvolid=259,subvol=/@pkg	0 0

# /dev/nvme0n1p2
UUID=d2d454dc-352e-4cdc-9ce1-2321bc323811	/.snapshots	btrfs     	rw,relatime,ssd,discard=async,space_cache=v2,subvolid=260,subvol=/@.snapshots	0 0

# /dev/nvme0n1p1
UUID=6FB7-0EF9      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro	0 2

/dev/nvme1n1  /alternative_e  ext4  defaults  0  2

here is my question should I use UUID  Disk identifier: FD246CAE-848F-4DBC-8B87-1FB36B4EF00A on fdisk?

if it possible should I umount /dev/alternative_e and mount it again to like following example:

/dev/nvme1n1  /alternative_e  ext4  defaults  0  2

to

/dev/nvme0n1  /  ext4  defaults  0  2

ALSO everytime I try to format nvme1n1 via gdisk all the mount like /boot /home etc will be move to nvme1n1 which bring me to emergency mode in startup.

my only temporary solution is to format gdisk /dev/nvme0n1 so all mount move back to nvme0n1 and run this command again.

mount /dev/nvme1n1 /mnt/alternative_e

I really hope someone can help me give me the solution for my problem and question since I not good at unix system yet.

Offline

#2 2023-12-28 07:30:37

seth
Member
Registered: 2012-09-03
Posts: 65,993

Re: How to modify /etc/fstab from nvme1n1 to nvme0n1?

You should use the UUID (in this case "UUID=2a5269c3-623f-4f9e-a19e-f8420044f59c") in /etc/fstab. Always.
The device order isn't deterministic and nvme0n1 and nvme1n1 can swap positions with every boot.

Offline

#3 2023-12-28 08:33:43

breadegg4
Member
Registered: 2023-12-28
Posts: 9

Re: How to modify /etc/fstab from nvme1n1 to nvme0n1?

seth wrote:

You should use the UUID (in this case "UUID=2a5269c3-623f-4f9e-a19e-f8420044f59c") in /etc/fstab. Always.
The device order isn't deterministic and nvme0n1 and nvme1n1 can swap positions with every boot.

Hi seth thanks for the reply.

is there way to make it persistent in nvme0n1?

in case nvme1n1 broke or failed. I need to get new NVME and mount it to alternative_e again. if possible i want to avoid that scenario.

Offline

#4 2023-12-28 09:26:01

loqs
Member
Registered: 2014-03-06
Posts: 18,471

Re: How to modify /etc/fstab from nvme1n1 to nvme0n1?

Use one of the other persistent naming methods?

Offline

#5 2023-12-29 05:54:23

goro9922
Member
Registered: 2019-04-12
Posts: 41

Re: How to modify /etc/fstab from nvme1n1 to nvme0n1?

Now is a good time to figure out how you're going to do regular backups of important data, and how you're going to restore it.

Offline

#6 2023-12-29 07:03:58

kermit63
Member
Registered: 2018-07-04
Posts: 334

Re: How to modify /etc/fstab from nvme1n1 to nvme0n1?

I'm not sure I understand your question(s) correctly, so I'll tell you what I think you mean with your original post:

Issue #1
1/ You have an external drive that you want to make backups to using clonezilla. This is the "/dev/nvme1n1  /alternative_e  ext4  defaults  0  2" entry in your /etc/fstab/
2. In it's current state, you can't backup with clonezilla since it requires root privileges. So you want to modify the /etc/fstab entry so you can.

AFAIK, running Clonezilla requires root privileges, even if you grant the external drive R/W access to your user account.

Also, I don't think you can run clonezilla while booted into your system since it will not work if your system partitions are mounted. It will work in certain specific cases, like if the partition you want to backup can be unmounted, but if you want to backup the entire drive, then you can't do it within your installation. You need a bootable live medium that has clonezilla in it.

Issue #2

here is my question should I use UUID  Disk identifier: FD246CAE-848F-4DBC-8B87-1FB36B4EF00A on fdisk?

As seth already said, you should use the UUID of the partition UUID=2a5269c3-623f-4f9e-a19e-f8420044f59c, not the UUID of the drive.

Issue #3

is there way to make it persistent in nvme0n1?
in case nvme1n1 broke or failed. I need to get new NVME and mount it to alternative_e again. if possible i want to avoid that scenario.

As long as the UUID of the partition in the external drive is the same (2a5269c3-623f-4f9e-a19e-f8420044f59c), even if you change the drive. In case of a replacement drive, you can use tune2fs to manually set the UUID of the newly created partition.


EDIT:  In retrospect, all these questions about UUID and /etc/fstab is moot, since you can't make a full system backup while booted into your arch installtion using clonezilla.

Last edited by kermit63 (2023-12-29 07:16:36)


Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.

Offline

Board footer

Powered by FluxBB