Format Hard Disk to New Filesystem [Solved]

Everything about X, Gnome, KDE, ... and everything running on it

Format Hard Disk to New Filesystem [Solved]

Postby larry77 » 2020-11-19 15:59

Dear All,
I need a word of wisdom before I make my life complicated.
This is the situation on a workstation I own

Code: Select all
$ df -T
Filesystem     Type      1K-blocks       Used  Available Use% Mounted on
udev           devtmpfs   16380328          0   16380328   0% /dev
tmpfs          tmpfs       3281684       9736    3271948   1% /run
/dev/sdc1      xfs        68324768   23748600   44576168  35% /
tmpfs          tmpfs      16408420     485280   15923140   3% /dev/shm
tmpfs          tmpfs          5120          4       5116   1% /run/lock
tmpfs          tmpfs      16408420          0   16408420   0% /sys/fs/cgroup
/dev/sdc3      xfs      2831227196 1126631988 1704595208  40% /home
/dev/sdb1      xfs      2928834296  508384704 2420449592  18% /home/lorenzo/toshiba2
/dev/sda1      ext4     2884152536  196890092 2540732808   8% /home/lorenzo/extra


I have 3 hard drives and two of them are xfs and one (for historical reasons) is ext4. Without going into any war about which filesystem is better, suppose that I want to change the sda1 hard disk from ext4--->to xfs. I have plenty of space so I can move its present content somewhere else.
Is there any easy way to do it and remount everything back as it is?
I simply want to have xfs everywhere.
Cheers

larry77
Last edited by larry77 on 2020-11-22 22:02, edited 1 time in total.
User avatar
larry77
 
Posts: 530
Joined: 2006-09-24 17:59

Re: Format Hard Disk to New Filesystem

Postby sgosnell » 2020-11-19 17:00

It's easy enough to reformat a drive. You can do it from the command line or with gparted, as you choose.
Take my advice, I'm not using it.
sgosnell
 
Posts: 906
Joined: 2011-03-14 01:49

Re: Format Hard Disk to New Filesystem

Postby larry77 » 2020-11-19 18:53

I did this with gparted, but now the workstation complains because it does not find the disk and starts only in emergency mode (no graphical interface).
Any idea about how to fix this?
Thanks!
User avatar
larry77
 
Posts: 530
Joined: 2006-09-24 17:59

Re: Format Hard Disk to New Filesystem

Postby CwF » 2020-11-19 19:04

fsarchiver would have been the ticket.

larry77 wrote:emergency mode

Did you change the UUID?
CwF
 
Posts: 810
Joined: 2018-06-20 15:16

Re: Format Hard Disk to New Filesystem

Postby larry77 » 2020-11-19 19:29

CwF wrote:fsarchiver would have been the ticket.

larry77 wrote:emergency mode

Did you change the UUID?


I do not know anything about the UUID. I just used gparted naively thinking that I could not do too much damage since I did not touch the hdd with the operating system installation. It is possible that gparted changed it, but I did not do it willingly.
User avatar
larry77
 
Posts: 530
Joined: 2006-09-24 17:59

Re: Format Hard Disk to New Filesystem

Postby sgosnell » 2020-11-20 03:34

You will probably need to edit /etc/fstab to use the new UUID. You can use nano or whatever command-line text editor you have installed to do that. First, get the UUID with blkid as root, copy that UUID, and paste it to the appropriate line in fstab. It should then boot. You can add nofail to the options if you want, to prevent boot failure if it's not present for some reason. If you really want to use a GUI for most of the editing, just comment the line for sda1 by inserting # as the first character in the line, boot to your desktop, and then edit fstab as root with whatever text editor you like. I find it easier to use nano, but that's just my preference.
Take my advice, I'm not using it.
sgosnell
 
Posts: 906
Joined: 2011-03-14 01:49

Re: Format Hard Disk to New Filesystem

Postby larry77 » 2020-11-20 08:06

Thanks, finally due to time constraint, believe it or not, it was faster to reinstall.
I will call this experience (a good naming for your own mistakes).
User avatar
larry77
 
Posts: 530
Joined: 2006-09-24 17:59

Re: Format Hard Disk to New Filesystem

Postby sgosnell » 2020-11-20 16:43

Yes, a reinstall is usually faster, unless you have a lot of data that has to be retained. Even so, a full backup, reinstallation, and returning the data is usually faster. Each situation is a little different, though.
Take my advice, I'm not using it.
sgosnell
 
Posts: 906
Joined: 2011-03-14 01:49


Return to Desktop & Multimedia

Who is online

Users browsing this forum: Scorpion and 17 guests

fashionable